1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 08:32:39 +00:00

Using full path for VS.code clickyness.

This commit is contained in:
jespergravgaard 2020-11-15 14:43:22 +01:00
parent 4b543b7de5
commit 18e50a245b

View File

@ -9,7 +9,6 @@ import org.antlr.v4.runtime.misc.Interval;
import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.TerminalNode; import org.antlr.v4.runtime.tree.TerminalNode;
import java.io.File;
import java.io.Serializable; import java.io.Serializable;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
@ -237,10 +236,8 @@ public class StatementSource implements Serializable {
public String format() { public String format() {
if(getFileName() == null) if(getFileName() == null)
return ""; return "";
Path currentPath = new File(".").toPath().toAbsolutePath();
Path sourcePath = Paths.get(getFileName()); Path sourcePath = Paths.get(getFileName());
Path relativePath = currentPath.relativize(sourcePath); String relativeFileName = sourcePath.toAbsolutePath().toString();
String relativeFileName = relativePath.toString();
if(getCharPosInLine() == null || getCharPosInLine() == 0) { if(getCharPosInLine() == null || getCharPosInLine() == 0) {
// No relevant column idx - format without // No relevant column idx - format without
return String.format("%s:%s:", relativeFileName, getLineNumber()); return String.format("%s:%s:", relativeFileName, getLineNumber());