Skip to content
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

Feature Request: read sketch.json for project-specific settings (e.g. FQBN) #100

Open
nalzok opened this issue Mar 20, 2022 · 2 comments
Open
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@nalzok
Copy link

nalzok commented Mar 20, 2022

Requiring a -fqbn option on the command line makes it difficult to set project-specific board names, and the current workaround calls for hardcoded FQBN for each individual project, which is inconvenient and error-prone. It would be great if arduino-language-server could accept a -project-root option and check the sketch.json inside the project root directory to access all project-specific settings.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 20, 2022
@bradcush
Copy link

This should already be the case if your sketch.json file is at the same level as your ino file. In my case I'm using arduino_language_server with the Neovim built-in LSP which sets the root directory for the language server based on the location of the ino file. I haven't dug too deep but I have one language server client per root directory. I'm guessing if the language server process is started from a directory that contains a sketch.json file then it will use it.

@alessio-perugini
Copy link
Contributor

@nalzok it is possible. Just create a sketch.yaml in the root of your project and add the following key: default_fqbn: your_fqbn. By doing so you can change your neovim lspconfig removing the custom function and the -fqbn flag.

default_fqbn: arduino:avr:uno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants