Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger lint on changing document language #1088

Open
lonix1 opened this issue May 16, 2023 · 2 comments
Open

Trigger lint on changing document language #1088

lonix1 opened this issue May 16, 2023 · 2 comments

Comments

@lonix1
Copy link

lonix1 commented May 16, 2023

I want to disable the extension for shell scripts which are actually jinja2 templates. That is because shellcheck does not parse them properly and reports many errors.

So I did this in my .vscode/settings.json:

"files.associations": {
//"*.sh.j2": "shellscript",                   // I'm not using the default association
  "*.sh.j2": "jinja-shell",                   // associated with "Better Jinja" extension
},

"shellcheck.ignorePatterns": {
  "**/*.sh.j2": true,
},

But when I open a foo.sh.j2 file, shellcheck is still activated.

@lonix1
Copy link
Author

lonix1 commented May 16, 2023

UPDATE: after reloading vscode, the extension behaved as intended.

So it was remembering files previously opened, and would not ignore them after I changed the setting as shown above.

That's probably a bug.

@felipecrs
Copy link
Collaborator

In fact, what is happening here is that the extension only triggers itself based on your configuration: onType or onSave. If you had typed something in the Jinja2 file, it would probably recalculate and stop.

We can probably improve this though, so I'm changing the issue title to reflect what we can do.

By the way, this is probably not necessary:

"shellcheck.ignorePatterns": {
  "**/*.sh.j2": true,
},

@felipecrs felipecrs changed the title Disable for jinja2 template files Trigger lint on changing document language May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants