Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Arduino Extension runs 'verify' on VS-Code startup #1287

Closed
iqapps opened this issue Jun 11, 2021 · 11 comments
Closed

Arduino Extension runs 'verify' on VS-Code startup #1287

iqapps opened this issue Jun 11, 2021 · 11 comments
Labels
fixed-pending-release Fix is merged and will be included in the next release. intellisense

Comments

@iqapps
Copy link

iqapps commented Jun 11, 2021

The latest release seem to run Arduino "verify" on its own when I start VS-Code and a Arduino project is loaded automatically.

For my part, it overwrites a the hex file, that maybe other parts of my git branch depends on. So, for my part, its a cause of errors and therefore a time stealer, as the hex file changes compile date and time or simply disappear if the last closed code could not compile.

Please dont make decisions on the community behalf and implement features that are disrupting the workflow and please dont implement new behavior without disclosing information about it in the release notes.

Please remove automatic verify as soon as possible or at least make it workspace/user configurable.

@Daedelos
Copy link

Agreed. The ability to turn off the auto verify on start/load would be such a time saver. I spent ages looking for a way to turn this off.

@rev1204
Copy link

rev1204 commented Jul 8, 2021

This, and also turn off auto verify every time the board config change. It's annoying when i change the options in board configuration like 6 options, and verify each time.

@magouero
Copy link

magouero commented Nov 1, 2021

Hello,
Agree also. No need to run verify at startup, nor when something changes.
Having this as an option or a popup asking "want to verify ?" maybe better.

Any way to prevent it today ?

@iqapps
Copy link
Author

iqapps commented Nov 8, 2021

Any news on this - really annoying - undocumented - feature ???

@robotdad
Copy link
Member

robotdad commented Feb 7, 2022

I'm not observing this behavior. From my perspective this would be beneficial if it did verify on open as IntelliSense doesn't work until a build (via verify) has run. I totally get that it shouldn't overwrite a previous build though. With CMake there is a difference between generate and a full build, we only need the former for IntelliSense. Seems like something like that would be beneficial here to not invalidate previous build results.

@aleun
Copy link
Contributor

aleun commented Mar 18, 2022

I've been able to repro this behavior in the latest release.

The root cause is that in #1183 we added a feature to enable regeneration of the Intellisense configuration on changes by registering a rebuild whenever settings change:

const dc = DeviceContext.getInstance();
dc.onChangeBoard(requestAnalysis);
dc.onChangeConfiguration(requestAnalysis);
dc.onChangeSketch(requestAnalysis);

Since the change event handlers fire on initial settings load, this had the side effect of also running analysis on load:

const arduinoApp = new ArduinoApp(arduinoSettings);
await arduinoApp.initialize();
// TODO: After use the device.json config, should remove the dependency on the ArduinoApp object.
const deviceContext = DeviceContext.getInstance();
await deviceContext.loadContext();

To recover the previous behavior, we could move await arduinoApp.initialize(); after await deviceContext.loadContext(); so that doesn't happen. To make it user-definable, we can turn this into a setting like arduino.analyzeOnOpen that defaults to false, as would be consistent with cmake.configureOnOpen. @robotdad @benmcmorran what do you think?

@benmcmorran
Copy link
Member

Thanks for the feedback @iqapps @Daedelos @rev1204 @magouero @BelKed! I've opened PR #1480 that adds two new options to make this configurable. Can you uninstall the Arduino extension, install the appropriate VSIX from this CI build, and let me know if it meets your needs? These new options can be set in settings.json:

  • arduino.analyzeOnOpen When true, automatically run analysis when the project is opened. Only works when arduino.analyzeOnSettingChange is true.
  • arduino.analyzeOnSettingChange When true, automatically run analysis when board, configuration, or sketch settings are changed.

Both options default to true so that IntelliSense continues to work out-of-the-box in the default configuration (like robotdad mentioned), but can be set in the user-level settings.json if you want them to be disabled in all your Arduino projects.

@benmcmorran benmcmorran added needs-more-info More details about this issue are needed for it to be actionable. and removed investigating labels Mar 24, 2022
@rev1204
Copy link

rev1204 commented Mar 24, 2022

Thank you @benmcmorran. This is what I need, it really helps. VSIX working correctly without problem.

@BelKed
Copy link
Contributor

BelKed commented Mar 24, 2022

Thanks, now it works as intended :)

@benmcmorran
Copy link
Member

Great! Thanks all for confirming. I'll get this merged and included in the next release.

@benmcmorran benmcmorran added fixed-pending-release Fix is merged and will be included in the next release. and removed needs-more-info More details about this issue are needed for it to be actionable. labels Mar 24, 2022
@github-actions
Copy link

github-actions bot commented May 3, 2022

This issue has been fixed in the latest release of this extension, which is available in the VS Code extension marketplace.

@github-actions github-actions bot closed this as completed May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-pending-release Fix is merged and will be included in the next release. intellisense
Projects
None yet
Development

No branches or pull requests

8 participants