File tree 3 files changed +17
-7
lines changed
3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export class RemoteFilesFeature extends LanguageClientConsumer {
38
38
this . closeRemoteFiles ( ) ;
39
39
40
40
vscode . workspace . onDidSaveTextDocument ( ( doc ) => {
41
- if ( this . languageClient && this . isDocumentRemote ( doc ) ) {
41
+ if ( this . isDocumentRemote ( doc ) && this . languageClient ) {
42
42
this . languageClient . sendNotification (
43
43
DidSaveTextDocumentNotificationType ,
44
44
{
Original file line number Diff line number Diff line change @@ -332,11 +332,11 @@ export class SessionManager implements Middleware {
332
332
const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe'
333
333
const newSetting = 'codeFormatting.addWhitespaceAroundPipe'
334
334
const configurationTargetOfNewSetting = await Settings . getEffectiveConfigurationTarget ( newSetting ) ;
335
- if ( configuration . has ( deprecatedSetting ) && configurationTargetOfNewSetting === null ) {
336
- const configurationTarget = await Settings . getEffectiveConfigurationTarget ( deprecatedSetting ) ;
337
- const value = configuration . get ( deprecatedSetting , configurationTarget )
338
- await Settings . change ( newSetting , value , configurationTarget ) ;
339
- await Settings . change ( deprecatedSetting , undefined , configurationTarget ) ;
335
+ const configurationTargetOfOldSetting = await Settings . getEffectiveConfigurationTarget ( deprecatedSetting ) ;
336
+ if ( configurationTargetOfOldSetting !== null && configurationTargetOfNewSetting === null ) {
337
+ const value = configuration . get ( deprecatedSetting , configurationTargetOfOldSetting )
338
+ await Settings . change ( newSetting , value , configurationTargetOfOldSetting ) ;
339
+ await Settings . change ( deprecatedSetting , undefined , configurationTargetOfOldSetting ) ;
340
340
}
341
341
}
342
342
Original file line number Diff line number Diff line change 3
3
*--------------------------------------------------------*/
4
4
5
5
import * as assert from "assert" ;
6
- import { IPowerShellExeDetails } from "../src/platform " ;
6
+ import * as vscode from "vscode " ;
7
7
import Settings = require( "../src/settings" ) ;
8
8
9
9
suite ( "Settings module" , ( ) => {
@@ -34,4 +34,14 @@ suite("Settings module", () => {
34
34
await Settings . change ( "powerShellAdditionalExePaths" , psExeDetails , true ) ;
35
35
assert . strictEqual ( Settings . load ( ) . powerShellAdditionalExePaths [ 0 ] . versionName , psExeDetails [ 0 ] . versionName ) ;
36
36
} ) ;
37
+
38
+ test ( "Can get effective configuration target" , async ( ) => {
39
+ await Settings . change ( "helpCompletion" , "LineComment" , false ) ;
40
+ let target = await Settings . getEffectiveConfigurationTarget ( "helpCompletion" ) ;
41
+ assert . strictEqual ( target , vscode . ConfigurationTarget . Workspace ) ;
42
+
43
+ await Settings . change ( "helpCompletion" , undefined , false ) ;
44
+ target = await Settings . getEffectiveConfigurationTarget ( "helpCompletion" ) ;
45
+ assert . strictEqual ( target , null ) ;
46
+ } ) ;
37
47
} ) ;
You can’t perform that action at this time.
0 commit comments