Open robot-ranger opened 10 months ago
Thanks for reporting.
No idea what would caus that, no one else has reported similar problems despite a large number of active users.
I experience the same issue, not just on 0.20.0 but all versions as far back as 0.15.0.
While editing a .py.jinja
file, if I set the language to Python, intellisense and syntax highlighting work perfectly (apart from syntax errors at template elements).
If I set the language to Jinja Python, intellisense works like plain text (only existing tokens are suggested, no syntax checking, no tooltips), and syntax highlighting only partially works.
These are coloured correctly:
These remain rendered like plain text:
from datetime import datetime; datetime.now()
all instances of datetime
and now
)The same happens both with and without window reloads between switching languages.
I tried disabling all other extensions but the issue persists even with only Python, Pylance, and Better Jinja enabled.
With only Python extension and Better Jinja enabled, completions and tooltips still work with Python language selected but not with Jinja Python, and syntax highlighting is partial as above in both (which indicates that this is vanilla vscode behaviour).
With only Better Jinja enabled, all behaviour is the same in both languages, except around template elements.
This points towards an issue with these extensions cooperating, or the load sequence between them. It could also have to do with the Python interpreter path, as I have multiple local and virtual environments.
Versions:
This happens on both macOS Sonoma 14.3.1 and Windows 10 Pro 22H2 (with vscode running locally or remotely on WSL2 Ubuntu).
For what it's worth, similar happens with Jinja Ruby, which may be related.
With extensions:
While editing a .rb.jinja
file, setting the language to Ruby, both syntax highlighting and language support work.
Setting the language to Jinja Ruby, syntax highlighting still mostly works (not on imported symbols), but language support doesn't.
It's as if Better Jinja allows LSP to run as normal on non-Jinja parts, but completely ignores Solargraph.
im working on a fastAPI application; installed Better Jinja, and pylance breaks. disable Better Jinja and reload the vscode window and python language support starts working again.
Running in windows, vscode v1.84.0, pylance v2023.20.0
not sure what else to provide. lmk if i can provide anything, but atm i cant use Better Jinja with python apps.