Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/solargraph/rbs_map/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def load_environment_to_pins(loader)
environment = RBS::Environment.from_loader(loader).resolve_type_names
cursor = pins.length
environment.declarations.each { |decl| convert_decl_to_pin(decl, Solargraph::Pin::ROOT_PIN) }
added_pins = pins[cursor..-1]
added_pins.each { |pin| pin.source = :rbs }
end

# @param decl [RBS::AST::Declarations::Base]
Expand Down
1 change: 1 addition & 0 deletions lib/solargraph/type_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def call_problems
base = base.base
end
closest = found.typify(api_map) if found
# @todo remove the internal_or_core? check at a higher-than-strict level
if !found || found.is_a?(Pin::BaseVariable) || (closest.defined? && internal_or_core?(found))
unless closest.generic? || ignored_pins.include?(found)
result.push Problem.new(location, "Unresolved call to #{missing.links.last.word}")
Expand Down
8 changes: 8 additions & 0 deletions spec/rbs_map/stdlib_map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@
expect(['Module<YAML>', 'Module<Psych>']).to include(return_type)
end
end

it 'pins are marked as coming from RBS parsing' do
map = Solargraph::RbsMap::StdlibMap.load('yaml')
store = Solargraph::ApiMap::Store.new(map.pins)
constant_pins = store.get_constants('')
pin = constant_pins.first
expect(pin.source).to eq(:rbs)
end
end