Skip to content

Commit

Permalink
fix: SelectJavaParentAction parsing an outdated file
Browse files Browse the repository at this point in the history
  • Loading branch information
tyron12233 committed Feb 11, 2022
1 parent f1a1e21 commit 07777f3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.tyron.actions.CommonDataKeys;
import com.tyron.actions.DataContext;
import com.tyron.actions.Presentation;
import com.tyron.builder.model.SourceFileObject;
import com.tyron.builder.project.Project;
import com.tyron.code.R;
import com.tyron.completion.java.action.FindCurrentPath;
Expand All @@ -23,6 +24,7 @@
import org.openjdk.source.util.Trees;

import java.io.File;
import java.time.Instant;

public class SelectJavaParentAction extends AnAction {

Expand Down Expand Up @@ -63,7 +65,10 @@ public void actionPerformed(@NonNull AnActionEvent e) {
Editor editor = e.getRequiredData(CommonDataKeys.EDITOR);
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
File file = e.getRequiredData(CommonDataKeys.FILE);
Parser parser = Parser.parseFile(project, file.toPath());

SourceFileObject fileObject = new SourceFileObject(file.toPath(),
editor.getContent().toString(), Instant.now());
Parser parser = Parser.parseJavaFileObject(project, fileObject);

FindCurrentPath findCurrentPath = new FindCurrentPath(parser.task);

Expand Down

0 comments on commit 07777f3

Please sign in to comment.