@@ -25,24 +25,15 @@ case class CompletionPos(
25
25
sourceUri : URI
26
26
):
27
27
def queryEnd : Int = originalCursorPosition.point
28
- def point : Int = originalCursorPosition.point
29
28
def stripSuffixEditRange : l.Range = new l.Range (originalCursorPosition.offsetToPos(queryStart), originalCursorPosition.offsetToPos(identEnd))
30
29
def toEditRange : l.Range = originalCursorPosition.withStart(queryStart).withEnd(originalCursorPosition.point).toLsp
31
- def toSourcePosition : SourcePosition = originalCursorPosition.withSpan(Span (queryStart, queryEnd, point ))
30
+ def toSourcePosition : SourcePosition = originalCursorPosition.withSpan(Span (queryStart, queryEnd, queryEnd ))
32
31
33
32
object CompletionPos :
34
33
35
- def infer (
36
- sourcePosition : SourcePosition ,
37
- offsetParams : OffsetParams ,
38
- adjustedPath : List [Tree ]
39
- )(using Context ): CompletionPos =
40
- infer(sourcePosition, offsetParams.uri().nn, String (sourcePosition.source.content()), adjustedPath)
41
-
42
34
def infer (
43
35
sourcePos : SourcePosition ,
44
- uri : URI ,
45
- text : String ,
36
+ offsetParams : OffsetParams ,
46
37
adjustedPath : List [Tree ]
47
38
)(using Context ): CompletionPos =
48
39
val identEnd = adjustedPath match
@@ -53,8 +44,7 @@ object CompletionPos:
53
44
val query = Completion .completionPrefix(adjustedPath, sourcePos)
54
45
val start = sourcePos.end - query.length()
55
46
56
- CompletionPos (start, identEnd, query.nn, sourcePos, uri)
57
- end infer
47
+ CompletionPos (start, identEnd, query.nn, sourcePos, offsetParams.uri.nn)
58
48
59
49
/**
60
50
* Infer the indentation by counting the number of spaces in the given line.
0 commit comments