diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-09-08 09:30:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 09:30:20 -0700 |
| commit | 83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e (patch) | |
| tree | 963c8dd71437922c3b398a0f70a1aa9e62d7a0eb /lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| download | nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar.gz nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar.bz2 nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar.lz nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar.xz nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.tar.zst nvim-lspconfig-83a031146c53bcb33f7d8dc56e0e7d71cfdeee9e.zip | |
feat: add arduino language server (#1236)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/arduino_language_server.lua | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lua/lspconfig/arduino_language_server.lua b/lua/lspconfig/arduino_language_server.lua new file mode 100644 index 00000000..717c356f --- /dev/null +++ b/lua/lspconfig/arduino_language_server.lua @@ -0,0 +1,55 @@ +local configs = require 'lspconfig/configs' +local util = require 'lspconfig/util' + +configs.arduino_language_server = { + default_config = { + cmd = { 'arduino-language-server' }, + filetypes = { 'arduino' }, + root_dir = function(fname) + return util.root_pattern '*.ino'(fname) + end, + docs = { + description = [[ +https://github.com/arduino/arduino-language-server + +Language server for Arduino + +The `arduino-language-server` can be installed by running: + go get -u github.com/arduino/arduino-language-server + +The `arduino-cli` tools must also be installed. Follow these instructions for your distro: + https://arduino.github.io/arduino-cli/latest/installation/ + +After installing the `arduino-cli` tools, follow these instructions for generating +a configuration file: + https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file +and make sure you install any relevant platforms libraries: + https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board + +The language server also requires `clangd` be installed. It will look for `clangd` by default but +the binary path can be overridden if need be. + +After all dependencies are installed you'll need to override the lspconfig command for the +language server in your setup function with the necessary configurations: + +```lua +lspconfig.arduino_language_server.setup({ + cmd = { + -- Required + "arduino-language-server", + "-cli-config", "/path/to/arduino-cli.yaml", + -- Optional + "-cli", "/path/to/arduino-cli", + "-clangd", "/path/to/clangd" + } +}) +``` + +For further instruction about configuration options, run `arduino-language-server --help`. + +]], + }, + }, +} + +-- vim:et ts=2 sw=2 |
