Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
200 stars 48 forks source link

Issues with neovim v0.8.0 on Fedora 36 #272

Closed lavocatt closed 1 year ago

lavocatt commented 1 year ago

Hello,

I'm trying out serve-d on neovim. While I can get v0.7.4 running, I get errors with the latest beta (the server crashes at startup with not much messages in the logs):


2022-11-14T19:56:44.571 DEBUG (pid:106628) [core-documents] - buffer created 1 true file:///home/tlavocat/perso/D/interpreter/source/app.d
2022-11-14T19:56:44.664 DEBUG (pid:106628) [core-editors] - editor created winid & bufnr & tabnr:  1000 1 1
2022-11-14T19:56:44.665 DEBUG (pid:106628) [services] - starting service: languageserver.d
2022-11-14T19:56:44.665 INFO (pid:106628) [services] - LanguageClient d state change: stopped => starting
2022-11-14T19:56:44.665 DEBUG (pid:106628) [extensions-manager] - activating extension coc-marketplace
2022-11-14T19:56:44.666 INFO (pid:106628) [plugin] - coc.nvim initialized with node: v16.14.0 after 96ms
2022-11-14T19:56:44.666 INFO (pid:106628) [language-client-index] - Language server "languageserver.d" started with 106642
2022-11-14T19:56:44.679 INFO (pid:106628) [services] - LanguageClient d state change: starting => running
2022-11-14T19:56:44.686 DEBUG (pid:106628) [sources] - created service source languageserver.d
2022-11-14T19:56:44.687 INFO (pid:106628) [services] - service languageserver.d started
2022-11-14T19:56:44.731 INFO (pid:106628) [services] - LanguageClient d state change: running => stopped
2022-11-14T19:56:46.622 INFO (pid:106628) [attach] - receive notification: openLog []

Any idea on what could happen ?

WebFreak001 commented 1 year ago

which LSP client are you using with neovim?

lavocatt commented 1 year ago

I'm using COC. I've had a try on debian also but with the same results.

lavocatt commented 1 year ago

I've tried two methods to setup serve-d. With COC only and with the extension coc-dlang. Both of which gave me the same result. I've built the serve-d latest using dmd and not ldc2 as the later option is not succeeding at compiling some of the dependencies on Fedora36. (ldc is working fine on debian sid though). Thanks for helping!

WebFreak001 commented 1 year ago

do you know if it's possible to print what is being sent from coc-dlang?

Otherwise if that's not possible, you can enable it in serve-d by uncommenting version = TracePackets; at the top of the file in lsp/source/served/lsp/jsonrpc.d to let serve-d log it.

Then enable logging at runtime by passing in --loglevel trace to the serve-d executable.

By default it will log to stderr, but you can change that to a file as well by passing --logfile /path/to/output.txt, which might be needed if you can't access serve-d's stderr.

A full log on a hello world project would help identify the issue more quickly.

lavocatt commented 1 year ago

I'll check with the author of coc-dlang (@Vushu) if there's a way to log from his plugin.

vushu commented 1 year ago

@WebFreak001 I uncommented version = TracePackets and ran it with --loglevel trace

Im not using the plugin coc-dlang but just using CocConfig with:

{
    "languageserver": {
        "d": {
            "command": "/path/to/serve-d",
            "args": ["--loglevel trace"],
            "filetypes": ["d"],
            "trace.server": "on",
            "rootPatterns": ["dub.json", "dub.sdl"],
            "initializationOptions": {
            },
            "settings": {
            }
        }
    },
    "suggest.autoTrigger": "none",
    "suggest.noselect": false
}

What it spits out:

## versions

vim version: NVIM v0.8.1
node version: v19.1.0
coc.nvim version: 0.0.82-7817ea67 2022-11-13 01:53:04 +0800
coc.nvim directory: /home/davu/.local/share/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux

## Log of coc.nvim

