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

Don't show settingsNotOverridable if vscode settings file has a larger scope than the current project #6428

Open
laundmo opened this issue Sep 23, 2024 · 5 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet

Comments

@laundmo
Copy link

laundmo commented Sep 23, 2024

I have a few python.analysis settings in my user settings.json in vscode. I use these for projects which do not specify pylance settings in pyproject.toml. This means i cannot remove these lines from my user settings.json without affecting a lot of projects.

These lines are being reported as settingsNotOverridable when a project is opened which does have a pyproject.toml. This is quite annoying, as they show up in the same context as problems with my projects code.

I'm not sure what a viable solution to this is, but settingsNotOverridable should not happen for user/global settings.json. It only makes sense for project-specific settings.json.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 23, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 23, 2024

The global settings won't apply in the current workspace, so it makes sense for the error to show up there too. Maybe we should change the wording on the error message.

@laundmo
Copy link
Author

laundmo commented Sep 23, 2024

i'm aware it wont apply. Making that an error makes no sense to me.

I don't get errors when overwriting other user settings in a workspace settings.json. So why shoupd i get errors overwriting these specific ones with a project config?

no other vscode extension works like this. its just annoying error messages where none are needed.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 23, 2024

Because the errors indicate your settings don't work. Regardless of where they are, if there is a pyrightconfig.json file, no settings.json settings will apply (for the settings that come from pyrightconfig.json). So it doesn't matter if they're global or if they're in a workspace settings.json, they don't get applied to Pylance.

I think I'm misunderstanding your issue. Do you not want to know that your settings won't apply? As in you don't care? Maybe it should be a warning instead of an error.

@laundmo
Copy link
Author

laundmo commented Sep 25, 2024

Do you not want to know that your settings won't apply?

Well, yeah? It's what basically all other tools do. Hierarchical configs are extremely common and basically never lead to warnings/errors about their intended behaviour - more specific config files overwriting less specific ones.

Let's look at default VS Code behaviour:
There are actually up to 4 levels of settings

  • default
  • application
  • user/profile
  • workspace

I'll use workspace and user/profile since the others have various special cases

If I define "editor.wordWrap"="off" in my profile settings, and "editor.wordWrap"="on" in my workspace settings (.vscode/settings.json in repo) it also doesn't warn me my profile settings won't apply. It doesn't even grey it out like it does for unrecognized settings.

It's the same with any hierarchical configuration I'm aware of. There are no errors or warnings if a more specific config changes the more general one. Pylance is the first tool which I've come across which does this, and the fact that it shows up like a problem with my project, the same way, for example, type errors would, is annoying.

I just always have these errors sitting there which are reported the exact same way as errors I SHOULD fix, but these I CANNOT fix. They clutter the problems tab and force me to scroll down to reach actual problems.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 25, 2024

Seems like these errors should be warnings (or grayed out somehow) in the global settings then. Cause the settings are likely are on purpose, so you shouldn't be removing those settings as you said.

@bschnurr bschnurr added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants