Hey Mads! Here’s where we set things up to launch sclang
from vscode:
Unless it’s hiding somewhere outside of what you posted, what you’re PROBABLY missing are these environment variables, which is what we are currently using to communicate between the language client and language server.
If you have the environment variables set, you should see things like this from sclang when you launch:
[LSPCONNECTION] Starting language server, inPort: 58111 outPort:58110
[LSPCONNECTION] Adding provider for method 'initialize'
***LSP READY***
[LSPCONNECTION] Message received: 4.56623792, a NetAddr(127.0.0.1, 58110), {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":76355,"clientInfo":{"name":"Visual Studio Code","version":"1.65.2"},"locale":"en-us","rootPath":null,"rootUri":null,"capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"linkedEditingRange":{"dynamicRegistration":true},"execution":{"executeSelection":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"trace":"off","workspaceFolders":null}}
[LSPCONNECTION] Found method provider: an InitializeProvider
[INITIALIZEPROVIDER] Found providers: [ textDocument/definition ], [ textDocument/signatureHelp ], [ textDocument/references ], [ textDocument/completion ], [ documentation/search ], [ textDocument/declaration ], [ initialize ], [ textDocument/didOpen, textDocument/didChange, textDocument/didClose ], [ textDocument/executeSelection ], [ textDocument/codeAction ], [ textDocument/codeLens ], [ textDocument/implementation ]
[INITIALIZEPROVIDER] Checking for client capability at textDocument.definition (clientCapabilities: Dictionary[ (window -> Dictionary[ (showMessage -> Dictionary[ (messageActionItem -> Dictionary[ (additionalPropertiesSupport -> true) ]) ]), (showDocument -> Dictionary[ (support -> true) ]), (workDoneProgress -> true) ]), (general -> Dictionary[ (regularExpressions -> Dictionary[ (engine -> ECMAScript), (version -> ES2020) ]), (markdown -> Dictionary[ (parser -> marked), (version -> 1.1.0) ]) ]), (textDocument -> Dictionary[ (codeLens -> Dictionary[ (dynamicRegistration -> true) ]), (formatting -> Diction...etc...)
[INITIALIZEPROVIDER] Registering provider: [ textDocument/definition ]
[INITIALIZEPROVIDER] Adding server capability at definitionProvider: ( )
[INITIALIZEPROVIDER] writing options into key definitionProvider
However, there are currently several non-standard things about the way the server is configured, so it might not work immediately with neovim even with that. I’m happy to fill in the gaps to get neovim up and running, but to he honest I’m completely at a loss figuring out what mechanism neovim uses to connect to language servers. Generally this is either a named pipe or a TCP socket (I’m using UDP sockets with VSCode, but only for dumb convenience reasons) - it’ll be a little work to connect either of those, but I just can’t for the life of me figure out what neovim expects, and afaict it’s completely missing from documentation. Probably it’s normal for language servers to just implement both mechanisms, but I don’t really want to make a random guess at which one is going to work without a way of testing. Any thoughts here?