2022-11-15T14:52:31.331 INFO (pid:252214) [plugin] - coc.nvim initialized with node: v19.1.0 after 62ms
2022-11-15T14:52:31.768 INFO (pid:252214) [attach] - receive notification: highlight [] true
2022-11-15T14:52:32.291 INFO (pid:252214) [attach] - receive notification: highlight [] true
2022-11-15T14:52:32.568 INFO (pid:252214) [services] - LanguageClient d state change: stopped => starting
2022-11-15T14:52:32.610 INFO (pid:252214) [language-client-index] - Language server "languageserver.d" started with 252244
2022-11-15T14:52:32.615 ERROR (pid:252214) [language-client] - Sending request failed.
2022-11-15T14:52:32.616 INFO (pid:252214) [services] - LanguageClient d state change: starting => stopped
2022-11-15T14:52:32.616 INFO (pid:252214) [services] - LanguageClient d state change: stopped => starting
2022-11-15T14:52:32.616 ERROR (pid:252214) [language-client-client] - Server languageserver.d initialization failed. kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
2022-11-15T14:52:32.616 INFO (pid:252214) [services] - LanguageClient d state change: starting => stopped
2022-11-15T14:52:32.616 ERROR (pid:252214) [server] - unhandledRejection  Promise {
  <rejected> kh [Error]: Pending response rejected since connection got disposed
      at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
      at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
      at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
      at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
      at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
      at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
      at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
      at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
      at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
      at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
    code: -32097,
    data: undefined
  }
} kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
2022-11-15T14:52:32.616 INFO (pid:252214) [language-client-index] - Language server "languageserver.d" started with 252246
2022-11-15T14:52:32.617 INFO (pid:252214) [services] - LanguageClient d state change: stopped => starting
2022-11-15T14:52:32.617 ERROR (pid:252214) [language-client-client] - Server languageserver.d initialization failed. kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
2022-11-15T14:52:32.617 INFO (pid:252214) [services] - LanguageClient d state change: starting => stopped
2022-11-15T14:52:32.617 ERROR (pid:252214) [services] - Server languageserver.d failed to start: kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
2022-11-15T14:52:32.617 INFO (pid:252214) [language-client-index] - Language server "languageserver.d" started with 252247
2022-11-15T14:52:32.619 INFO (pid:252214) [services] - LanguageClient d state change: stopped => starting
2022-11-15T14:52:32.624 ERROR (pid:252214) [language-client-client] - Server languageserver.d initialization failed. kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
2022-11-15T14:52:32.624 INFO (pid:252214) [services] - LanguageClient d state change: starting => stopped
2022-11-15T14:52:32.624 INFO (pid:252214) [language-client-index] - Language server "languageserver.d" started with 252248
2022-11-15T14:52:32.628 ERROR (pid:252214) [language-client-client] - Server languageserver.d initialization failed. kh [Error]: Pending response rejected since connection got disposed
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:35:4559)
    at Object.dispose (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:236:113473)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10969)
    at _d.handleConnectionClosed (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:245:3681)
    at t (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:241:10621)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230)
    at Fe (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:9:6503)
    at LT.invoke (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:14460)
    at Uu.fire (/home/davu/.local/share/nvim/plugged/coc.nvim/build/index.js:8:15230) {
  code: -32097,
  data: undefined
}
lavocatt commented 1 year ago

I've got some logs extracted to by specifying a log file. I'm using the extension coc-dlang here:

Its better as an attachment, the file is quite big: served_log.txt

vushu commented 1 year ago

Ah yeah I also have a log file.

served_log.txt

WebFreak001 commented 1 year ago

hmm so formatting it without all the extra logs looks like this:

