Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Fix diagnostics issue when config_env is called.#439

Merged
zachallaun merged 1 commit into
lexical-lsp:mainfrom
scottming:fix-runtime-exs-diagnostics
Oct 24, 2023
Merged

Fix diagnostics issue when config_env is called.#439
zachallaun merged 1 commit into
lexical-lsp:mainfrom
scottming:fix-runtime-exs-diagnostics

Conversation

@scottming

@scottming scottming commented Oct 21, 2023

Copy link
Copy Markdown
Collaborator

The main reason why the diagnostics of runtime.exs cannot be cleared is because of a runtime error

So we need to set a value for the env key.

%RuntimeError{message: "no :env key was given to this configuration file"}], [file: ~c"lib/lexical/remote_control/build/document/compilers/config.ex", line: 79]}, {LXical.RemoteControl.Build.Document.Compilers.Config, :raw_compile, 1, [file: ~c"lib/lexical/remote_control/build/document/compilers/config.ex", line: 55]}, {Code, :with_diagnostics, 2, [file: ~c"lib/code.ex", line: 574]}, {LXical.RemoteControl.Build.Document.Compilers.Config, :compile_with_diagnostics, 1, [file: ~c"lib/lexical/remote_control/build/document/compilers/config.ex", line: 61]}, {Mix.Project, :in_project, 4, [file: ~c"lib/mix/project.ex", line: 458]}, {File, :cd!, 2, [file: ~c"lib/file.ex", line: 1624]}, {LXical.RemoteControl.Mix, :"-in_project/2-fun-0-", 3, [file: ~c"lib/lexical/remote_control/mix.ex", line: 29]}, {:global, :trans, 4, [file: ~c"global.erl", line: 477]}

https://github.com/elixir-lang/elixir/blob/v1.15.7/lib/elixir/lib/config.ex#L220

Fixes #402

The main reason why the diagnostics of `runtime.exs` cannot be cleared is because of a runtime error

So we need to set a value for the env key

@zachallaun zachallaun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual change looks innocuous enough. I had one question about the tests.

@zachallaun zachallaun merged commit 5c1a8de into lexical-lsp:main Oct 24, 2023
zachallaun pushed a commit that referenced this pull request Oct 24, 2023
The main reason why the diagnostics of `runtime.exs` cannot be cleared is because of a runtime error due to a lack of env key. Setting a value fixes the error.

Fixes #402
@scottming scottming deleted the fix-runtime-exs-diagnostics branch December 20, 2023 02:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors in runtime.exs not cleared

3 participants