]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
removed quotes in dicts key and backslashes for new lines
authorUbaldo Tiberi <ubaldo.tiberi@gmail.com>
Sat, 20 May 2023 18:44:31 +0000 (20:44 +0200)
committerUbaldo Tiberi <ubaldo.tiberi@gmail.com>
Sat, 20 May 2023 18:44:31 +0000 (20:44 +0200)
README.md
doc/lsp.txt

index fa1faafea1804d7769566a7c04f6dbcc3f0a77e8..b67accb7746858ae91301ccf7e3c81abe0fa6a82 100644 (file)
--- a/README.md
+++ b/README.md
@@ -56,37 +56,37 @@ vim9script
 
 # Clangd language server
 call LspAddServer([{
-       \    'name': 'clangd',
-       \    'filetype': ['c', 'cpp'],
-       \    'path': '/usr/local/bin/clangd',
-       \    'args': ['--background-index']
-       \  }])
+           name: 'clangd',
+           filetype: ['c', 'cpp'],
+           path: '/usr/local/bin/clangd',
+           args: ['--background-index']
+         }])
 
 # Javascript/Typescript language server
 call LspAddServer([{
-       \    'name': 'typescriptlang',
-       \    'filetype': ['javascript', 'typescript'],
-       \    'path': '/usr/local/bin/typescript-language-server',
-       \    'args': ['--stdio'],
-       \  }])
+           name: 'typescriptlang',
+           filetype: ['javascript', 'typescript'],
+           path: '/usr/local/bin/typescript-language-server',
+           args: ['--stdio'],
+         }])
 
 # Go language server
 call LspAddServer([{
-       \    'name': 'golang',
-       \    'filetype': ['go', 'gomod'],
-       \    'path': '/usr/local/bin/gopls',
-       \    'args': ['serve'],
-       \    'syncInit': v:true
-       \  }])
+           name: 'golang',
+           filetype: ['go', 'gomod'],
+           path: '/usr/local/bin/gopls',
+           args: ['serve'],
+           syncInit: v:true
+         }])
 
 # Rust language server
 call LspAddServer([{
-       \    'name': 'rustlang',
-       \    'filetype': ['rust'],
-       \    'path': '/usr/local/bin/rust-analyzer',
-       \    'args': [],
-       \    'syncInit': v:true
-       \  }])
+           name: 'rustlang',
+           filetype: ['rust'],
+           path: '/usr/local/bin/rust-analyzer',
+           args: [],
+           syncInit: v:true
+         }])
 ```
 
 The above lines register the language servers for C/C++, Javascript/Typescript, Go and Rust file types.  Refer to the [Wiki](https://github.com/yegappan/lsp/wiki) page for various language server specific configuration.
@@ -108,13 +108,13 @@ If you used [vim-plug](https://github.com/junegunn/vim-plug) to install the LSP
 ```viml
 vim9script
 var lspServers = [
-       \     {
-       \        'name': 'clang',
-       \        'filetype': ['c', 'cpp'],
-       \        'path': '/usr/local/bin/clangd',
-       \        'args': ['--background-index']
-       \      }
-       \   ]
+            {
+                name: 'clang',
+                filetype: ['c', 'cpp'],
+                path: '/usr/local/bin/clangd',
+                args: ['--background-index']
+             }
+          ]
 autocmd VimEnter * call LspAddServer(lspServers)
 
 var lspOpts = {'autoHighlightDiags': v:true}
index 6688704a421e4b95967fefde1e5bbf8461f9d922..ef8223a630c1493aaffd2c6735e5c4d1e6a59096 100644 (file)
@@ -166,19 +166,19 @@ LSP plugin, the steps are described later in this section: >
 
    vim9script
    var lspServers = [
-               \     {
-               \        'name': 'typescriptls',
-               \        'filetype': ['javascript', 'typescript'],
-               \        'path': '/usr/local/bin/typescript-language-server',
-               \        'args': ['--stdio']
-               \      },
-               \     {
-               \        'name': 'pythonls',
-               \        'filetype': 'python',
-               \        'path': '/usr/local/bin/pyls',
-               \        'args': ['--check-parent-process', '-v']
-               \      }
-               \   ]
+                    {
+                        name: 'typescriptls',
+                        filetype: ['javascript', 'typescript'],
+                        path: '/usr/local/bin/typescript-language-server',
+                        args: ['--stdio']
+                     },
+                    {
+                        name: 'pythonls',
+                        filetype: 'python',
+                        path: '/usr/local/bin/pyls',
+                        args: ['--check-parent-process', '-v']
+                     }
+                  ]
    call LspAddServer(lspServers)
 <
 Depending on the location of the typescript and python pyls language servers
