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

Having two while-loops in a file breaks symbol location #444

@peret

Description

@peret

Your environment

  • vscode-ruby version: 0.20.0
  • Ruby version: 2.4.1
  • Ruby version manager (if any): rvm
  • VS Code version: 1.31.0
  • Operating System: Ubuntu
  • Using language server? No

Expected behavior

vscode-ruby can locate all method names in a file.

Actual behavior

Under some conditions, when using rubyLocate for locating symbols, not all symbols are listed. E.g. in this file:

class Example
  def first_method
    while true
      a = 1
      break
    end

    while false
      "do nothing"
    end
  end

  def second_method
  end
end

the extension will not find second_method for symbol lookup. If you remove one of the while-loops, it'll work. I tracked this down to a bug in the parsing of while(-modifiers) in ruby-method-locate and also provided a fix: HookyQR/ruby-method-locate#1
Unfortunately, it looks like that repository might not be maintained anymore? It looks like @HookyQR used to be a contributor to this repo as well, but wasn't active in a while?

I'm creating this issue here because it's really annoying behavior in vscode-ruby and I want to move this along.
For example, would you be willing to use my fork of ruby-method-locate, if we can't get the PR in the original repo merged?

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions