Closed ELLIOTTCABLE closed 4 months ago
cc @voodoos
That's definitively a Merlin issue. We already fixed issues with that feature (my guess is that it's the let* (), () = Lwt.both sleeper leaker in
expression that breaks merlin), @ELLIOTTCABLE could confirm that you are running the latest merlin-lib / ocaml-lsp versions ?
@ELLIOTTCABLE
I just made a small project with your file, OCaml 4.14, ocaml-lsp-server 1.17.0 and merlin-lib 4.13-414 and I am not able to reproduce the crash with vscode.
I'm getting an lsp-server crash; it's not clear what initiates it, but it happens almost immediately after invoking
ocaml.server.restart
:The only invocation of
List.combine
seems to be here:https://github.com/ocaml/merlin/blob/v4.11-414/src/ocaml/merlin_specific/browse_raw.ml#L382-L393
File contents
```ocaml open Printf open Lwt.Syntax let show_option o = Option.value ~default:"Full "OCaml Language Server" output pane contents
```text [Trace - 7:39:15 PM] Sending request 'shutdown - (5)'. [Trace - 7:39:15 PM] Received response 'shutdown - (5)' in 0ms. No result returned. [Trace - 7:39:15 PM] Sending notification 'exit'. No parameters provided. halting dune merlin process { pid = pid 2836610; initial_cwd = "/home/me/code/ocaml-ambient-context" } closed merlin process { pid = pid 2836610; initial_cwd = "/home/me/code/ocaml-ambient-context" } [Trace - 7:39:15 PM] Sending request 'initialize - (0)'. Params: { "processId": 2799344, "clientInfo": { "name": "Visual Studio Code", "version": "1.85.2" }, "locale": "en", "rootPath": "/home/me/code/ocaml-ambient-context", "rootUri": "file:///home/me/code/ocaml-ambient-context", "capabilities": { "workspace": { "applyEdit": true, "workspaceEdit": { "documentChanges": true, "resourceOperations": [ "create", "rename", "delete" ], "failureHandling": "textOnlyTransactional", "normalizesLineEndings": true, "changeAnnotationSupport": { "groupsOnLabel": true } }, "configuration": true, "didChangeWatchedFiles": { "dynamicRegistration": true, "relativePatternSupport": 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" ] } }, "codeLens": { "refreshSupport": true }, "executeCommand": { "dynamicRegistration": true }, "didChangeConfiguration": { "dynamicRegistration": true }, "workspaceFolders": true, "foldingRange": { "refreshSupport": true }, "semanticTokens": { "refreshSupport": true }, "fileOperations": { "dynamicRegistration": true, "didCreate": true, "didRename": true, "didDelete": true, "willCreate": true, "willRename": true, "willDelete": true }, "inlineValue": { "refreshSupport": true }, "inlayHint": { "refreshSupport": true }, "diagnostics": { "refreshSupport": 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 ] }, "labelDetailsSupport": true }, "insertTextMode": 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 ] }, "completionList": { "itemDefaults": [ "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" ] } }, "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": true }, "codeLens": { "dynamicRegistration": true }, "formatting": { "dynamicRegistration": true }, "rangeFormatting": { "dynamicRegistration": true, "rangesSupport": 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, "foldingRangeKind": { "valueSet": [ "comment", "imports", "region" ] }, "foldingRange": { "collapsedText": false } }, "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", "decorator" ], "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 }, "linkedEditingRange": { "dynamicRegistration": true }, "typeHierarchy": { "dynamicRegistration": true }, "inlineValue": { "dynamicRegistration": true }, "inlayHint": { "dynamicRegistration": true, "resolveSupport": { "properties": [ "tooltip", "textEdits", "label.tooltip", "label.location", "label.command" ] } }, "diagnostic": { "dynamicRegistration": true, "relatedDocumentSupport": false } }, "window": { "showMessage": { "messageActionItem": { "additionalPropertiesSupport": true } }, "showDocument": { "support": true }, "workDoneProgress": true }, "general": { "staleRequestSupport": { "cancel": true, "retryOnContentModified": [ "textDocument/semanticTokens/full", "textDocument/semanticTokens/range", "textDocument/semanticTokens/full/delta" ] }, "regularExpressions": { "engine": "ECMAScript", "version": "ES2020" }, "markdown": { "parser": "marked", "version": "1.1.0" }, "positionEncodings": [ "utf-16" ] }, "notebookDocument": { "synchronization": { "dynamicRegistration": true, "executionSummarySupport": true } }, "experimental": { "jumpToNextHole": true } }, "trace": "verbose", "workspaceFolders": [ { "uri": "file:///home/me/code/ocaml-ambient-context", "name": "ocaml-ambient-context" } ] } [Trace - 7:39:15 PM] Received notification 'window/logMessage'. Params: { "message": "failed to poll dune registry.\nUnix.Unix_error(Unix.ENOENT, \"stat\", \"/run/user/2040/dune/rpc\")\nMaybe you are not running dune in watch mode?\nHint: $ dune build -w", "type": 2 } [Warn - 7:39:15 PM] failed to poll dune registry. Unix.Unix_error(Unix.ENOENT, "stat", "/run/user/2040/dune/rpc") Maybe you are not running dune in watch mode? Hint: $ dune build -w [Trace - 7:39:15 PM] Received response 'initialize - (0)' in 19ms. Result: { "capabilities": { "codeActionProvider": { "codeActionKinds": [ "quickfix", "refactor.inline", "construct", "destruct", "inferred_intf", "put module name in identifiers", "remove module name from identifiers", "remove type annotation", "type-annotate" ] }, "codeLensProvider": { "resolveProvider": false }, "completionProvider": { "resolveProvider": true, "triggerCharacters": [ ".", "#" ] }, "declarationProvider": true, "definitionProvider": true, "documentFormattingProvider": true, "documentHighlightProvider": true, "documentSymbolProvider": true, "executeCommandProvider": { "commands": [ "ocamllsp/view-metrics", "ocamllsp/open-related-source", "ocamllsp/show-document-text", "ocamllsp/show-merlin-config", "dune/promote" ] }, "experimental": { "ocamllsp": { "interfaceSpecificLangId": true, "handleSwitchImplIntf": true, "handleInferIntf": true, "handleTypedHoles": true, "handleWrappingAstNode": true, "diagnostic_promotions": true, "handleHoverExtended": true } }, "foldingRangeProvider": true, "hoverProvider": true, "positionEncoding": "utf-16", "referencesProvider": true, "renameProvider": { "prepareProvider": true }, "selectionRangeProvider": true, "semanticTokensProvider": { "full": { "delta": true }, "legend": { "tokenModifiers": [ "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" ], "tokenTypes": [ "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" ] } }, "signatureHelpProvider": { "triggerCharacters": [ " ", "~", "?", ":", "(" ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { "includeText": false }, "willSave": false, "willSaveWaitUntil": false }, "typeDefinitionProvider": true, "workspace": { "workspaceFolders": { "changeNotifications": true, "supported": true } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "ocamllsp", "version": "1.17.0" } } [Trace - 7:39:15 PM] Sending notification 'initialized'. Params: {} [Trace - 7:39:15 PM] Received request 'client/registerCapability - (1)'. Params: { "registrations": [ { "id": "ocamllsp-cram-dune-files/textDocument/didOpen", "method": "textDocument/didOpen", "registerOptions": { "documentSelector": [ { "language": "cram", "scheme": null, "pattern": null }, { "language": "dune", "scheme": null, "pattern": null }, { "language": "dune-project", "scheme": null, "pattern": null }, { "language": "dune-workspace", "scheme": null, "pattern": null } ] } }, { "id": "ocamllsp-cram-dune-files/textDocument/didClose", "method": "textDocument/didClose", "registerOptions": { "documentSelector": [ { "language": "cram", "scheme": null, "pattern": null }, { "language": "dune", "scheme": null, "pattern": null }, { "language": "dune-project", "scheme": null, "pattern": null }, { "language": "dune-workspace", "scheme": null, "pattern": null } ] } } ] } [Trace - 7:39:15 PM] Sending response 'client/registerCapability - (1)'. Processing request took 0ms No result returned. [Trace - 7:39:15 PM] Sending notification 'textDocument/didOpen'. Params: { "textDocument": { "uri": "file:///home/me/code/ocaml-ambient-context/test/memory/test_lwt_leak.ml", "languageId": "ocaml", "version": 1, "text": "open Printf\nopen Lwt.Syntax\n\nlet show_option o = Option.value ~default:\"Platform & versions
- macOS “Sonoma” **14.2.1** - VScode **1.85.2** - VScode OCaml Platform: **1.17.0** - OCaml: **4.14.1** - `ocaml-lsp-server`: **1.17.0**