Skip to content

Commit fa27c61

Browse files
committed
Logging of unrecognized goto definition targets and updated VSCode build task
1 parent 7ca3d66 commit fa27c61

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.vscode/tasks.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
"isBackground": true,
1111
"presentation": {
1212
"reveal": "never"
13-
},
13+
}
14+
},
15+
{
16+
"label": "Build with Gradle",
17+
"type": "shell",
18+
"command": "gradle build -x test",
19+
"problemMatcher": [],
1420
"group": {
1521
"kind": "build",
1622
"isDefault": true

src/main/kotlin/org/javacs/kt/position/position.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import com.intellij.psi.PsiFile
66
import org.eclipse.lsp4j.Location
77
import org.eclipse.lsp4j.Position
88
import org.eclipse.lsp4j.Range
9+
import org.javacs.kt.LOG
910
import org.javacs.kt.util.toPath
11+
import org.jetbrains.kotlin.descriptors.SourceFile
1012
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
1113
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
1214
import org.jetbrains.kotlin.js.resolve.diagnostics.findPsi
@@ -97,7 +99,11 @@ fun location(declaration: DeclarationDescriptor): Location? {
9799
// TODO: Find the correct position
98100
return Location(file, Range(Position(0, 0), Position(0, 0)))
99101
}
102+
SourceFile.NO_SOURCE_FILE -> Unit // If no source file is present, do nothing
103+
else -> LOG.info("Source type of $sourceFile not recognized")
100104
}
105+
} else {
106+
LOG.info("$declaration does not have a source")
101107
}
102108

103109
return null

0 commit comments

Comments
 (0)