aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgithub-actions <github-actions@github.com>2022-12-31 01:58:49 +0000
committergithub-actions <github-actions@github.com>2022-12-31 01:58:49 +0000
commit6b43ce561d97412cc512b569db6938e44529293e (patch)
tree2369fed3edb9d65d3e0718fc12f1819aa60e1031
parentfeat: include cmd option for arduino_language_server (#2242) (diff)
downloadnvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar.gz
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar.bz2
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar.lz
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar.xz
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.tar.zst
nvim-lspconfig-6b43ce561d97412cc512b569db6938e44529293e.zip
docs: update server_configurations.md
skip-checks: true
-rw-r--r--doc/server_configurations.md50
-rw-r--r--doc/server_configurations.txt50
2 files changed, 72 insertions, 28 deletions
diff --git a/doc/server_configurations.md b/doc/server_configurations.md
index b56b7f1f..f0c35424 100644
--- a/doc/server_configurations.md
+++ b/doc/server_configurations.md
@@ -490,37 +490,55 @@ instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#crea
for generating a configuration file if you haven't done so already, and make
sure you [install any relevant platforms
libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board).
-Make sure to save the full path to the created `arduino-cli.yaml` file for later.
The language server also requires `clangd` to be installed. Follow [these
installation instructions](https://clangd.llvm.org/installation) for your
platform.
-Next, you will need to decide which FQBN to use.
-To identify the available FQBNs for boards you currently have connected, you may use the `arduino-cli` command, like so:
+If you don't have a sketch yet create one.
+
+```sh
+$ arduino-cli sketch new test
+$ cd test
+```
+
+You will need a `sketch.json` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
+
+
+First gather some information about your board. Make sure your board is connected and run the following:
```sh
$ arduino-cli board list
Port Protocol Type Board Name FQBN Core
/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr
- ^^^^^^^^^^^^^^^
```
-After all dependencies are installed you'll need to set the command for the
-language server in your setup:
+Then generate the file:
-```lua
-require'lspconfig'.arduino_language_server.setup {
- cmd = {
- "arduino-language-server",
- "-cli-config", "/path/to/arduino-cli.yaml",
- "-fqbn", "arduino:avr:uno",
- "-cli", "arduino-cli",
- "-clangd", "clangd"
+```sh
+arduino-cli board attach -p /dev/ttyACM0 test.ino
+```
+
+The resulting file should like like this:
+
+```json
+{
+ "cpu": {
+ "fqbn": "arduino:avr:uno",
+ "name": "Arduino Uno",
+ "port": "serial:///dev/ttyACM0"
}
}
```
+Your folder structure should look like this:
+
+```
+.
+├── test.ino
+└── sketch.json
+```
+
For further instruction about configuration options, run `arduino-language-server --help`.
@@ -532,6 +550,10 @@ require'lspconfig'.arduino_language_server.setup{}
**Default values:**
+ - `cmd` :
+ ```lua
+ { "arduino-language-server" }
+ ```
- `filetypes` :
```lua
{ "arduino" }
diff --git a/doc/server_configurations.txt b/doc/server_configurations.txt
index b56b7f1f..f0c35424 100644
--- a/doc/server_configurations.txt
+++ b/doc/server_configurations.txt
@@ -490,37 +490,55 @@ instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#crea
for generating a configuration file if you haven't done so already, and make
sure you [install any relevant platforms
libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board).
-Make sure to save the full path to the created `arduino-cli.yaml` file for later.
The language server also requires `clangd` to be installed. Follow [these
installation instructions](https://clangd.llvm.org/installation) for your
platform.
-Next, you will need to decide which FQBN to use.
-To identify the available FQBNs for boards you currently have connected, you may use the `arduino-cli` command, like so:
+If you don't have a sketch yet create one.
+
+```sh
+$ arduino-cli sketch new test
+$ cd test
+```
+
+You will need a `sketch.json` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file like using the following commands.
+
+
+First gather some information about your board. Make sure your board is connected and run the following:
```sh
$ arduino-cli board list
Port Protocol Type Board Name FQBN Core
/dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr
- ^^^^^^^^^^^^^^^
```
-After all dependencies are installed you'll need to set the command for the
-language server in your setup:
+Then generate the file:
-```lua
-require'lspconfig'.arduino_language_server.setup {
- cmd = {
- "arduino-language-server",
- "-cli-config", "/path/to/arduino-cli.yaml",
- "-fqbn", "arduino:avr:uno",
- "-cli", "arduino-cli",
- "-clangd", "clangd"
+```sh
+arduino-cli board attach -p /dev/ttyACM0 test.ino
+```
+
+The resulting file should like like this:
+
+```json
+{
+ "cpu": {
+ "fqbn": "arduino:avr:uno",
+ "name": "Arduino Uno",
+ "port": "serial:///dev/ttyACM0"
}
}
```
+Your folder structure should look like this:
+
+```
+.
+├── test.ino
+└── sketch.json
+```
+
For further instruction about configuration options, run `arduino-language-server --help`.
@@ -532,6 +550,10 @@ require'lspconfig'.arduino_language_server.setup{}
**Default values:**
+ - `cmd` :
+ ```lua
+ { "arduino-language-server" }
+ ```
- `filetypes` :
```lua
{ "arduino" }