use of com.jscs.cli.data.LintResult in project jscs-plugin by idok.
the class JscsFixAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
final VirtualFile file = (VirtualFile) e.getDataContext().getData(DataConstants.VIRTUAL_FILE);
JscsProjectComponent component = project.getComponent(JscsProjectComponent.class);
// JscsConfigFileListener.start(collectedInfo.project);
// actualFile = ActualFile2.getOrCreateActualFile(JSCS_TEMP_FILE_KEY, file, collectedInfo.fileContent);
// if (actualFile == null || actualFile.getActualFile() == null) {
// return null;
// }
// File cwd = new File(project.getBasePath());
// if (actualFile instanceof ActualFile2.TempActualFile) {
// cwd = ((ActualFile2.TempActualFile) actualFile).getTempFile().file.getParentFile();
// }
// String relativeFile = actualFile.getActualFile().getName();
// File cwd = actualFile.getActualFile().getParentFile();
// String relativeFile = FileUtils.makeRelative(cwd, actualFile.getActualFile());
String rc = JscsExternalAnnotator.getRC(project, component.jscsRcFile);
LintResult result = JscsRunner.fix(project.getBasePath(), file.getPath(), component.nodeInterpreter, component.jscsExecutable, rc, component.preset, component.settings.esnext, component.settings.esprima);
file.refresh(true, false);
}
Aggregations