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

v0.15.0 breaks syntax highlighting #344

Closed
ryanwinchester opened this issue Jun 20, 2023 · 10 comments
Closed

v0.15.0 breaks syntax highlighting #344

ryanwinchester opened this issue Jun 20, 2023 · 10 comments

Comments

@ryanwinchester
Copy link

ryanwinchester commented Jun 20, 2023

See images.

Before update
Screenshot 2023-06-20 at 9 06 11 AM

After update
Screenshot 2023-06-20 at 9 04 48 AM

@eulixir
Copy link

eulixir commented Jun 20, 2023

image
It is worth pointing out that this color induces one to think that there is something wrong in the syntax

@NobbZ
Copy link
Member

NobbZ commented Jun 20, 2023

I have massive problems with "doc-comments" not beeing closed ever…

image

Sorry for the crop, but I have to be careful with sensitive code.

In the output-panes "window" log I can see the follwing traces:

2023-06-20 16:03:15.998 [error] an exception was raised:
    ** (CaseClauseError) no case clause matching: nil
        (elixir_sense 2.0.0) lib/elixir_sense/providers/docs.ex:58: ElixirSense.Providers.Docs.mod_fun_docs/9
        (elixir_sense 2.0.0) lib/elixir_sense.ex:74: ElixirSense.docs/3
        (language_server 0.15.0) lib/language_server/providers/hover.ex:24: ElixirLS.LanguageServer.Providers.Hover.hover/4
        (language_server 0.15.0) lib/language_server/server.ex:828: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2: Error: an exception was raised:
    ** (CaseClauseError) no case clause matching: nil
        (elixir_sense 2.0.0) lib/elixir_sense/providers/docs.ex:58: ElixirSense.Providers.Docs.mod_fun_docs/9
        (elixir_sense 2.0.0) lib/elixir_sense.ex:74: ElixirSense.docs/3
        (language_server 0.15.0) lib/language_server/providers/hover.ex:24: ElixirLS.LanguageServer.Providers.Hover.hover/4
        (language_server 0.15.0) lib/language_server/server.ex:828: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2
	at handleResponse (/Users/norbert.melzer/.vscode/extensions/jakebecker.elixir-ls-0.15.0/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
	at handleMessage (/Users/norbert.melzer/.vscode/extensions/jakebecker.elixir-ls-0.15.0/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
	at processMessageQueue (/Users/norbert.melzer/.vscode/extensions/jakebecker.elixir-ls-0.15.0/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
	at Immediate.<anonymous> (/Users/norbert.melzer/.vscode/extensions/jakebecker.elixir-ls-0.15.0/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
	at process.processImmediate (node:internal/timers:466:21)

NB: Only a couple of files seem to be affected, and after the first @doc things are usually still correct, only after the second or third things get weird.

@eulixir
Copy link

eulixir commented Jun 20, 2023

I am having the same problem @NobbZ, for now I will use the latest "stable" version of extension and keep an eye on the bugfix.

@aj-foster
Copy link
Contributor

Similar to phoenixframework/vscode-phoenix#19, this looks like an interaction between the grammar and VS Code's built-in bracket pair colorization feature.

Specifically, this commit introduced ["do:", " "] to the brackets configuration, which appears to be invalid.

@lukaszsamson
Copy link
Collaborator

In the output-panes "window" log I can see the following traces

This is harmless

Specifically, this commit introduced ["do:", " "] to the brackets configuration, which appears to be invalid.

I will have to revert it. My intention was to match do: with a whitespace next to it and create a closed pair. It seems that is not working correctly.

@aj-foster
Copy link
Contributor

Regarding docstring highlighting that does not terminate, it appears to occur (for me) when a list is present in the markdown of the docstring. Removing the - or * of list items makes the markdown context end with the """ correctly.

@lukaszsamson
Copy link
Collaborator

Having brackets like this

"brackets": [
    ["{", "}"],
    ["[", "]"],
    ["(", ")"],
    ["<<", ">>"],
    ["do", ":"],
    ["do", "end"],
    ["fn", "end"]
  ]

fixes that case
Screenshot 2023-06-21 at 08 25 37
but it makes do match with first : in the block. After looking though the docs and issues on vscode repo it's not possible to use regex nor negative matches in the bracket definition.

lukaszsamson added a commit that referenced this issue Jun 21, 2023
Partially reverts 3cb1596
problems reported in #344
@Danichyo
Copy link

I have a problem with @moduledoc syntax highlighting and nested modules. If @moduledoc is in a nested module, the syntax highlighting is broken

OK:
Screenshot 2023-06-21 at 14 52 40

NOT OK:
Screenshot 2023-06-21 at 14 56 54

@maxguzenski
Copy link

inline IF (or WITH, etc) is broken as well.

Captura de Tela 2023-06-21 às 18 04 21

@lukaszsamson
Copy link
Collaborator

I had to remove markdown highlighting in heredocs. It interfered with elixir grammar and I couldn't find a workaround.
I believe all the issues are now fixed.

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

7 participants