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

Fix regexp patterns for block parameters #3212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taichi-ishitani
Copy link

@taichi-ishitani taichi-ishitani commented Feb 19, 2025

Motivation

close #3184
close #3211

VS Code plugin does not highlight the cases below.

  • Rest keyword block parameter
  • Block parameter separator | with two or more spaces before it

Implementation

For first issue, I changed the pattern to check variable type.

Before:

"match": "\\G([&*]?)([a-zA-Z_][\\w_]*)",

After:

https://github.com/taichi-ishitani/ruby-lsp/blob/d325628031b55e434525804356ccd7324131d0cf/vscode/grammars/ruby.cson.json#L2263

For second issue, I added the + quantification to the whitespace pattern within the beginning pattern of the block parameters.

Automated Tests

Manual Tests

I ran the extension and confirmed that such blocks are highlighted correctly.
image

@taichi-ishitani taichi-ishitani requested a review from a team as a code owner February 19, 2025 03:17
Copy link

graphite-app bot commented Feb 19, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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 this pull request may close these issues.

Block parameter separator | is higlighed as OR operator Keyword block parameter is not highlighed
1 participant