@@ -17,7 +17,7 @@ import { languages, IndentAction, workspace, window, commands, ExtensionContext,
1717import * as path from 'path' ;
1818import * as os from 'os' ;
1919import { activateTagClosing } from './tagClosing' ;
20-
20+ var oldSettings = { } ;
2121namespace TagCloseRequest {
2222 export const type : RequestType < TextDocumentPositionParams , string , any , any > = new RequestType ( 'xml/closeTag' ) ;
2323}
@@ -45,15 +45,16 @@ export function activate(context: ExtensionContext) {
4545 revealOutputChannelOn : RevealOutputChannelOn . Never ,
4646 initializationOptions : { settings : getSettings ( ) } ,
4747 synchronize : {
48- configurationSection : [ 'xml' ]
48+ configurationSection : [ 'xml' , '[xml]' ]
4949 } ,
5050 middleware : {
5151 workspace : {
5252 didChangeConfiguration : ( ) => languageClient . sendNotification ( DidChangeConfigurationNotification . type , { settings : getSettings ( ) } )
53+
5354 }
5455 }
5556 }
56-
57+
5758 let serverOptions = prepareExecutable ( requirements ) ;
5859 let languageClient = new LanguageClient ( 'xml' , 'XML Support' , serverOptions , clientOptions ) ;
5960 let toDispose = context . subscriptions ;
@@ -75,6 +76,17 @@ export function activate(context: ExtensionContext) {
7576
7677 function getSettings ( ) : JSON {
7778 let configXML = workspace . getConfiguration ( ) ;
79+
80+ let autoCloseTags = configXML . get ( "xml.completion.autoCloseTags" ) ;
81+ let autoClosingBrackets = configXML . get ( "[xml]" ) [ "editor.autoClosingBrackets" ] ;
82+ if ( autoCloseTags && autoClosingBrackets != "never" ) {
83+ window . showInformationMessage ( "Since xml.completion.autoCloseTags is enabled, [xml].editor.autoClosingBrackets was set to 'never'." ) ;
84+ workspace . getConfiguration ( ) . update ( "[xml]" , { "editor.autoClosingBrackets" : "never" } , true ) . then (
85+ ( ) => console . log ( "testSetting" + ' globally set to ' + "false" ) ,
86+ ( error ) => console . log ( error )
87+ ) ;
88+ }
89+
7890 configXML = configXML . get ( 'xml' ) ;
7991 let settings : JSON ;
8092 if ( ! configXML ) {
@@ -102,10 +114,6 @@ export function activate(context: ExtensionContext) {
102114 settings [ 'logs' ] [ 'file' ] = logfile ;
103115 return settings ;
104116 }
105-
106-
107-
108-
109117}
110118function getIndentationRules ( ) : LanguageConfiguration {
111119 return {
0 commit comments