This commit is contained in:
Clément Fournier
2023-03-20 15:18:12 +01:00
parent 6eabac7d44
commit f2dc3805af
12 changed files with 28 additions and 24 deletions

View File

@@ -68,8 +68,8 @@ public class ScalaTokenizer implements Tokenizer {
// cannot catch it as it's a checked exception and Scala sneaky throws
TokenizeException tokE = (TokenizeException) e;
Position pos = tokE.pos();
throw new TokenMgrError(
pos.startLine() + 1, pos.startColumn() + 1, document.getFileId(), "Scalameta threw", tokE);
throw tokenEntries.makeLexException(
pos.startLine() + 1, pos.startColumn() + 1, "Scalameta threw", tokE);
} else {
throw e;
}

View File

@@ -22,7 +22,7 @@ public final class ScalaParser implements Parser {
@Override
public ASTSource parse(ParserTask task) throws ParseException {
Input.VirtualFile virtualFile = new Input.VirtualFile(task.getFileDisplayName(), task.getSourceText());
Input.VirtualFile virtualFile = new Input.VirtualFile(task.getFileId().toAbsolutePath(), task.getSourceText());
Dialect dialect = ScalaLanguageModule.dialectOf(task.getLanguageVersion());
Source src = new ScalametaParser(virtualFile, dialect).parseSource();
ASTSource root = (ASTSource) new ScalaTreeBuilder().build(src);