You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/main/kotlin/org/javacs/kt/CompiledFile.kt
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,6 @@ class CompiledFile(
33
33
valisScript:Boolean = false,
34
34
valkind:CompilationKind = CompilationKind.DEFAULT
35
35
) {
36
-
val path:Path by lazy { parse.containingFile.toPath() }
37
-
38
36
/**
39
37
* Find the type of the expression at `cursor`
40
38
*/
@@ -72,9 +70,11 @@ class CompiledFile(
72
70
val cursorExpr = element?.findParent<KtExpression>() ?:return nullResult("Couldn't find expression at ${describePosition(cursor)} (only found $element)")
73
71
val surroundingExpr = expandForReference(cursor, cursorExpr)
74
72
val scope = scopeAtPoint(cursor) ?:return nullResult("Couldn't find scope at ${describePosition(cursor)}")
73
+
// NOTE: Due to our tiny-fake-file mechanism, we may have `path == /dummy.virtual.kt != parse.containingFile.toPath`
74
+
val path = surroundingExpr.containingFile.toPath()
75
75
val context = bindingContextOf(surroundingExpr, scope)
0 commit comments