-
-
Notifications
You must be signed in to change notification settings - Fork 17
Some tweaks on how sketch is rebuild during editing #118
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
Conversation
We should look into Language Server Index Format Specification (LSIF):
|
It looks promising. In
In
|
8d531b9
to
98c8115
Compare
I've included most of your changes here. We should probably document better the |
f4e9cb1
to
54a4e45
Compare
A full build is made only at language server startup. Other full builds are performed by the IDE and build_path should be passed to the LS with a custom command "ino/didCompleteBuild". Co-authored-by: a.kitta@arduino.cc
54a4e45
to
f9eafe3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the new feature.
Please check if the PR fulfills these requirements
before creating one)
What kind of change does this PR introduce?
With this patch, we should gain some speed improvements in sketch rebuilds by caching libraries detection results from previous builds.
What is the current behavior?
When the sketch is rebuilt the libraries detection phase could take a very long time, especially if the sketch uses a lot of libraries or even a single library that contains a lot of files.
What is the new behavior?
The sketch is now rebuilt skipping the libraries detection and using the libraries detected on the latest "full" build.
A single "full" build is done when the language server is started, all subsequent builds will be without libraries detection. This means that
#include <...>
added after the language server startup may not be indexed/recognized until the next full build.To trigger a new "full" build there are now two ways:
arduino/buildCompleted
LSP notification from the IDEThe
arduino/buildCompleted
notification is an Arduino custom notification (it's not part of the LSP specification), it should be sent by the IDE to the language server after a full compile is triggered by the user of the IDE. Inside the notification, there is abuildPath
field that should point to the path of the build directory so the language server can pick the result of libraries detection from there.Other information
This PR uses a patched
arduino-cli
that support theSkipLibrariesDiscovery
flag: arduino/arduino-cli#1777