RECV << 0: initialize: {"processId":141048,"rootPath":"/home/tlavocat/perso/D/interpreter","rootUri":"file:///home/tlavocat/perso/D/interpreter","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"undo","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":false}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"semanticTokens":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"inlineValue":{"refreshSupport":true},"diagnostics":{"refreshSupport":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]},"resolveSupport":{"properties":["location.range"]}},"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":true,"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,"insertReplaceSupport":true,"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"labelDetailsSupport":true,"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]},"insertTextMode":2,"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"contextSupport":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true,"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":true},"definition":{"dynamicRegistration":true,"linkSupport":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,"honorsChangeAnnotations":false,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"honorsChangeAnnotations":true,"prepareSupportDefaultBehavior":1},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]},"foldingRange":{"collapsedText":false}},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"linkedEditingRange":{"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","decorator","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false,"serverCancelSupport":true,"augmentsSyntaxTokens":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"inlineValue":{"dynamicRegistration":true},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":true},"typeHierarchy":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"4.0.10"},"positionEncodings":["utf-16"],"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/inlayHint","textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]}}},"initializationOptions":{},"trace":"verbose","workspaceFolders":[{"uri":"file:///home/tlavocat/perso/D/interpreter","name":"interpreter"}],"locale":"en_US","clientInfo":{"name":"coc.nvim","version":"0.0.82"}}
SENT >> {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"resolveProvider":false,"triggerCharacters":[".","=","/","*","+","-"],"completionItem":{"labelDetailsSupport":true}},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(","[",","]},"definitionProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{"resolveProvider":true},"colorProvider":{},"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"workspaceSymbolProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"serverInfo":{"name":"serve-d","version":"v0.8.0-beta.7"}}}
RECV << void: initialized: {}
SENT >> {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"d"},{"section":"dfmt"},{"section":"dscanner"},{"section":"editor"},{"section":"git"}]}}
RECV << void: workspace/didChangeConfiguration: {"settings":{}}
RECV << void: textDocument/didOpen: {"textDocument":{"uri":"file:///home/tlavocat/perso/D/interpreter/source/app.d","languageId":"d","version":1,"text":"import std.stdio: writeln;\n\nvoid main() @safe\n{\n    writeln(\"Edit source/app.d to start your project.\");\n    auto truc = 12.3;\n    float* truc_instancié = new float;\n    *truc_instancié = truc;\n}\n"}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.091] [configLoad] 0 / 1: file:///home/tlavocat/perso/D/interpreter"}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.091] [globalStartup]: Initializing serve-d..."}}
SENT >> {"jsonrpc":"2.0","method":"client/registerCapability","registrations":[{"id":"profilegc.watchfiles","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/profilegc.log"}]}]}
SENT >> {"jsonrpc":"2.0","method":"coded/changedSelectedWorkspace","params":{"uri":"file:///home/tlavocat/perso/D/interpreter","name":"interpreter","initialized":false,"selected":true}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.102] [workspaceStartup] 0 / 1: file:///home/tlavocat/perso/D/interpreter"}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.102] [completionStartup] 0 / 1: file:///home/tlavocat/perso/D/interpreter"}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.102] [configFinish] 1 / 1: "}}
RECV << 1: shutdown: 
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.112] [configLoad] 0 / 2: "}}
SENT >> {"jsonrpc":"2.0","id":2,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/tlavocat/perso/D/interpreter","section":"d"},{"scopeUri":"file:///home/tlavocat/perso/D/interpreter","section":"dfmt"},{"scopeUri":"file:///home/tlavocat/perso/D/interpreter","section":"dscanner"},{"scopeUri":"file:///home/tlavocat/perso/D/interpreter","section":"editor"},{"scopeUri":"file:///home/tlavocat/perso/D/interpreter","section":"git"}]}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.122] [configLoad] 1 / 2: file:///home/tlavocat/perso/D/interpreter"}}
SENT >> {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"[progress] [00000.122] [configFinish] 1 / 1: "}}
SENT >> {"jsonrpc":"2.0","id":1,"result":null}

it looks like for some reason coc.nvim just shuts down serve-d here. In the coc logs vushu has sent I can see it thinks initialization has failed, although I'm not sure why it logs that, as it sent me the "initialized" notification to serve-d (which means initialization finished from the client)

Need to investigate what's going on here with coc.nvim - might also wanna delay my workspace/configuration request a little because didChangeConfiguration is immediately sent

lavocatt commented 1 year ago

I'm trying a bisect to see from when the issue came from.

