Skip to content

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

Open
@nalzok

Description

@nalzok

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.

Activity

bradcush

bradcush commented on Jun 12, 2022

@bradcush

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

alessio-perugini commented on Aug 5, 2023

@alessio-perugini
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

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itselftype: enhancementProposed improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @cmaglie@bradcush@alessio-perugini@per1234@nalzok

      Issue actions

        Feature Request: read sketch.json for project-specific settings (e.g. FQBN) · Issue #100 · arduino/arduino-language-server