Skip to content

Commit

Permalink
feat(cli): print URI instead of relative path for better IDE integration
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalHonegger committed May 7, 2023
1 parent ce8aee0 commit a59f410
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/main/kotlin/tools/samt/cli/ASTPrinter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal object ASTPrinter {
}

private fun dumpInfo(node: Node): String? = when (node) {
is FileNode -> gray(node.sourceFile.path.path)
is FileNode -> gray(node.sourceFile.path.toString())
is RequestResponseOperationNode -> if (node.isAsync) red("async") else null
is IdentifierNode -> yellow(node.name)
is ImportBundleIdentifierNode -> yellow(node.name) + if (node.isWildcard) yellow(".*") else ""
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/kotlin/tools/samt/cli/DiagnosticFormatter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal class DiagnosticFormatter(

// -----> <file path>:<location>
append(gray(" ---> "))
append(diagnosticController.workingDirectory.relativize(errorSourceFilePath))
append(errorSourceFilePath.toString())
if (message.highlights.isNotEmpty()) {
val firstHighlight = message.highlights.first()
val firstHighlightLocation = firstHighlight.location
Expand Down

0 comments on commit a59f410

Please sign in to comment.