@@ -190,49 +190,49 @@ Shell script, Vim script and PHP file types: >
 
    vim9script
    var lspServers = [
-               \     {
-               \        'name': 'clangd',
-               \        'filetype': ['c', 'cpp'],
-               \        'path': '/usr/local/bin/clangd',
-               \        'args': ['--background-index']
-               \     },
-                \     {
-               \        'name': 'golang',
-                \        'filetype': ['go', 'gomod', 'gohtmltmpl', 'gotexttmpl'],
-                \        'path': '/path/to/.go/bin/gopls',
-                \        'args': [],
-                \        'syncInit': v:true,
-                \      },
-                \     {
-               \        'name': 'rustls',
-                \        filetype': ['rust'],
-                \        'path': '/path/to/.cargo/bin/rust-analyzer',
-                \        'args': [],
-                \        'syncInit': v:true,
-                \      },
-               \     {
-               \        'name': 'bashls',
-               \        'filetype': 'sh',
-               \        'path': '/usr/local/bin/bash-language-server',
-               \        'args': ['start']
-               \     },
-               \     {
-               \        'name': 'vimls',
-               \        'filetype': ['vim'],
-               \        'path': '/usr/local/bin/vim-language-server',
-               \        'args': ['--stdio']
-               \     },
-               \     {
-               \        'name': 'phpls',
-               \        'filetype': ['php'],
-               \        'path': '/usr/local/bin/intelephense',
-               \        'args': ['--stdio'],
-               \        'syncInit': v:true,
-               \        'initializationOptions': {
-               \          'licenceKey': 'xxxxxxxxxxxxxxx'
-               \        }
-               \      }
-               \   ]
+                    {
+                       name: 'clangd',
+                       filetype: ['c', 'cpp'],
+                       path: '/usr/local/bin/clangd',
+                       args: ['--background-index']
+                    },
+                     {
+                       name: 'golang',
+                        filetype: ['go', 'gomod', 'gohtmltmpl', 'gotexttmpl'],
+                        path: '/path/to/.go/bin/gopls',
+                        args: [],
+                        syncInit: v:true,
+                      },
+                     {
+                       name: 'rustls',
+                        filetype: ['rust'],
+                        path: '/path/to/.cargo/bin/rust-analyzer',
+                        args: [],
+                        syncInit: v:true,
+                      },
+                    {
+                       name: 'bashls',
+                       filetype: 'sh',
+                       path: '/usr/local/bin/bash-language-server',
+                       args: ['start']
+                    },
+                    {
+                       name: 'vimls',
+                       filetype: ['vim'],
+                       path: '/usr/local/bin/vim-language-server',
+                       args: ['--stdio']
+                    },
+                    {
+                       name: 'phpls',
+                       filetype: ['php'],
+                       path': '/usr/local/bin/intelephense',
+                       args: ['--stdio'],
+                       syncInit: v:true,
+                       initializationOptions: {
+                       licenceKey: 'xxxxxxxxxxxxxxx'
+                       }
+                     }
+                  ]
    call LspAddServer(lspServers)
 <
 To add a language server, the following information is needed:
@@ -356,13 +356,13 @@ server and to set the language server options.  For example: >
 
     vim9script
     var lspServers = [
-               \     {
-               \        'name': 'clangd',
-               \        'filetype': ['c', 'cpp'],
-               \        'path': '/usr/local/bin/clangd',
-               \        'args': ['--background-index']
-               \      }
-               \   ]
+                    {
+                       name: 'clangd',
+                       filetype: ['c', 'cpp'],
+                       path: '/usr/local/bin/clangd',
+                       args: ['--background-index']
+                     }
+                  ]
     autocmd VimEnter * call LspAddServer(lspServers)
 
     var lspOpts = {'autoHighlightDiags': v:true}
@@ -1050,13 +1050,13 @@ python: >
 
     vim9script
     var lspServers = [
-               \     {
-               \       'filetype': 'python',
-               \       'omnicompl': v:false,
-               \       'path': '/usr/local/bin/pyls',
-               \       'args': ['--check-parent-process', '-v']
-               \     }
-               \   ]
+                    {
+                       filetype: 'python',
+                       omnicompl: v:false,
+                       path: '/usr/local/bin/pyls',
+                       args: ['--check-parent-process', '-v']
+                    }
+                  ]
 <
 If you want to use omni completion, in addition to the automatic completion,
 then you can set the 'omnifunc' option to the "g:LspOmniFunc" function: >