File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,19 @@ class DocumentLinter {
69
69
assertEqual ( this . _state , DocumentLinterState . NO_PARSER ) ;
70
70
this . _state = DocumentLinterState . CREATING_PARSER ;
71
71
this . _parserPromise = ( async ( ) => {
72
- let factory = await this . _documentProcessManager . _processFactoryPromise ;
73
- // TODO(strager): Reuse processes across documents.
74
- let process = await factory . createProcessAsync ( ) ;
75
- let parser = await process . createDocumentForVSCodeAsync ( ) ;
72
+ let parser ;
73
+ try {
74
+ let factory = await this . _documentProcessManager . _processFactoryPromise ;
75
+ // TODO(strager): Reuse processes across documents.
76
+ let process = await factory . createProcessAsync ( ) ;
77
+ parser = await process . createDocumentForVSCodeAsync ( ) ;
78
+ } catch ( e ) {
79
+ if ( e instanceof ProcessCrashed ) {
80
+ throw new LintingCrashed ( e ) ;
81
+ } else {
82
+ throw e ;
83
+ }
84
+ }
76
85
77
86
if ( this . _state === DocumentLinterState . DISPOSED ) {
78
87
parser . dispose ( ) ;
@@ -101,7 +110,7 @@ class DocumentLinter {
101
110
} catch ( e ) {
102
111
if ( e instanceof DocumentLinterDisposed ) {
103
112
// Ignore.
104
- } else if ( e instanceof ProcessCrashed ) {
113
+ } else if ( e instanceof LintingCrashed ) {
105
114
// Ignore.
106
115
} else {
107
116
throw e ;
Original file line number Diff line number Diff line change @@ -207,15 +207,11 @@ describe("DocumentLinter", () => {
207
207
! crashedProcesses . has ( process ) ,
208
208
"Should not use previously-crashed process"
209
209
) ;
210
- // TODO(strager): Figure out why qljs_vscode_create_document failures
211
- // cause this test to fail.
212
- if ( functionName !== "qljs_vscode_create_document" ) {
213
- let shouldCrash = rng . nextCoinFlip ( ) ;
214
- coinFlips . push ( shouldCrash ) ;
215
- if ( shouldCrash ) {
216
- crashedProcesses . add ( process ) ;
217
- throw new ProcessCrashed ( "(injected fault)" ) ;
218
- }
210
+ let shouldCrash = rng . nextCoinFlip ( ) ;
211
+ coinFlips . push ( shouldCrash ) ;
212
+ if ( shouldCrash ) {
213
+ crashedProcesses . add ( process ) ;
214
+ throw new ProcessCrashed ( "(injected fault)" ) ;
219
215
}
220
216
} ;
221
217
You can’t perform that action at this time.
0 commit comments