File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change
1
+ Fix bug affecting multiple linters used in a workspace.
2
+ (thanks [ Ilia Novoselov] ( https://github.com/nullie ) )
Original file line number Diff line number Diff line change @@ -168,17 +168,20 @@ export class ProcessService implements IProcessService {
168
168
}
169
169
170
170
private getDefaultOptions < T extends ( ShellOptions | SpawnOptions ) > ( options : T ) : T {
171
- const execOptions = options as SpawnOptions ;
172
- const defaultOptions = JSON . parse ( JSON . stringify ( options ) ) ;
171
+ const defaultOptions = { ... options } ;
172
+ const execOptions = defaultOptions as SpawnOptions ;
173
173
if ( execOptions )
174
174
{
175
175
const encoding = execOptions . encoding = typeof execOptions . encoding === 'string' && execOptions . encoding . length > 0 ? execOptions . encoding : DEFAULT_ENCODING ;
176
176
delete execOptions . encoding ;
177
- defaultOptions . encoding = encoding ;
177
+ execOptions . encoding = encoding ;
178
+ execOptions . token = execOptions . token ;
178
179
}
179
- if ( ! defaultOptions . env || Object . keys ( defaultOptions ) . length === 0 ) {
180
+ if ( ! defaultOptions . env || Object . keys ( defaultOptions . env ) . length === 0 ) {
180
181
const env = this . env ? this . env : process . env ;
181
182
defaultOptions . env = { ...env } ;
183
+ } else {
184
+ defaultOptions . env = { ...defaultOptions . env } ;
182
185
}
183
186
184
187
// Always ensure we have unbuffered output.
Original file line number Diff line number Diff line change @@ -271,17 +271,6 @@ suite('Linting - General Tests', () => {
271
271
} ) ;
272
272
// tslint:disable-next-line:no-function-expression
273
273
test ( 'Multiple linters' , async function ( ) {
274
- // Unreliable test being skipped until we can sort it out. See gh-2609.
275
- // - Fails about 1/3 of runs on Windows
276
- // - Symptom: lintingEngine::lintOpenPythonFiles returns values *after* command await resolves in lint.tests
277
- // - lintOpenPythonFiles returns 3 sets of values, not what I expect (1).
278
- // - Haven't yet found a way to await on this properly.
279
- const skipped = true ;
280
- if ( skipped ) {
281
- // tslint:disable-next-line:no-invalid-this
282
- return this . skip ( ) ;
283
- }
284
-
285
274
await closeActiveWindows ( ) ;
286
275
const document = await workspace . openTextDocument ( path . join ( pythoFilesPath , 'print.py' ) ) ;
287
276
await window . showTextDocument ( document ) ;
You can’t perform that action at this time.
0 commit comments