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

Closed

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!

Activity

  1. wingrunr21 commented on Mar 5, 2019

    @wingrunr21
    Collaborator

    I am not against switching to your fork in the interim. I'd like it to be published to NPM though.

    FYI I am not planning on supporting rubyLocate as a symbol provider when I implement that in the language server. I have considerably better symbol information available in the AST than what rubyLocate provides.

  2. wingrunr21 commented on Mar 5, 2019

    @wingrunr21
    Collaborator

    @peret sorry if that was unclear. If you can publish your fork to NPM we can switch the project to use it (you can submit a PR for that too!)

  3. peret commented on Mar 5, 2019

    @peret
    ContributorAuthor

    Whoops, definitely didn't mean to close this issue 😅 Looks like I just randomly hit the button.
    Sorry, nothing unclear about your answer. I think I'm going to wait a few more days to see if the PR in rubyLocate gets merged (got a reply from the maintainer now), before publishing a fork.
    Good to know that it will be replaced with the language server though!

  4. reopened this on Mar 5, 2019
  5. HookyQR commented on Mar 5, 2019

    @HookyQR
    Contributor

    ruby-method-locate 0.0.6 has been published. Thanks for your PR @peret. Sorry it took SOOOO long.

  6. wingrunr21 commented on Mar 5, 2019

    @wingrunr21
    Collaborator

    Sweet, I'll get it updated here

  7. self-assigned this
    on Mar 5, 2019
  8. HookyQR commented on Mar 5, 2019

    @HookyQR
    Contributor

    The extension will need a version bump (post npm install) to shove the new version into the package.

  9. wingrunr21 commented on Mar 5, 2019

    @wingrunr21
    Collaborator

    Yes I know

  10. HookyQR commented on Mar 5, 2019

    @HookyQR
    Contributor

    You're just too quick for me. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions