@@ -92,11 +92,14 @@ func langserverRunGeneric(ctx context.Context, language string) error {
9292 }
9393
9494 type langServerImage struct {
95- ref string
96- args []string
95+ ref string
96+ args []string
97+ dockerOpts []string
9798 }
9899
99100 // NOTE: need for `--clientProcessId=1` see https://github.com/denoland/deno/issues/22012
101+ //
102+ // more idiocy: https://github.com/microsoft/vscode-languageserver-node/blob/d58c00bbf8837b9fd0144924db5e7b1c543d839e/server/src/node/main.ts#L78-L104
100103 knownGenericServers := map [string ]langServerImage {
101104 "bash" : {ref : "ghcr.io/r-xs-fi/bash-language-server" , args : []string {"start" , "--clientProcessId=1" }},
102105 "json" : {ref : "ghcr.io/r-xs-fi/vscode-langservers-extracted" , args : []string {"vscode-json-language-server" , "--stdio" , "--clientProcessId=1" }},
@@ -110,7 +113,9 @@ func langserverRunGeneric(ctx context.Context, language string) error {
110113 return fmt .Errorf ("generic language server not found for: %s" , language )
111114 }
112115
113- args := []string {"docker" , "run" , "--rm" , "--interactive" , "--workdir=" + wd , "--volume=" + wd + ":" + wd , server .ref }
116+ args := []string {"docker" , "run" , "--rm" , "--interactive" , "--workdir=" + wd , "--volume=" + wd + ":" + wd }
117+ args = append (args , server .dockerOpts ... )
118+ args = append (args , server .ref )
114119 args = append (args , server .args ... )
115120
116121 lspServer := exec .CommandContext (ctx , args [0 ], args [1 :]... )
0 commit comments