WebFreak001 commented 1 year ago

can you first try the latest nightly that is currently being built? It should be uploaded in 2 minutes

It re-adds a feature that was replaced with different behavior before (timeout after startup with config) which might be related here.

https://github.com/Pure-D/serve-d/releases/tag/nightly

lavocatt commented 1 year ago

Not much luck with the latest commit on main.

lavocatt commented 1 year ago

I built directly the binary using dub build

WebFreak001 commented 1 year ago

ok that's fine

can you further try out enabling this debug statement? https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

That should enable more logging on the nvim.coc side, possibly telling me what exactly the issue is that leads it to shutdown the LSP server.

lavocatt commented 1 year ago

That's better logs indeed!

I'm getting these:


    [Error - 4:31:51 PM] /home/tlavocat/.config/coc/extensions/coc-dlang-data/serve-d exited with code: 1
std.getopt.GetOptException@/usr/include/dmd/phobos/std/getopt.d(789): Unrecognized option --loglevel trace
----------------
/usr/include/dmd/phobos/std/getopt.d:789 @safe void std.getopt.getoptImpl!().getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]]) [0x17d0f5a]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], bool*) [0x17d0c7b]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cfe90]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cf8e6]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17ceaa2]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cd9c5]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cd39b]
/usr/include/dmd/phobos/std/getopt.d:758 @safe void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, ref std.getopt.GetoptResult, ref std.getopt.GetOptException, void[][immutable(char)[]], void[][immutable(char)[]], immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cb525]
/usr/include/dmd/phobos/std/getopt.d:430 @safe std.getopt.GetoptResult std.getopt.getopt!(immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*).getopt(ref immutable(char)[][], immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[], bool*, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], void delegate(immutable(char)[], immutable(char)[]) @safe, immutable(char)[], immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[], bool*) [0x17cae13]
source/app.d:99 _Dmain [0x17a74be]
[Error - 4:31:51 PM] Connection to server got closed. Server will not be restarted.
[Error - 4:31:51 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:31:51 PM] d client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:31:51 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:31:51 PM] /home/tlavocat/.config/coc/extensions/coc-dlang-data/serve-d exited with code: 1
lavocatt commented 1 year ago

Sorry for the last message :sweat_smile: I had not read the exception.. I'm starting again

lavocatt commented 1 year ago

I get not more info than:

[Error - 4:50:31 PM] /home/tlavocat/.config/coc/extensions/coc-dlang-data/serve-d exited with code: 1

lavocatt commented 1 year ago

Here's my conf for COC without using coc-dlang:

{
    "languageserver": {
        "d": {
            "command": "/home/tlavocat/.config/coc/extensions/coc-dlang-data/serve-d",
            "args": ["--loglevel", "trace", "--logfile", "/tmp/served_log"],
            "filetypes": [
                "d"
            ],
            "trace.server": "verbose",
            "rootPatterns": [
                "dub.json",
                "dub.sdl"
            ],
            "initializationOptions": {},
            "settings": {}
        }
    }
}
vushu commented 1 year ago

@WebFreak001 I have tested and it works from commit https://github.com/Pure-D/serve-d/commit/4fb7a5546acd6e7b99eb85a1ae6354ce72851409 afterwards it stopped working for coc.nvim I used this build command:

dub build --compiler=dmd --build=release
ryuukk commented 1 year ago

I just submited a PR to fix a startup crash with SublimeText, maybe that also helps with neovim? i don't know how to use neovim, can someone give it a try please? https://github.com/Pure-D/serve-d/pull/279

vushu commented 1 year ago

@ryuukk I just tested with your PR the problem sadly still persists.

ryuukk commented 1 year ago

Ok, i'll try to setup neovim and debug the issue

vushu commented 1 year ago

Thats kind of you, thanks :)

vushu commented 1 year ago

@WebFreak001

running dub test :lsp

 === Test EOLPostUni ===
