File tree 2 files changed +4
-10
lines changed
presentation-compiler/src/main/dotty/tools/pc
2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -131,13 +131,13 @@ class PcDefinitionProvider(
131
131
otherDefs.headOption.orElse(exportedDefs.headOption) match
132
132
case Some (srcTree) =>
133
133
val pos = srcTree.namePos
134
- pos.toLocation match
135
- case None => DefinitionResultImpl .empty
136
- case Some (loc) =>
134
+ if pos.exists then
135
+ val loc = new Location (params.uri().toString(), pos.toLsp)
137
136
DefinitionResultImpl (
138
137
SemanticdbSymbols .symbolName(sym),
139
- List (loc).asJava
138
+ List (loc).asJava,
140
139
)
140
+ else DefinitionResultImpl .empty
141
141
case None =>
142
142
DefinitionResultImpl .empty
143
143
else
Original file line number Diff line number Diff line change @@ -99,12 +99,6 @@ object InteractiveEnrichments extends CommonMtagsEnrichments:
99
99
def focusAt (point : Int ): SourcePosition =
100
100
pos.withSpan(pos.span.withPoint(point).focus)
101
101
102
- def toLocation : Option [l.Location ] =
103
- for
104
- uri <- InteractiveDriver .toUriOption(pos.source)
105
- range <- if pos.exists then Some (pos.toLsp) else None
106
- yield new l.Location (uri.toString(), range)
107
-
108
102
def encloses (other : SourcePosition ): Boolean =
109
103
pos.start <= other.start && pos.end >= other.end
110
104
You can’t perform that action at this time.
0 commit comments