Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Incorrect grammar scope assigned for hash keys that match "core" Ruby functions #591

Closed
arempe93 opened this issue Mar 2, 2020 · 1 comment
Assignees
Labels
bug Bug reports

Comments

@arempe93
Copy link

arempe93 commented Mar 2, 2020

Scopes for keywords/hash keys seem broken unless there is a . preceding the method call.

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.2
  • Ruby version manager (if any): rvm
  • VS Code version: 1.42.1
  • Operating System: OSX 10.15.3 Catalina
  • Using language server? (eg useLanguageServer is true in your configuration?): No

Expected behavior

Before changes in #579:

Screen Shot 2020-03-02 at 10 28 38

All keyword arguments/hash keys have scopes:

constant.language.symbol.hashkey.ruby
meta.function-call.ruby
source.ruby

First group additionally has:

punctuation.definition.constant.hashkey.ruby

Actual behavior

After upgrading to 0.27.0:

Screen Shot 2020-03-02 at 10 43 41

First group keyword arguments/hash keys have scopes:

support.function.core.ruby
meta.function-call.ruby
source.ruby

Second group have scopes:

constant.language.symbol.hashkey.ruby
source.ruby

Code Sample

find!(id: 1)
find!({ id: 1 })

Candidate.find!(id: 1)
Candidate.find!({ id: 1 })
@wingrunr21
Copy link
Collaborator

wingrunr21 commented Mar 2, 2020

This appears to be specific to methods the grammar flags as support.function.core.ruby. If you use a hash key that is not "core" (eg foobar), highlighting is correct.

@wingrunr21 wingrunr21 self-assigned this Mar 2, 2020
@wingrunr21 wingrunr21 added the bug Bug reports label Mar 2, 2020
@wingrunr21 wingrunr21 changed the title Missing highlighting scopes for hash keys/keywords in methods after 0.27.0 Incorrect grammar scope assigned for hash keys that match "core" Ruby functions Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug reports
Projects
None yet
Development

No branches or pull requests

2 participants