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.

Autocompletion doesn't work when require file #147

@jakitliang

Description

@jakitliang

Environment

  • vscode-ruby version: 0.12.1
  • Ruby version: 2.4.0 / 2.3.3
  • VS Code version: 1.12.1
  • Operating System: macOS Sierra 10.12.2
  • Hardware (optional): MacBook Pro 2016 late / Mac Mini

Expected behavior

My project has two file:

  • #my_class.rb
  • test.rb

In my_class.rb, I wrote a simple bare bone MyClass for demo.

In test.rb, I wrote require_relative 'my_class', which can require MyClass.

And I expected that then I'll use this class.

Actual behavior

Code autocompletion behave strange, having no autocompletion but I feel something fall into error.

Steps to reproduce the problem

I open DevTool so that I can see those:

runtime_data_with_class': -:4:in require_relative': cannot infer basepath (LoadError) (Rcodetools::ProcessParticularLine::NewCodeError)
from -:4:in <main>' from /Users/***/.rvm/gems/ruby-2.4.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:287:in candidates_with_class'
from /Users//.rvm/gems/ruby-2.4.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:295:in candidates' from /Users/***/.rvm/gems/ruby-2.4.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:313:in completion_code'
from /Users/
/.rvm/gems/ruby-2.4.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:206:in run' from /Users/***/.rvm/gems/ruby-2.4.0/gems/rcodetools-0.8.5.0/bin/rct-complete:45:in <top (required)>'
from /Users//.rvm/gems/ruby-2.4.0/bin/rct-complete:23:in load' from /Users/***/.rvm/gems/ruby-2.4.0/bin/rct-complete:23:in

'
from /Users/
/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in eval' from /Users/***/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in '

qq20170505-163649

qq20170505-163714

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions