bmd-studio / stm32-for-vscode

STM32 extension for working with STM32 and CubeMX in VSCode
MIT License
207 stars 27 forks source link

Build operation forcefully inserts workspace configuration variables #179

Open DeflateAwning opened 6 months ago

DeflateAwning commented 6 months ago

The Issue

I've noticed that when I build, the following configuration variables get added to my VSCode workspace configuration:

Why it's bad

These configuration variables are computer specific, and would be great as global system configuration variables. However, they are getting forcefully inserted into the .vscode/settings.json file (or into the *.code-workspace file, if I'm using that), which means that file must either be discarded before git committing, or .gitignore'd.

Code sections

These configuration variables are set from the src/configuration/cortexDebugConfig.ts file.

Proposed Fix

I'm not too sure what the best fix here is.

I'm a huge, huge fan of this project, and am completely willing to help improve it by trying to fix some of the issues I find! Thanks for bearing with my suggestions :)

jortbmd commented 6 months ago

Thanks for opening up this issue. The settings should not be added to the specific workspace. It should very much be a more user specific thing. I feel that this might be a bug due to the way the settings are handled and stored. Will look into this as this has come up more than once, which resulted in some other undesired behaviour.

DeflateAwning commented 3 months ago

This issue is pretty big for us as it prohibits storing the settings.json file in version control (which is needed for other settings). Is there any chance you'd be able to look into it, or help guide me toward where to investigate?

jortbmd commented 2 months ago

Hi. Thansk for responding to this issue. I have tried to solve this in the 3.2.7 release, which is not ready as of yet due to some issue. But maybe you can check if the current beta solves this issue. Might strip some of the offending features in 3.2.7 and do a smaller release to at least get rid of some of the smaller issues. You can find the beta here: https://github.com/bmd-studio/stm32-for-vscode/releases/tag/v3.2.7-beta

DeflateAwning commented 2 months ago

Very exciting - I didn't see the pre-release.

I'll give it a try. I'd be in support of a smaller release if some of the other features aren't ready!

DeflateAwning commented 2 months ago

Not fixed in 3.2.7-beta, unfortunately.

Reproduction:

  1. Install 3.2.7-beta from the .vsix file.
  2. Find a project compatible with this build system, and create a .vscode/settings.json file. Set a random config variable in it (e.g., {"editor.rulers": [100]} ), with nothing else in the file.
  3. Do a clean build of the project.
  4. See that "cortex-debug.armToolchainPath" and "cortex-debug.openocdPath" paths appear in the file.
jortbmd commented 2 months ago

Thanks for checking! Will have a look at it, should probably be a small fix. Will update you once it is done. Do note that it might take a little while.