iamcco / coc-flutter

flutter support for (Neo)vim
472 stars 38 forks source link

Features of Coc-Flutter stoped working as as intended after flutter update to v2.8 #146

Closed andromedabushturkey closed 2 years ago

andromedabushturkey commented 2 years ago

Hi guys, I'll keep it real short and simple. After updating my Flutter to version 2.8(Stable Channel), I ran into issue #140. I did the same thing as dprophete and llucax in the #140 thread and get the same results. will this require an update or was this fixed in an other way?

Thank you in advance for all the help.

Cheers

Kavantix commented 2 years ago

@DanTup would you mind checking this lsp log, I don't see anything wrong with the requests coc.nvim is sending but the requested capabilities seem not to be returned by the dart lsp

Lsp output log ```json [Trace - 1:54:31 PM] Sending request 'initialize - (0)'. Params: { "processId": 81387, "rootPath": "/Users/pieter/Git/medappv2/medapp_pharmacy", "rootUri": "file:///Users/pieter/Git/medappv2/medapp_pharmacy", "capabilities": { "workspace": { "applyEdit": true, "workspaceEdit": { "documentChanges": true, "resourceOperations": [ "create", "rename", "delete" ], "failureHandling": "textOnlyTransactional" }, "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, "fileOperations": { "dynamicRegistration": true, "didCreate": true, "didRename": true, "didDelete": true, "willCreate": true, "willRename": true, "willDelete": true }, "workspaceFolders": true }, "textDocument": { "publishDiagnostics": { "relatedInformation": true, "versionSupport": false, "tagSupport": { "valueSet": [ 1, 2 ] } }, "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" ] }, "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, "contextSupport": true, "signatureInformation": { "documentationFormat": [ "markdown", "plaintext" ], "activeParameterSupport": true, "parameterInformation": { "labelOffsetSupport": true } } }, "definition": { "dynamicRegistration": 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 ] } }, "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 }, "documentLink": { "dynamicRegistration": true, "tooltipSupport": true }, "typeDefinition": { "dynamicRegistration": true }, "implementation": { "dynamicRegistration": true }, "declaration": { "dynamicRegistration": true }, "colorProvider": { "dynamicRegistration": true }, "foldingRange": { "dynamicRegistration": true, "rangeLimit": 5000, "lineFoldingOnly": true }, "selectionRange": { "dynamicRegistration": true }, "callHierarchy": { "dynamicRegistration": true }, "linkedEditingRange": { "dynamicRegistration": true } }, "window": { "showMessage": { "messageActionItem": { "additionalPropertiesSupport": false } }, "showDocument": { "support": false }, "workDoneProgress": true }, "general": { "regularExpressions": { "engine": "ECMAScript", "version": "ES2020" }, "markdown": { "parser": "marked", "version": "1.1.0" } } }, "initializationOptions": { "onlyAnalyzeProjectsWithOpenFiles": false, "suggestFromUnimportedLibraries": true, "closingLabels": true }, "trace": "verbose", "workspaceFolders": [ { "uri": "file:///Users/pieter/Git/medappv2/medapp_pharmacy", "name": "medapp_pharmacy" } ], "locale": "en_US", "clientInfo": { "name": "coc.nvim", "version": "0.0.80" } } [Trace - 1:54:32 PM] Received response 'initialize - (0)' in 435ms. Result: { "capabilities": { "executeCommandProvider": { "commands": [ "edit.sortMembers", "edit.organizeImports", "edit.fixAll", "edit.sendWorkspaceEdit", "refactor.perform" ], "workDoneProgress": true }, "semanticTokensProvider": { "legend": { "tokenTypes": [ "annotation", "keyword", "class", "comment", "method", "variable", "parameter", "enum", "enumMember", "type", "source", "property", "namespace", "boolean", "number", "string", "function", "typeParameter" ], "tokenModifiers": [ "documentation", "constructor", "declaration", "importPrefix", "static", "escape", "annotation", "control", "label", "interpolation", "void" ] }, "range": true, "full": { "delta": false } }, "workspaceSymbolProvider": true, "workspace": { "workspaceFolders": { "supported": true, "changeNotifications": true } } }, "serverInfo": { "name": "Dart SDK LSP Analysis Server", "version": "2.15.0" } } [Trace - 1:54:32 PM] Sending notification 'initialized'. Params: {} [Trace - 1:54:32 PM] Received request 'workspace/configuration - (1)'. Params: { "items": [ { "scopeUri": "file:///Users/pieter/Git/medappv2/medapp_pharmacy", "section": "dart" }, { "section": "dart" } ] } [Trace - 1:54:32 PM] Sending response 'workspace/configuration - (1)'. Processing request took 1ms Result: [ { "analysisExcludedFolders": [ "/Users/pieter/.pub-cache", "/Users/pieter/fvm/versions/stable/" ], "enableSdkFormatter": true, "lineLength": 100, "completeFunctionCalls": true, "showTodos": true }, { "analysisExcludedFolders": [ "/Users/pieter/.pub-cache", "/Users/pieter/fvm/versions/stable/" ], "enableSdkFormatter": true, "lineLength": 100, "completeFunctionCalls": true, "showTodos": true } ] ```
DanTup commented 2 years ago

@Kavantix are you able to run the server with --instrumentation-log-file=/some/path.txt to capture a full log (it some additional info to just the request/responses)? Can you also confirm the exact full command being used to spawn the LSP server?

Kavantix commented 2 years ago

@DanTup thanks for checking, I just found the problem. Dart changed the output of dart --version from stderr to stdout which we were using to enable/disable dynamic capability registration for dart above 2.6

Kavantix commented 2 years ago

@andromedabushturkey 1.9.7 should resolve the issue

DanTup commented 2 years ago

@Kavantix I'm not sure I understand - the server should behave correctly with or without dynamic capabilities. I also don't think you should need to sniff the version number for anything - I think you should be able to get everything you need from the server capabilities?

Kavantix commented 2 years ago

I agree @DanTup on both points. The first is a quirk of coc I believe. And the second is probably extremely outdated, I'll try if I can see why @iamcco added that.

Kavantix commented 2 years ago

Ah it is because of this issue Definitely outdated, might consider removing the version check at some point.

andromedabushturkey commented 2 years ago

Gents, you guys rock. Huge thank you for your amazing response time. Cheers!!

Kavantix commented 2 years ago

@andromedabushturkey you're welcome :)

DanTup commented 2 years ago

@Kavantix ah, I forgot about that. Though if you disable dynamic registration on the latest version of the server (eg. if you incorrectly assumed it was < 2.6 because of the --version change), I would still expect the server to function correctly. If that doesn't seem to be the case, please let me know and I'll take a look :-)

Kavantix commented 2 years ago

Well the problem is that it isn't disabling dynamic registrations per se, coc is just throwing away any registerCapability requests coming in (the quirk I was talking about)

The server in general was working, just not the capabilities that are dynamically registered.

DanTup commented 2 years ago

Ah, gotcha :) FWIW the client didn't send dynamicRegistration: true then the server would register everything statically (and not send any registerCapability calls). I don't know enough to know if that's a worthwhile (or even reasonable) change though.

Do let me know if anything comes up that might be related to the server though. I don't know enough to reasonable test all of the clients that are using the LSP server, but I'd very much like to ensure it's as compatible as possible :-)