aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-02-12 11:23:10 +0900
committerGitHub <noreply@github.com>2020-02-12 11:23:10 +0900
commitf70575f1bcb14d8e8c68b3723a7f1827bba01cdf (patch)
tree1a620889b6132f81446e61a88c81e5d3580c7d52
parent88e07ea55e44854892efea535d580e166a215fd4 (diff)
parent495e43f70c4ccd0ef72f262f8149d54175fa7a77 (diff)
downloadvim-lsp-settings-f70575f1bcb14d8e8c68b3723a7f1827bba01cdf.tar.gz
vim-lsp-settings-f70575f1bcb14d8e8c68b3723a7f1827bba01cdf.tar.bz2
vim-lsp-settings-f70575f1bcb14d8e8c68b3723a7f1827bba01cdf.zip
Merge pull request #157 from mattn/julia
Add julia-language-server
-rwxr-xr-xinstaller/install-julia-language-server.sh27
-rw-r--r--settings.json14
-rw-r--r--settings/julia-language-server.vim13
3 files changed, 54 insertions, 0 deletions
diff --git a/installer/install-julia-language-server.sh b/installer/install-julia-language-server.sh
new file mode 100755
index 0000000..1e15cba
--- /dev/null
+++ b/installer/install-julia-language-server.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -e
+
+julia -e 'using Pkg; Pkg.add(PackageSpec(name="LanguageServer", rev="master"))'
+julia -e 'using Pkg; Pkg.add(PackageSpec(name="SymbolServer", rev="master"))'
+julia -e 'using Pkg; Pkg.add(PackageSpec(name="CSTParser", rev="master"))'
+
+cat <<EOF >languageserver.jl
+import LanguageServer
+import Pkg
+import SymbolServer
+
+envpath = dirname(Pkg.Types.Context().env.project_file)
+server = LanguageServer.LanguageServerInstance(stdin, stdout, false, envpath)
+server.runlinter = true
+run(server)
+EOF
+
+cat <<EOF >julia-language-server
+#!/usr/bin/env bash
+
+DIR=\$(cd \$(dirname \$0); pwd)
+julia \$DIR/languageserver.jl \$*
+EOF
+
+chmod +x julia-language-server
diff --git a/settings.json b/settings.json
index 2dc8a9c..c62470e 100644
--- a/settings.json
+++ b/settings.json
@@ -275,6 +275,20 @@
}
}
],
+ "julia": [
+ {
+ "command": "julia-language-server",
+ "requires": [
+ "julia"
+ ],
+ "vim-plugin": {
+ "extensions": [
+ "jl"
+ ],
+ "name": "ajpaulson/julia-syntax.vim"
+ }
+ }
+ ],
"kotlin": [
{
"command": "kotlin-language-server",
diff --git a/settings/julia-language-server.vim b/settings/julia-language-server.vim
new file mode 100644
index 0000000..ce07288
--- /dev/null
+++ b/settings/julia-language-server.vim
@@ -0,0 +1,13 @@
+augroup vimlsp_settings_julia_language_server
+ au!
+ LspRegisterServer {
+ \ 'name': 'julia-language-server',
+ \ 'cmd': {server_info->lsp_settings#get('julia-language-server', 'cmd', [lsp_settings#exec_path('julia-language-server')])},
+ \ 'root_uri':{server_info->lsp_settings#get('julia-language-server', 'root_uri', lsp_settings#root_uri(g:lsp_settings_root_markers))},
+ \ 'initialization_options': lsp_settings#get('julia-language-server', 'initialization_options', v:null),
+ \ 'whitelist': lsp_settings#get('julia-language-server', 'whitelist', ['julia']),
+ \ 'blacklist': lsp_settings#get('julia-language-server', 'blacklist', []),
+ \ 'config': lsp_settings#get('julia-language-server', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('julia-language-server', 'workspace_config', {}),
+ \ }
+augroup END