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

Incorrect highlighting of method parameters #663

Closed
graceful-potato opened this issue Oct 11, 2020 · 1 comment
Closed

Incorrect highlighting of method parameters #663

graceful-potato opened this issue Oct 11, 2020 · 1 comment

Comments

@graceful-potato
Copy link
Contributor

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: ruby 2.6.3p62
  • Ruby version manager (if any): rvm
  • VS Code version: 1.50.0
  • Operating System: ubuntu 20.04
  • Using language server? (eg useLanguageServer is true in your configuration?) yes

Expected behavior

parameters must be correctly highlighted.
multiline parameters must be supported.

Actual behavior

Code for test
# Testarea for methods without parameters.

def method; hello, world = [1,2] end # test comment

def method # test comment
  hello, world = [1,2]
end

# Testarea for methods with parentheses.

def method_with_parentheses(*a, **b, &c) hello, world = [1,2] end # test comment

def method_with_parentheses(a, b, c = [foo,bar,baz]) hello, world = [1,2] end # test comment

def method_with_parentheses(a, b, c = [foo,bar,baz]) # test comment
  hello, world = [1,2]
end

def method_with_parentheses(a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = {}) # test comment
  hello, world = [1,2]
  do_something1
  do_something2
end

def method_with_parentheses(a,
                            b = hello, # test comment
                            c = ["foo", bar, :baz],
                            d = (2 + 2) * 2,
                            e = {})
  hello, world = [1,2]
  do_something1
  do_something2
end

# Testarea for methods without parentheses.

def method_without_parentheses a, b, c = [foo,bar,baz]; hello, world = [1,2] end # test comment

def method_without_parentheses a, b, c = [foo,bar,baz] # test comment
  hello, world = [1,2]
end

def method_without_parentheses a, b = "hello", c = ["foo", "bar"], d = (2 + 2) * 2, e = "" # test comment
  hello, world = [1,2]
  do_something1
  do_something2
end

def method_without_parentheses a,    
                               b = "hello"  , # test comment
                               c = ["foo", bar, :baz],
                               d = (2 + 2) * 2,
                               e = proc { |e| e + e }  
  hello, world = [1,2]
  do_something1
  do_something2
end

def method_without_parentheses *a, **b, &c; hello, world = [1,2] end # test comment

def method_without_parentheses *a, **b, &c # test comment
  hello, world = [1,2]
end
Big screenshot

As you can see there are a lot of mistakes in highlighting.
And there is also leaking of scope meta.function.method.with-arguments.ruby.
Screenshot from 2020-10-11 18-46-36

@graceful-potato
Copy link
Contributor Author

graceful-potato commented Oct 30, 2020

Fixed by #664

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant