This is the continuation of microsoft/vscode-python#292, i'm opening a new issue as requested by @brettcannon on microsoft/vscode-python#292
List all available properties and methods.
Can't recognize some methods (e.g: methods from the db object)
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
db.Col //Here the intellisense can't find the Column member
Reproducible. Need to look into analysis, the SQLAlchemy class appears to be fairly plain...
It looks like those methods are dynamically added. LS is a static analyzer and does not execute any Python code. Therefore members that are added dynamically, won't show up as static analyzer only sees what is declared in SQLAlchemy(object) and what is added in __init__().
Example
def _include_sqlalchemy(obj, cls):
for module in sqlalchemy, sqlalchemy.orm:
for key in module.__all__:
if not hasattr(obj, key):
setattr(obj, key, getattr(module, key))
# Note: obj.Table does not attempt to be a SQLAlchemy Table class.
obj.Table = _make_table(obj)
obj.relationship = _wrap_with_default_query_class(obj.relationship, cls)
obj.relation = _wrap_with_default_query_class(obj.relation, cls)
obj.dynamic_loader = _wrap_with_default_query_class(obj.dynamic_loader, cls)
obj.event = event
I got it. Thanks for your response @MikhailArkhipov.
Generally speaking, some systems, like Visual Studio, implement some support in some languages like C#, but in involves first actually including SQL project with schema into the solution so C# can pick it up and generate C# data source class from SQL schema and then C# intellisense picks it up as a regular C# object. Perhaps at some point Python tools will be able to provide something similar.
Most helpful comment
Reproducible. Need to look into analysis, the
SQLAlchemyclass appears to be fairly plain...