ASTGen: use compilation unit from preprocessed sketch

This commit is contained in:
Jakub Valtar
2016-04-14 20:07:04 +02:00
parent 1f78c75db0
commit 1a255f8025
2 changed files with 5 additions and 6 deletions

View File

@@ -115,8 +115,6 @@ public class ASTGenerator {
protected final JavaEditor editor;
public DefaultMutableTreeNode codeTree = new DefaultMutableTreeNode();
protected CompilationUnit compilationUnit;
protected final GUI gui;
@@ -1049,6 +1047,8 @@ public class ASTGenerator {
// Find closest ASTNode to the linenumber
// log("getASTNodeAt: Node line number " + pdeLineNumber);
CompilationUnit compilationUnit =
errorCheckerService.latestResult.compilationUnit;
ASTNode lineNode = findLineOfNode(compilationUnit, pdeLineNumber, offset,
name);
@@ -2882,8 +2882,7 @@ public class ASTGenerator {
}
protected void updateAST(CompilationUnit cu, DefaultMutableTreeNode tree) {
compilationUnit = cu;
protected void updateAST(DefaultMutableTreeNode tree) {
codeTree = tree;
if (SHOW_DEBUG_TREE) {

View File

@@ -174,7 +174,7 @@ public class ErrorCheckerService {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
astGenerator.updateAST(latestResult.compilationUnit, tree);
astGenerator.updateAST(tree);
}
});
}
@@ -219,7 +219,7 @@ public class ErrorCheckerService {
@Override
public void run() {
synchronized (astGenerator) {
astGenerator.updateAST(latestResult.compilationUnit, tree);
astGenerator.updateAST(tree);
}
updateErrorTable(result.problems);
editor.updateErrorBar(result.problems);