795 byte -> offset 744
795 byte -> position Position(29, 24)
744 offset -> byte 795
744 offset -> position Position(29, 24)
Position(29, 24) position -> offset 744
Position(29, 24) position -> byte 795

max offset -> byte
max offset -> position
max byte -> offset
max byte -> position
max position -> offset
max position -> byte
{"code":-32600,"message":"unknown request response ID"}
{"code":-32600,"message":"unknown request response ID"}
{"code":-32700,"message":"Parse error: malformed request JSON, must be object"}
{"code":-32600,"message":"Empty batch request"}
{"code":-32600,"message":"missing required members or has ambiguous members"}
{"code":-32600,"message":"missing required members or has ambiguous members"}
{"code":-32600,"message":"missing required members or has ambiguous members"}
{"code":-32600,"message":"missing required members or has ambiguous members"}

Current masters tests has some problem or is this intended?, I am suspecting that this might be causing problems for coc.

WebFreak001 commented 1 year ago

that output is intended, it's the tests for checking for error codes and error messages on invalid inputs. I'm not quite sure why it's output to stderr though, because it should just all be in asserts :)

Fixed messages: f1804344bd647d10ea2a4648a1ffe591732cf1db

monkoose commented 1 year ago

Have some similar issue on Arch Linux. But for me serve-d 0.8 works fine on all other vim/neovim lsp clients (nvim built-in lsp, vim-lsp or ale), except for coc.

Created issue on coc issue tracker. Lets see what the devs would answer.

monkoose commented 1 year ago

Updated logs on trying to open source/app.d of the new dub project from vim with coc.nvim client on 5938adc6b870e3d0b92f6df6d3966964e93e17e0 commit build.

