Skip to content

Commit 2bfd399

Browse files
authored
Document how to use it with NVIM and support android as platform (#127)
* added docs how to integrate into NVIM * support android
1 parent 3a1e9f2 commit 2bfd399

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,34 @@ https://github.com/polserver/vscode-escript/issues.
210210
- In the new Visual Studio Code [Extension Development Host], open a POL distro
211211
folder that contains `pol.cfg` and `scripts/ecompile.cfg`.
212212
- Check the "ECompile Language Server" channel in the Output pane.
213+
214+
## NVIM LSP integration
215+
Run `npm install && npm build` in this folder. This installs all necessary
216+
node modules in both the client and server folder (only the server is needed)
217+
218+
nvim example configuration:
219+
```
220+
vim.lsp.config.escriptlsp = {
221+
root_markers = {
222+
"pol.cfg"
223+
},
224+
filetypes = { 'escript' },
225+
cmd = {
226+
"node",
227+
"/PATH_TO_VSESCRIPT/server/out/index.js",
228+
"--stdio",
229+
"--storageUri=/SOME_PATH/escriptlsp"
230+
},
231+
init_options = {
232+
configuration = {
233+
polCommitId = "COMMIT HASH",
234+
showModuleFunctionComments = true,
235+
continueAnalysisOnError = true,
236+
disableWorkspaceReferences = true,
237+
referenceAllFunctions = true,
238+
}
239+
},
240+
}
241+
242+
vim.lsp.enable('escriptlsp')
243+
```

native/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if(APPLE)
1010
set(PLATFORM darwin)
1111
elseif(WIN32)
1212
set(PLATFORM win32)
13+
elseif(ANDROID)
14+
set(PLATFORM android)
1315
else()
1416
set(PLATFORM linux)
1517
endif()
@@ -23,7 +25,7 @@ endif()
2325

2426
if(BUILD_OSX_UNIVERSAL_BINARY)
2527
set(ARCH universal)
26-
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
28+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*|aarch64)")
2729
set(ARCH arm64)
2830
else()
2931
set(ARCH x64)

0 commit comments

Comments
 (0)