Skip to content

[SemanticDB] Symbol that name doesn't present in source shouldn't be registered as SymbolOccurrence #15142

@tanishiking

Description

@tanishiking

scalameta/metals#3901

Compiler version

3.1.2

Minimized code

trait Stuff[A]:
  def `do`: A

given Stuff[String] with
  def `do`: String = "done"
end given

Output

generates the following Symbol Occurrence

Occurrences:
[0:6..0:11) <= _empty_/Stuff#
[0:12..0:13) <= _empty_/Stuff#[A]
[1:7..1:9) <= _empty_/Stuff#do().
[1:12..1:13) => _empty_/Stuff#[A]
[3:6..3:11) => _empty_/Stuff#
[3:12..3:18) => scala/Predef.String#
[4:7..4:9) <= _empty_/Main$package.given_Stuff_String.do().
[4:12..4:18) => scala/Predef.String#
[4:19..5:9) => _empty_/Main$package.given_Stuff_String.

but [4:19..5:9) => _empty_/Main$package.given_Stuff_String. doesn't present in source and it shouldn't be registered as SymbolOccurrence.

Expectation

symbol that doesn't present in source (in this case [4:19..5:9) => _empty_/Main$package.given_Stuff_String.) shouldn't be registered as SymbolOccurrence.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions