8000 Ignore TypeScriptNoContentAvailableException See · lgrignon/typescript.java@8fa29dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 8fa29dc

Browse files
committed
Ignore TypeScriptNoContentAvailableException See
angelozerr#190
1 parent f28264a commit 8fa29dc

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

eclipse/ts.eclipse.ide.core/src/ts/eclipse/ide/internal/core/resources/IDETypeScriptProject.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import java.util.HashMap;
1717
import java.util.List;
1818
import java.util.Map;
19+
import java.util.concurrent.ExecutionException;
1920
import java.util.concurrent.TimeUnit;
2021

2122
import org.eclipse.core.resources.IFile;
@@ -27,6 +28,7 @@
2728
import org.eclipse.jface.text.IDocument;
2829

2930
import ts.TypeScriptException;
31+
import ts.TypeScriptNoContentAvailableException;
3032
import ts.client.ITypeScriptServiceClient;
3133
import ts.client.compileonsave.CompileOnSaveAffectedFileListSingleProject;
3234
import ts.client.diagnostics.DiagnosticEventBody;
@@ -286,12 +288,10 @@ public boolean isInScope(IResource resource) {
286288
}
287289

288290
/**
289-
* Returns true if the given js, jsx file can be validated and false
290-
* otherwise.
291+
* Returns true if the given js, jsx file can be validated and false otherwise.
291292
*
292293
* @param file
293-
* @return true if the given js, jsx file can be validated and false
294-
* otherwise.
294+
* @return true if the given js, jsx file can be validated and false otherwise.
295295
* @throws CoreException
296296
*/
297297
private boolean isJsFileIsInScope(IFile file, ITsconfigBuildPath tsContainer) throws CoreException {
@@ -316,12 +316,10 @@ private boolean isJsFileIsInScope(IFile file, ITsconfigBuildPath tsContainer) th
316316
}
317317

318318
/**
319-
* Returns true if the given ts, tsx file can be validated and false
320-
* otherwise.
319+
* Returns true if the given ts, tsx file can be validated and false otherwise.
321320
*
322321
* @param file
323-
* @return true if the given ts, tsx file can be validated and false
324-
* otherwise.
322+
* @return true if the given ts, tsx file can be validated and false otherwise.
325323
* @throws CoreException
326324
*/
327325
private boolean isTsFileIsInScope(IFile file, ITsconfigBuildPath tsContainer) throws CoreException {
@@ -466,7 +464,16 @@ private boolean compileTsFiles(List<String> tsFilesToCompile, ITypeScriptService
466464
if (monitor.isCanceled()) {
467465
return true;
468466
}
469-
compileTsFile(filename, client);
467+
try {
468+
compileTsFile(filename, client);
469+
} catch (ExecutionException e) {
470+
if (e.getCause() instanceof TypeScriptNoContentAvailableException) {
471+
// Ignore "No content available" error.
472+
}
473+
else {
474+
throw e;
475+
}
476+
}
470477
}
471478
return false;
472479
}

0 commit comments

Comments
 (0)
0