-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
[BUG] Changes to python.analysis.diagnosticSeverityOverrides are completely overwritten at startup #105
Comments
I gather the reason is that the activate function in extension.ts is just wholesale setting the value of {
"reportMissingModuleSource": "none"
} Which wipes out anything else in the settings.json file. I don't know javascript or the VS extensions API very well, but I will try to see if I can figure out how to merge what the extension wants to be in the settings with what already exists there. |
I found if I created a .workplace file the settings.json does not get reverted in that section anymore but then there is a chance when a bundle has updated the date in the path is not updated. |
I have a .workplace file too to support multiple different projects but the extension still overwrites my overrides. From what I can tell, the offending line is this: vscode-circuitpython/src/extension.ts Line 8 in 475d25c
I am not a ts developer but it seems like it's a simple fix to check if the setting doesn't exist and append it to the config. I found that you can set
at your user settings json and it seems like it doesn't overwrite it. From what I can tell from the code, it is overwriting workspace settings which are not the same as user settings. This unfortunately has the impact of changing all of your python projects unrelated to circuitpython ones. You might end up forgetting about it later. |
Not a solution to the bug reported here per se but you can probably solve your original problem by instead renaming |
This should ensure that only the config key we care about is updated, and not every other config that the user has set. As mentioned in joedevivo#105
I have this same issue, and I am not a TypeScript developer, but I am a python developer. I took a crack at the changes required, and would like somebody to review and approve: I don't know how to properly test the changes, so please review carefully. |
Describe the bug
When the extension starts up, the value for python.analysis.diagnosticSeverityOverrides in settings.json is completely overwritten, losing any user customized settings.
To Reproduce
Steps to reproduce the behavior:
"reportShadowedImports": "none"
to"python.analysis.diagnosticSeverityOverrides"
e.g.
"python.analysis.diagnosticSeverityOverrides"
no longer has the added value from step 2.Expected behavior
All user customizations to
"python.analysis.diagnosticSeverityOverrides"
in settings.json should be kept (extra options, and changes to extensions desired values).Desktop (please complete the following information):
Additional context
I want to add (and keep)
"reportShadowedImports": "none"
because Pylance complains that code.py overrides the stdlib module code.The text was updated successfully, but these errors were encountered: