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

Too many error messages on certain malformed code #855

Open
dv01sw opened this issue Feb 12, 2025 · 4 comments
Open

Too many error messages on certain malformed code #855

dv01sw opened this issue Feb 12, 2025 · 4 comments

Comments

@dv01sw
Copy link

dv01sw commented Feb 12, 2025

Heyhey 👋

Sometimes when editing a file and introducing some syntax issue, lexical will throw up to three different error popups, and on each keypress they will animate again and also cannot be silenced. Neither by the DoNotDisturb mode, nor by clicking deactivate the notifications of this extension (because even if you deactivate the notifications of a certain extension in docker it will still show those marked as Error)
For concentrating on the code they are very distracting and don't add any value. I already know that the syntax is not correct, no need to yell at me that now also autocomplete will stop working :))

Bildschirmaufzeichnung.vom.2025-02-12.15-50-22.mp4
@dv01sw dv01sw changed the title Too many error messages on certain mal formed code Too many error messages on certain malformed code Feb 12, 2025
@Blond11516
Copy link
Collaborator

Hi @dv01sw !

These errors aren't caused by your code having some error, they're caused by lexical failing entirely while handling an editor request; they're notifications from vscode itself, not from lexical. That might why you weren't able to disable them.

With that said, they're indeed very distracting but this volume of failed requests is absolutely not normal. Something must be going wrong between your lexical installation and your environment.

In your project you should find a .lexical directory with a lexical.log and project.log. If you could delete those files, restart lexical and upload those files after some errors have been triggered it should help us diagnose the issue.

Also, if you could provide some information regarding your development environment that would help a lot:

  • OS
  • Elixir and erlang versions of your project
  • How you installed lexical (did you let the vscode extension install automatically or did you build it manually?)
  • If using a manual build, what version/commit did you build, and with which versions of elixir and erlang

@dv01sw
Copy link
Author

dv01sw commented Feb 19, 2025

OS: Fedora 41
VSCode: I am using VScodium (the OSS variant). If i read the popups correctly it downloaded the lexical binary from somewhere online
Elixir: Elixir 1.17.3 (compiled with Erlang/OTP 27)

Stacktrace:

2025-02-19 15:48:16.057 [info] [Error - 3:48:16 PM] Request textDocument/codeLens failed.
2025-02-19 15:48:16.057 [info]   Message: ** (FunctionClauseError) no function clause matching in LXical.Server.Provider.Handlers.CodeLens.handle/2
    (lx_server 0.7.2) lib/lexical/server/provider/handlers/code_lens.ex:16: LXical.Server.Provider.Handlers.CodeLens.handle(%{id: 724, __struct__: LXical.Protocol.Requests.CodeLens, document: #Inspect.Error<
  got UndefinedFunctionError with message:

      """
      function Code.Identifier.inspect_as_atom/1 is undefined or private
      """

  while inspecting:

      %{
        version: 11,
        path: "......controllers/page_controller.ex",
        uri: "file:///.......controllers/page_controller.ex",
        __struct__: LXical.Document,
        lines: %Lines<"defmodule .PageController do..."(7 lines)>,
        dirty?: true,
        language_id: "elixir"
      }

  Stacktrace:

    (elixir 1.17.3) Code.Identifier.inspect_as_atom(LXical.Document)
    (lx_lexical_shared 0.5.0) lib/lexical/document.ex:25: Inspect.LXical.Document.inspect/2
    (elixir 1.17.3) lib/inspect/algebra.ex:347: Inspect.Algebra.to_doc/2
    (elixir 1.17.3) lib/inspect.ex:287: Inspect.List.keyword/2
    (elixir 1.17.3) lib/inspect/algebra.ex:478: Inspect.Algebra.container_each/6
    (elixir 1.17.3) lib/inspect/algebra.ex:455: Inspect.Algebra.container_doc/6
    (elixir 1.17.3) lib/inspect/algebra.ex:347: Inspect.Algebra.to_doc/2
    (elixir 1.17.3) lib/kernel.ex:2381: Kernel.inspect/2

@dv01sw
Copy link
Author

dv01sw commented Feb 19, 2025

Or is my Elixir just too new?

@Blond11516
Copy link
Collaborator

Or is my Elixir just too new?

1.17.3 should be fine. You can see the complete compatibility table here.

With that said I'm don't really know what's going on here. It looks like Elixir is failing to inspect a Lexical.Document struct but I don't know much about how inspecting works.

I'll transfer the issue over to the main lexical repo. The maintainers over there should be able to help better.

@Blond11516 Blond11516 transferred this issue from lexical-lsp/vscode-lexical Feb 22, 2025
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

2 participants