Automatically detect the path of clangd
, arduino-cli
, and its configuration
#115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
before creating one)
Tests have not been added because I don't see any tests for command option handling in the existing code.
What kind of change does this PR introduce?
Better out-of-the-box configuration by default.
What is the current behavior?
arduino-language-server
always requires providing fullarduino-cli
andclangd
executable paths, and thearduino-cli
configuration file path, even though these may vary across systems. This makes them difficult to include in project/editor configuration which is the same across systems.What is the new behavior?
There should be no differences in behavior for successful runs.
Previously failing commands may now be successful if everything can be autodetected, along with printing a log message saying so.
Error messages will be different for failed runs when a configuration file is provided but
arduino-cli
could not be detected - previously it would ask for a daemon address, now it will ask for a path toarduino-cli
.Other information:
I've split the PR into separate commits for searching
$PATH
vs. finding the configuration file as they may have different issues to discuss. (Or if there is a better / more thorough way of finding the default configuration file I'm not aware of.)