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

Syntax highlighting issue after result without <> in params #35

Open
tanishiking opened this issue Feb 21, 2025 · 0 comments · May be fixed by #36
Open

Syntax highlighting issue after result without <> in params #35

tanishiking opened this issue Feb 21, 2025 · 0 comments · May be fixed by #36

Comments

@tanishiking
Copy link

tanishiking commented Feb 21, 2025

The highlighting works fine for result<...>, but once the result keyword appears (result without any type parameters) in parameters, the syntax highlighting stop working correctly

interface i {
  roundtrip-result: func(a: result) -> result;
  // syntax highlighting doesn't work from )
  some-func: func();
}
Image
tanishiking added a commit to tanishiking/vscode-wit that referenced this issue Feb 21, 2025
fix bytecodealliance#35

This commit separates the syntax highlighting rules for `result` types with angle brackets (`result<...>`) and `result` types without type parameters.

Previously, both types were handled in a single rule, `meta.result.ty.wit`, which ended at a newline (technically "after"), comma, or closing bracket.
However, if a `result` type appeared as a parameter, the scope wouldn't end until one of these conditions was met.
(As observed, the scope didn’t end even when a newline was encountered, likely because it was captured by other rules, though...).

This change simplifies the `meta.result.ty.wit` scope by splitting the handling of `result<...>` and `result`.
Now, `result<...>` is handled similarly to `list<...>` and `tuple<...>`, while `result` without `<...>` is handled by `result-base`, which marks the `result` keyword as `entity.name.type.result.wit`.

As a consequence of this change, line comments on `result<xxx> // comment` will no longer be ignored. However, this is a known issue for other types as well.
tanishiking added a commit to tanishiking/vscode-wit that referenced this issue Feb 21, 2025
fix bytecodealliance#35

This commit separates the syntax highlighting rules for `result` types with angle brackets (`result<...>`) and `result` types without type parameters.

Previously, both types were handled in a single rule, `meta.result.ty.wit`, which ended at a newline (technically "after"), comma, or closing bracket.
However, if a `result` type appeared as a parameter, the scope wouldn't end until one of these conditions was met.
(As observed, the scope didn’t end even when a newline was encountered, likely because it was captured by other rules, though...).

This change simplifies the `meta.result.ty.wit` scope by splitting the handling of `result<...>` and `result`.
Now, `result<...>` is handled similarly to `list<...>` and `tuple<...>`, while `result` without `<...>` is handled by `result-base`, which marks the `result` keyword as `entity.name.type.result.wit`.

As a consequence of this change, line comments on `result<xxx> // comment` will no longer be ignored. However, this is a known issue for other types as well.
tanishiking added a commit to tanishiking/vscode-wit that referenced this issue Feb 21, 2025
fix bytecodealliance#35

This commit separates the syntax highlighting rules for `result` types with angle brackets (`result<...>`) and `result` types without type parameters.

Previously, both types were handled in a single rule, `meta.result.ty.wit`, which ended at a newline (technically "after"), comma, or closing bracket.
However, if a `result` type appeared as a parameter, the scope wouldn't end until one of these conditions was met.
(As observed, the scope didn’t end even when a newline was encountered, likely because it was captured by other rules, though...).

This change simplifies the `meta.result.ty.wit` scope by splitting the handling of `result<...>` and `result`.
Now, `result<...>` is handled similarly to `list<...>` and `tuple<...>`, while `result` without `<...>` is handled by `result-base`, which marks the `result` keyword as `entity.name.type.result.wit`.

As a consequence of this change, line comments on `result<xxx> // comment` will no longer be ignored. However, this is a known issue for other types as well.
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

Successfully merging a pull request may close this issue.

1 participant