Duplicates unresolved constant
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 355
- Forks
- 24
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 17
Description
In the code bellow unresolved constant occurs twice in graph.constant_references with same location. The first time as SomeHttpTransport, the second time as <SomeHttpTransport>. It's confusing
equire "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "rubydex"
end
File.binwrite("file1.rb", <<~RUBY)
module Tracer
def notify
SomeHttpTransport.get("https://tracer.com/")
end
end
RUBY
module Rubydex
class Location
def to_file_path = uri
end
end
graph = Rubydex::Graph.new
graph.index_all(Dir.glob("*.rb"))
graph.constant_references do |reference|
next unless reference.is_a?(Rubydex::UnresolvedConstantReference)
puts "#{reference.name} #{reference.location}"
end
BasicObject rubydex:built-in:8:22-8:33
Module rubydex:built-in:15:21-15:27
Kernel rubydex:built-in:9:17-9:23
**<SomeHttpTransport> file:///home/dev/projects/gp/const_stricter/bin/tmp/file1.rb:3:5-3:22**
Object rubydex:built-in:12:22-12:28
**SomeHttpTransport file:///home/dev/projects/gp/const_stricter/bin/tmp/file1.rb:3:5-3:22**
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example using Rubydex::Graph#index_all and inspect how graph.constant_references yields Rubydex::UnresolvedConstantReference objects for file1.rb. Trace the two references at the same location and determine where their names diverge. Done means the duplicate unresolved constant is no longer reported twice for that location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100