Skip to content

Commit

Permalink
Strip 'file ' prefix from all filenames in RdocToYard
Browse files Browse the repository at this point in the history
  • Loading branch information
grncdr committed Sep 1, 2022
1 parent e9f97aa commit 2e9c186
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/solargraph/yard_map/rdoc_to_yard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ def self.locate obj
end

def self.find_file obj
if obj.respond_to?(:in_files) && !obj.in_files.empty?
[obj.in_files.first.to_s.sub(/^file /, ''), obj.line]
file = if obj.respond_to?(:in_files) && !obj.in_files.empty?
obj.in_files.first
else
[obj.file, obj.line]
obj.file
end

return if file.nil?

file.to_s.sub(/^file /, '')
end
end
end
Expand Down

0 comments on commit 2e9c186

Please sign in to comment.