Intellisense not available for flask-sqlalchemy
See original GitHub issueEnvironment data
- VS Code version: 1.30.2
- Extension version (available under the Extensions sidebar): 2018.12.1
- OS and version: macOS High Sierra 10.13.6
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions: flask-sqlalchemy
Expected behaviour
Show intellisense option for Column
Actual behaviour
Steps to reproduce:
# services/users/project/__init__.py
import os
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
# instantiate the app
app = Flask(__name__)
# set config
app_settings = os.getenv('APP_SETTINGS')
app.config.from_object(app_settings)
# instantiate the db
db = SQLAlchemy(app)
# model
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
fullname = db.Column(db.String(80))
User Settings
{
"editor.renderWhitespace": "all",
"files.associations": {
"*.txt": "tsv"
},
"editor.renderControlCharacters": false,
"workbench.startupEditor": "newUntitledFile",
"explorer.confirmDragAndDrop": false,
"python.venvPath": "~/.virtualenvs",
"python.jediEnabled": false,
"git.autofetch": true,
"git.confirmSync": false
}
Workspace Settings
{
"python.pythonPath": "/Users/nick.perkins/.virtualenvs/testdriven-app/bin/python",
"python.linting.pylintArgs": ["--load-plugins", "pylint_flask"]
}
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.75.0
Initializing for /Users/nick.perkins/.virtualenvs/testdriven-app/bin/python
Reloading modules...
Reloading modules...
done.
done.
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Why Flask-SQLAlchemy doesn't have intellisense support?
When almost entire Flask application is involves handing SQLAlchemy objects and methods, its quite problematic (no?)
Read more >Why don't I get code-completion in Flask/SQLAlchemy?
I'm facing the same problem using just SqlAlchemy without Flask. Python 3.10.7 SqlAlchemy 1.4.41. I read somewhere else, not sure now ...
Read more >Python - Visual Studio Marketplace
Extension for Visual Studio Code - IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, ...
Read more >SQLACODEGEN + VSCODE + Intellisense not working.
Jobmst is imported from a single module I've created called tidal.py. jobrow is an instance of Jobmst... But I can't select any of...
Read more >VS Code Intellisense not working - Python Forum
The official dedicated python forum. ... Thread Modes. VS Code Intellisense not working ... from sqlalchemy.orm import sessionmaker
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I faced a similar issue. My first guess is that it is because attributes of class SQLAlchemy are initialized by
setattr
function (https://github.com/pallets/flask-sqlalchemy/blob/master/flask_sqlalchemy/__init__.py#L78-L81)For example, Model is available: However, Column is not:
Dup of https://github.com/Microsoft/vscode-python/issues/2271