2023-01-18T02:47:10.618 [trace] app.d:162:main Features fulfilled
2023-01-18T02:47:10.618 [trace] serverbase.d:453:run Started reading from stdin
2023-01-18T02:47:10.618 [trace] serverbase.d:457:run RPC started
2023-01-18T02:47:10.639 [trace] serverbase.d:114:processRequest Initializing
2023-01-18T02:47:10.639 [trace] extension.d:235:initialize initialize params:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize  processId: 140165
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize  rootPath?: /home/monkoose/dcoc
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize  rootUri: file:///home/monkoose/dcoc
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize  initializationOptions?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize      storage__: Storage__
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize      identifier__: 6
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize  capabilities:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize      workspace?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          applyEdit?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          workspaceEdit?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              documentChanges?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              resourceOperations?: [create, rename, delete_]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              failureHandling?: undo
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              normalizesLineEndings?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              changeAnnotationSupport?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  groupsOnLabel?: false
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          didChangeConfiguration?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          didChangeWatchedFiles?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          symbol?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          executeCommand?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          workspaceFolders?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          configuration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          semanticTokens?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              refreshSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          codeLens?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              refreshSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          fileOperations?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              didCreate?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              willCreate?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              didRename?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              willRename?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              didDelete?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              willDelete?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize      textDocument?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          synchronization?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              willSave?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              willSaveWaitUntil?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              didSave?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          completion?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              completionItem?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  snippetSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  commitCharactersSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  documentationFormat?: [markdown, plaintext]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  deprecatedSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  preselectSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  tagSupport?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                      valueSet: [deprecated_]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  insertReplaceSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  resolveSupport?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                      properties: ["documentation", "detail", "additionalTextEdits"]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  insertTextModeSupport?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                      valueSet: [asIs, adjustIndentation]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  labelDetailsSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              completionItemKind?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  valueSet?: [text, method, function_, constructor, field, variable, class_, interface_, module_, property, unit, value, enum_, keyword, snippet, color, file, reference, folder, enumMember, constant, struct_, event, operator, typeParameter]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              contextSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          hover?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              contentFormat?: [markdown, plaintext]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize          signatureHelp?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              signatureInformation?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  documentationFormat?: [markdown, plaintext]
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  parameterInformation?:
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                      labelOffsetSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize                  activeParameterSupport?: true
2023-01-18T02:47:10.639 [trace] extension.d:236:initialize              contextSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          declaration?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              linkSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          definition?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              linkSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          typeDefinition?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              linkSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          implementation?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              linkSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          references?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          documentHighlight?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          documentSymbol?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              symbolKind?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  valueSet?: [file, module_, namespace, package_, class_, method, property, field, constructor, enum_, interface_, function_, variable, constant, string, number, boolean, array, object, key, null_, enumMember, struct_, event, operator, typeParameter]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              hierarchicalDocumentSymbolSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              tagSupport?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  valueSet: [deprecated_]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              labelSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          codeAction?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              codeActionLiteralSupport?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  codeActionKind:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                      valueSet: [empty, quickfix, refactor, refactorExtract, refactorInline, refactorRewrite, source, sourceOrganizeImports]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              isPreferredSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              disabledSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dataSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              resolveSupport?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  properties: ["edit"]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              honorsChangeAnnotations?: false
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          codeLens?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          documentLink?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              tooltipSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          colorProvider?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          formatting?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          rangeFormatting?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          onTypeFormatting?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          rename?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              prepareSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              prepareSupportDefaultBehavior?: identifier
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              honorsChangeAnnotations?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          publishDiagnostics?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              relatedInformation?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              tagSupport?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  valueSet: [unnecessary, deprecated_]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              versionSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              codeDescriptionSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dataSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          foldingRange?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              rangeLimit?: 5000
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              lineFoldingOnly?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          selectionRange?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          linkedEditingRange?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          callHierarchy?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          semanticTokens?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              dynamicRegistration?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              requests:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  range?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  full?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                      delta?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              tokenTypes: ["namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "decorator", "operator"]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              tokenModifiers: ["declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary"]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              formats: [relative]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              overlappingTokenSupport?: false
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              multilineTokenSupport?: false
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          moniker?: <null>
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      window?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          workDoneProgress?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          showMessage?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              messageActionItem?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize                  additionalPropertiesSupport?: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          showDocument?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              support: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      general?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          regularExpressions?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              engine: ECMAScript
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              version_?: ES2020
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize          markdown?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              parser: marked
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize              version_?: 4.0.10
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      experimental?: <null>
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize  trace?: verbose
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize  workspaceFolders:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      isSet: true
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      embed: [WorkspaceFolder("file:///home/monkoose/dcoc", "dcoc")]
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize  clientInfo?:
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      name: coc.nvim
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize      version_?: 0.0.82
2023-01-18T02:47:10.640 [trace] extension.d:236:initialize  locale?: en_US
2023-01-18T02:47:10.640 [trace] serverbase.d:120:processRequest Initialized
2023-01-18T02:47:10.661 [trace] serverbase.d:360:__lambda3 Calling notification method setupConfig_Initialized
2023-01-18T02:47:10.661 [trace] async.d:85:setTimeout Setting timeout for 250 ms
2023-01-18T02:47:10.671 [trace] serverbase.d:360:__lambda3 Calling notification method didChangeConfiguration
2023-01-18T02:47:10.671 [trace] extension.d:63:changedConfig Config for file:///home/monkoose/dcoc changed: Configuration(D(auto, "dcd-client", "dcd-server", "dub", "dmd", true, true, true, true, true, true, true, false, true, true, false, [], "", "", "", "", true, false, false, true, [], [], "ask", 6, "project", false, true), DFmt(true, "allman", true, true, false, true, true, "conditional_newline_indent", false, false, false, true, true), DScanner([]), Editor([], 0), Git("git"))
2023-01-18T02:47:10.671 [trace] extension.d:354:doGlobalStartup Initializing serve-d for global access
2023-01-18T02:47:10.671 [trace] extension.d:367:doGlobalStartup Setup global configuration as ["dmd":const(Section)(["path":dmd]), "dcd":const(Section)(["serverPath":dcd-server, "port":9166, "clientPath":dcd-client])]
2023-01-18T02:47:10.671 [trace] extension.d:371:doGlobalStartup Registering dub
2023-01-18T02:47:10.671 [trace] extension.d:373:doGlobalStartup Registering fsworkspace
2023-01-18T02:47:10.671 [trace] extension.d:375:doGlobalStartup Registering dcd
2023-01-18T02:47:10.683 [trace] dcd.d:68:reloadBinaries Detected dcd-server v0.15.2
2023-01-18T02:47:10.683 [trace] dcd.d:73:reloadBinaries Using dcd-client instead of internal workspace-d client
2023-01-18T02:47:10.693 [trace] dcd.d:77:reloadBinaries Detected dcd-client v0.15.2
2023-01-18T02:47:10.693 [trace] extension.d:377:doGlobalStartup Registering dcdext
2023-01-18T02:47:10.693 [trace] extension.d:379:doGlobalStartup Registering dmd
2023-01-18T02:47:10.693 [trace] extension.d:381:doGlobalStartup Starting dscanner
2023-01-18T02:47:10.693 [trace] extension.d:383:doGlobalStartup Starting dfmt
2023-01-18T02:47:10.693 [trace] extension.d:385:doGlobalStartup Starting dlangui
2023-01-18T02:47:10.693 [trace] extension.d:387:doGlobalStartup Starting importer
2023-01-18T02:47:10.693 [trace] extension.d:389:doGlobalStartup Starting moduleman
2023-01-18T02:47:10.693 [trace] extension.d:391:doGlobalStartup Starting snippets
2023-01-18T02:47:10.695 [trace] extension.d:393:doGlobalStartup Starting index
2023-01-18T02:47:10.695 [trace] extension.d:395:doGlobalStartup Starting references
2023-01-18T02:47:10.695 [trace] extension.d:522:doStartup Initializing serve-d for file:///home/monkoose/dcoc
2023-01-18T02:47:10.695 [info] extension.d:508:rootsForProject Root Suggestions: [RootSuggestion("/home/monkoose/dcoc", true)]
2023-01-18T02:47:10.695 [info] extension.d:540:doStartup registering instance for root RootSuggestion("/home/monkoose/dcoc", true)
2023-01-18T02:47:10.695 [trace] types.d:418:activeInstance Setting active instance to /home/monkoose/dcoc.
2023-01-18T02:47:10.695 [trace] profilegc.d:80:update File Exception processing profilegc: /home/monkoose/dcoc/profilegc.log: No such file or directory
2023-01-18T02:47:10.695 [trace] extension.d:576:doStartup Starting auto completion service...
2023-01-18T02:47:10.695 [trace] extension.d:587:doStartup Started all completion servers in 19 μs and 8 hnsecs
2023-01-18T02:47:10.695 [trace] extension.d:199:changedConfig Finished config change of file:///home/monkoose/dcoc with 0 changes in 23 ms, 954 μs, and 1 hnsec.
2023-01-18T02:47:10.706 [trace] serverbase.d:360:__lambda3 Calling notification method onDidOpenDocument
2023-01-18T02:47:10.706 [trace] async.d:85:setTimeout Setting timeout for 200 ms
2023-01-18T02:47:10.706 [trace] async.d:85:setTimeout Setting timeout for 50 ms
2023-01-18T02:47:10.706 [trace] serverbase.d:360:__lambda3 Calling notification method markRecentFileOpened
2023-01-18T02:47:10.716 [trace] serverbase.d:227:__lambda22 Calling request method shutdown
2023-01-18T02:47:10.716 [trace] async.d:85:setTimeout Setting timeout for 1 sec
WebFreak001 commented 1 year ago

output looks fine to me, other side is closing connection for some reason. Would need logs from the LSP client if it contains any interesting information.

vushu commented 1 year ago

There is a bug in serve-d when making message for registering capability, other lsp clients besides coc probably just ignores the invalid message. I have made PR which fixes the problem :) https://github.com/Pure-D/serve-d/pull/299

monkoose commented 1 year ago

Can confirm that it works. As i commented in the PR, closing missing curly bracket is enough for me to make it works too.