You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Editors/README.md
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,54 @@ As a test, open a Swift file, put the cursor on top of a symbol in normal mode a
143
143
:call CocAction('jumpDefinition')
144
144
```
145
145
146
+
### Neovim 0.8 and above
147
+
since version 0.8, neovim has native LSP support, which can be used to connect to sourcekit-lsp directly. To do so, add the following to
148
+
a .lua config file (such as `lua/swift.lua`):
149
+
150
+
```lua
151
+
require'lspconfig'.sourcekit.setup{
152
+
cmd= {'$TOOLCHAIN_PATH/usr/bin/sourcekit-lsp'}
153
+
}
154
+
```
155
+
where `$TOOLCHAIN_PATH` is the path to your active toolchain (for example, `/Library/Developer/Toolchains/swift-latest.xctoolchain`). This should enable
156
+
the lsp server directly, and you can test it by opening a swift file and running `:LspInfo`--you should get a window popping up saying "1 client attached to this buffer" and be able to do navigation and such.
157
+
158
+
The default LSP commands are not bound to many keys, so it is also useful to create some keybindings to help with various LSP activities. Here are some
159
+
of the known lsp commands that work with `sourcekit-lsp`:
Further information on neovim's LSP integration(including detailed information on configuration) can be found [in neovim's documentation](https://neovim.io/doc/user/lsp.html).
192
+
193
+
146
194
## Theia Cloud IDE
147
195
148
196
You can use SourceKit-LSP with Theia by using the `theiaide/theia-swift` image. To use the image you need to have [Docker](https://docs.docker.com/get-started/) installed first.
0 commit comments