File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed 
presentation-compiler/src/main/dotty/tools/pc Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -131,13 +131,13 @@ class PcDefinitionProvider(
131131          otherDefs.headOption.orElse(exportedDefs.headOption)  match 
132132            case  Some (srcTree) => 
133133              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)
137136                  DefinitionResultImpl (
138137                    SemanticdbSymbols .symbolName(sym),
139-                     List (loc).asJava
138+                     List (loc).asJava, 
140139                  )
140+                 else  DefinitionResultImpl .empty
141141            case  None  => 
142142              DefinitionResultImpl .empty
143143        else 
Original file line number Diff line number Diff line change @@ -99,12 +99,6 @@ object InteractiveEnrichments extends CommonMtagsEnrichments:
9999    def  focusAt (point : Int ):  SourcePosition  = 
100100      pos.withSpan(pos.span.withPoint(point).focus)
101101
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- 
108102    def  encloses (other : SourcePosition ):  Boolean  = 
109103      pos.start <=  other.start &&  pos.end >=  other.end
110104
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments