Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when handling workspace/didChangeWatchedFiles when project_dir not yet set #920

Closed
lukaszsamson opened this issue Jun 24, 2023 · 0 comments

Comments

@lukaszsamson
Copy link
Collaborator

GenServer ElixirLS.LanguageServer.Server terminating
** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
    (elixir 1.15.0) lib/io.ex:671: IO.chardata_to_string(nil)
    (elixir 1.15.0) lib/path.ex:595: Path.split/1
    (elixir 1.15.0) lib/path.ex:328: Path.relative_to/2
    (language_server 0.15.0) lib/language_server/server.ex:432: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_notification/2
    (elixir 1.15.0) lib/enum.ex:4190: Enum.predicate_list/3
    (language_server 0.15.0) lib/language_server/server.ex:429: ElixirLS.LanguageServer.Server.handle_notification/2
    (language_server 0.15.0) lib/language_server/server.ex:204: ElixirLS.LanguageServer.Server.handle_cast/2
    (stdlib 4.3.1.1) gen_server.erl:1123: :gen_server.try_dispatch/4
Last message: {:"$gen_cast", {:receive_packet, %{"jsonrpc" => "2.0", "method" => "workspace/didChangeWatchedFiles", "params" => %{"changes" => [%{"type" => 2, "uri" => "file:///Users/andrew/Projects/os/firezone/elixir/apps/web/test/web/controllers/auth_controller_test.exs"}]}}}}
State: %ElixirLS.LanguageServer.Server{server_instance_id: "L6IUvJsFo4JFBGhwj-OzM1oqApSTq3RI", build_ref: nil, dialyzer_sup: nil, client_capabilities: %{"general" => %{"markdown" => %{"parser" => "marked", "version" => "1.1.0"}, "positionEncodings" => ["utf-16"], "regularExpressions" => %{"engine" => "ECMAScript", "version" => "ES2020"}, "staleRequestSupport" => %{"cancel" => true, "retryOnContentModified" => ["textDocument/semanticTokens/full", "textDocument/semanticTokens/range", "textDocument/semanticTokens/full/delta"]}}, "notebookDocument" => %{"synchronization" => %{"dynamicRegistration" => true, "executionSummarySupport" => true}}, "textDocument" => %{"callHierarchy" => %{"dynamicRegistration" => true}, "codeAction" => %{"codeActionLiteralSupport" => %{"codeActionKind" => %{"valueSet" => ["", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports"]}}, "dataSupport" => true, "disabledSupport" => true, "dynamicRegistration" => true, "honorsChangeAnnotations" => false, "isPreferredSupport" => true, "resolveSupport" => %{"properties" => ["edit"]}}, "codeLens" => %{"dynamicRegistration" => true}, "colorProvider" => %{"dynamicRegistration" => true}, "completion" => %{"completionItem" => %{"commitCharactersSupport" => true, "deprecatedSupport" => true, "documentationFormat" => ["markdown", "plaintext"], "insertReplaceSupport" => true, "insertTextModeSupport" => %{"valueSet" => [1, 2]}, "labelDetailsSupport" => true, "preselectSupport" => true, "resolveSupport" => %{"properties" => ["documentation", "detail", "additionalTextEdits"]}, "snippetSupport" => true, "tagSupport" => %{"valueSet" => [1]}}, "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"]}, "contextSupport" => true, "dynamicRegistration" => true, "insertTextMode" => 2}, "declaration" => %{"dynamicRegistration" => true, "linkSupport" => true}, "definition" => %{"dynamicRegistration" => true, "linkSupport" => true}, "diagnostic" => %{"dynamicRegistration" => true, "relatedDocumentSupport" => false}, "documentHighlight" => %{"dynamicRegistration" => true}, "documentLink" => %{"dynamicRegistration" => true, "tooltipSupport" => true}, "documentSymbol" => %{"dynamicRegistration" => true, "hierarchicalDocumentSymbolSupport" => true, "labelSupport" => 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]}}, "foldingRange" => %{"dynamicRegistration" => true, "foldingRange" => %{"collapsedText" => false}, "foldingRangeKind" => %{"valueSet" => ["comment", "imports", "region"]}, "lineFoldingOnly" => true, "rangeLimit" => 5000}, "formatting" => %{"dynamicRegistration" => true}, "hover" => %{"contentFormat" => ["markdown", "plaintext"], "dynamicRegistration" => true}, "implementation" => %{"dynamicRegistration" => true, "linkSupport" => true}, "inlayHint" => %{"dynamicRegistration" => true, "resolveSupport" => %{"properties" => ["tooltip", "textEdits", "label.tooltip", "label.location", "label.command"]}}, "inlineValue" => %{"dynamicRegistration" => true}, "linkedEditingRange" => %{"dynamicRegistration" => true}, "onTypeFormatting" => %{"dynamicRegistration" => true}, "publishDiagnostics" => %{"codeDescriptionSupport" => true, "dataSupport" => true, "relatedInformation" => true, "tagSupport" => %{"valueSet" => [1, 2]}, "versionSupport" => false}, "rangeFormatting" => %{"dynamicRegistration" => true}, "references" => %{"dynamicRegistration" => true}, "rename" => %{"dynamicRegistration" => true, "honorsChangeAnnotations" => true, "prepareSupport" => true, "prepareSupportDefaultBehavior" => 1}, "selectionRange" => %{"dynamicRegistration" => true}, "semanticTokens" => %{"augmentsSyntaxTokens" => true, "dynamicRegistration" => true, "formats" => ["relative"], "multilineTokenSupport" => false, "overlappingTokenSupport" => false, "requests" => %{"full" => %{"delta" => true}, "range" => true}, "serverCancelSupport" => true, "tokenModifiers" => ["declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary"], "tokenTypes" => ["namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", ...]}, "signatureHelp" => %{"contextSupport" => true, "dynamicRegistration" => true, "signatureInformation" => %{"activeParameterSupport" => true, "documentationFormat" => ["markdown", "plaintext"], "parameterInformation" => %{"labelOffsetSupport" => true}}}, "synchronization" => %{"didSave" => true, "dynamicRegistration" => true, "willSave" => true, "willSaveWaitUntil" => true}, "typeDefinition" => %{"dynamicRegistration" => true, "linkSupport" => true}, "typeHierarchy" => %{"dynamicRegistration" => true}}, "window" => %{"showDocument" => %{"support" => true}, "showMessage" => %{"messageActionItem" => %{"additionalPropertiesSupport" => true}}, "workDoneProgress" => true}, "workspace" => %{"applyEdit" => true, "codeLens" => %{"refreshSupport" => true}, "configuration" => true, "diagnostics" => %{"refreshSupport" => true}, "didChangeConfiguration" => %{"dynamicRegistration" => true}, "didChangeWatchedFiles" => %{"dynamicRegistration" => true, "relativePatternSupport" => true}, "executeCommand" => %{"dynamicRegistration" => true}, "fileOperations" => %{"didCreate" => true, "didDelete" => true, "didRename" => true, "dynamicRegistration" => true, "willCreate" => true, "willDelete" => true, "willRename" => true}, "inlayHint" => %{"refreshSupport" => true}, "inlineValue" => %{"refreshSupport" => true}, "semanticTokens" => %{"refreshSupport" => true}, "symbol" => %{"dynamicRegistration" => true, "resolveSupport" => %{"properties" => ["location.range"]}, "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, ...]}, "tagSupport" => %{"valueSet" => [1]}}, "workspaceEdit" => %{"changeAnnotationSupport" => %{"groupsOnLabel" => true}, "documentChanges" => true, "failureHandling" => "textOnlyTransactional", "normalizesLineEndings" => true, "resourceOperations" => ["create", "rename", "delete"]}}}, root_uri: "file:///Users/andrew/Projects/os/firezone", project_dir: nil, settings: nil, build_diagnostics: [], dialyzer_diagnostics: [], needs_build?: false, build_running?: false, analysis_ready?: false, received_shutdown?: false, requests: %{}, source_files: %{"file:///Users/andrew/Projects/os/firezone/elixir/apps/domain/lib/domain/auth.ex" => %ElixirLS.LanguageServer.SourceFile{text: "defmodule Domain.Auth do\n  use Supervisor\n  alias Domain.{Repo, Config, Validator}\n  alias Domain.{Accounts, Actors}\n  alias Domain.Auth.{Authorizer, Subject, Context, Permission, Roles, Role, Identity}\n  alias Domain.Auth.{Adapters, Provider}\n\n  @default_se (truncated)

Reported in elixir-lsp/vscode-elixir-ls#345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant