Comments (16)
@monosans hi! I've checked that project again with different scenarions and the bug never came up. I suppose it's gone now. The only thing that changed is the vscode version, I think, so the problem must have had been there. Thank you for your work!
from djlint-vscode.
Got a little follow-up on this bug:
-New "problems" appear when when the cursor is moved anywhere on the code that has got any problems by itself. It's not enough to just open the file, you also have to move mouse over the code once. Once the errors appear, they stay in the tab forever, untill you restart VSCode
-For each single file with problems, a single temporary file is generated in which all the problems of the open file are highlighted in the "problems" tab. The file is called 0.(16 digits).html, it can be opened in the vscode, but it can not be edited. (The message says: Cannot edit in read-only editor). When moving a mouse over this read-only file, new files do not appear.
-The errors in this file contain errors ignored in the pyproject.toml config (but they are ignored in the original file)
Hope this helps!
from djlint-vscode.
Everything works for me, I'm confused.
Any idea where this temporary file is coming from?
from djlint-vscode.
The hypothesis is it's either a temporary file on disk, on in memory, which is created on the first cycle of file scan to find all the error. It's path is <path_to_file>/<filename.html>/0.<16 digits>.html, it's somehow inside the html file being edited. It's either created by the extension, or by some king of daemon inside the VSCode itself.
I've tried to disable linting for files like that in in the settings by using it's path mask, but failed :)
from djlint-vscode.
@holohup did you try with all other extensions disabled? Any chance you can take a screenshot video of what is happening?
from djlint-vscode.
@holohup could you also share your vscode settings? Are you saving files on a removable storage?
from djlint-vscode.
Hi. The config file is:
{
"workbench.colorTheme": "Default Dark+",
"editor.fontWeight": "normal",
"editor.fontLigatures": false,
"window.zoomLevel": 1,
"files.associations": {
"/*.html": "html",
"/templates//*.html": "django-html",
"/templates//*": "django-txt",
"/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"emmet.includeLanguages": {
"django-html": "html"
},
"[html]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[django-html]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[handlebars]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[hbs]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[mustache]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[jinja]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[jinja-html]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[nj]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[njk]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[nunjucks]": {
"editor.defaultFormatter": "monosans.djlint"
},
"[twig]": {
"editor.defaultFormatter": "monosans.djlint"
},
"editor.defaultFormatter": "monosans.djlint",
"[python]": {
"editor.defaultFormatter": "ms-python.python"
},
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"djlint.useEditorIndentation": false,
"explorer.confirmDragAndDrop": false
}
I am using an internal mac SSD, no removable storages attached.
As for the video, I'll try to record it this weekend.
I've tried disabling the extensions, the bugs stops appearing when I turn the pyton/pylance combo off, but the formatting stops working too. The formatting for the comments uses the same syntax as vscode, so the code I've copy-pasted looks out of square, attaching a screenshot for that part
.
from djlint-vscode.
Odd, I wonder what makes the problems tab update. I copied in your config and made a few html.j2 files. I only get problems showing up/updating when I save the file.
I also have the pylance and python extensions installed. Do they have their own settings that trigger the linting on hover?
from djlint-vscode.
Hey there,
I've uploaded a 1-minute video: https://youtu.be/xkbqMmvgAyk
Hope it helps!
from djlint-vscode.
Hey there, I've uploaded a 1-minute video: youtu.be/xkbqMmvgAyk Hope it helps!
I tried to do the same thing on Linux and Windows and it works fine. I think we should start by figuring out what exactly creates the temporary files. I was also confused by the fact that on your video linting only works on these temporary files, but not on regular files.
Can you also please upload your pip freeze
? I will try to install the same versions of the dependencies and the same version of Python.
from djlint-vscode.
I'm currently working on a mac M1, maybe the vscode works somehow different on this architecture? I think you got it wrong - I was hovering over regular files, and in the end I've opened a temporary file (all text plain white) to show it's path inside the regular file.
My pip freeze looks like this:
asgiref==3.5.2
attrs==21.4.0
autopep8==1.6.0
certifi==2022.6.15
charset-normalizer==2.0.12
click==8.1.3
colorama==0.4.5
coverage==6.4.2
Django==2.2.19
djlint==1.7.2
Faker==12.0.1
flake8==4.0.1
html-tag-names==0.1.2
html-void-elements==0.1.0
idna==3.3
importlib-metadata==4.12.0
iniconfig==1.1.1
mccabe==0.6.1
mixer==7.1.2
packaging==21.3
pathspec==0.9.0
Pillow==8.3.1
pluggy==0.13.1
py==1.11.0
pycodestyle==2.8.0
pyflakes==2.4.0
pyparsing==3.0.9
pytest==6.2.4
pytest-django==4.4.0
pytest-pythonpath==0.7.3
python-dateutil==2.8.2
pytz==2022.1
PyYAML==6.0
regex==2022.7.25
requests==2.26.0
six==1.16.0
sorl-thumbnail==12.7.0
sqlparse==0.4.2
toml==0.10.2
tomli==2.0.1
tqdm==4.64.0
typing_extensions==4.3.0
urllib3==1.26.11
zipp==3.8.1
from djlint-vscode.
I'm currently working on a mac M1, maybe the vscode works somehow different on this architecture?
I don't think it has anything to do with macOS, because the person here had an identical problem, but on Windows.
My pip freeze looks like this:
I installed the same versions of the dependencies, but I still could not reproduce the issue.
from djlint-vscode.
There's still hope that someone who can bring more details into this issue googles this page and helps. Thank you for your efforts!
from djlint-vscode.
Do any other linters have the same problem? pylint, or htmllint, or another?
from djlint-vscode.
Hey. Got no problems using other linters.
from djlint-vscode.
@holohup is the problem still relevant?
from djlint-vscode.
Related Issues (20)
- Wrong HTML formatting? HOT 1
- Is it possible to autofix certain problems? HOT 2
- Is it possible to disable the extension for specific file types? HOT 3
- settings djlint.configuration relative paths HOT 6
- Ignore linting tags do not work HOT 1
- Extension tries to access clipboard HOT 8
- djLint is not installed for the current active Python interpreter. HOT 2
- Regular ENOENT when using in SSH Remote HOT 13
- Problem on self closing tabs HOT 1
- v2023.8.10 locks up keyboard in vscode. HOT 7
- Publish to Open VSX Registry
- Formatter is appending to file HOT 3
- Code duplicated when formatting Django HTML HOT 6
- Buggy behaviour when commenting and uncommenting via Toggle Line Comment vscode shortcut in Django HTML. HOT 1
- djLint should not attempt to lint HTML files in non-Django projects HOT 9
- Formatting and Linting Not Working in VSCode Starting with Version 2024.5.0 HOT 5
- The VSCode extension `djlint` should not require people to install the Python package HOT 2
- Formatter not working when pyproject.toml not at project root HOT 7
- Configuration from pyproject.toml is being ignore in v2022.10.1 HOT 20
- Inconsistent indentation within VSCode and using pre-commit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djlint-vscode.