@@ -17,7 +17,6 @@ import { languages, IndentAction, workspace, window, commands, ExtensionContext,
1717import * as path from 'path' ;
1818import * as os from 'os' ;
1919import { activateTagClosing } from './tagClosing' ;
20-
2120namespace TagCloseRequest {
2221 export const type : RequestType < TextDocumentPositionParams , string , any , any > = new RequestType ( 'xml/closeTag' ) ;
2322}
@@ -45,11 +44,12 @@ export function activate(context: ExtensionContext) {
4544 revealOutputChannelOn : RevealOutputChannelOn . Never ,
4645 initializationOptions : { settings : getSettings ( ) } ,
4746 synchronize : {
48- configurationSection : [ 'xml' ]
47+ configurationSection : [ 'xml' , '[xml]' ]
4948 } ,
5049 middleware : {
5150 workspace : {
5251 didChangeConfiguration : ( ) => languageClient . sendNotification ( DidChangeConfigurationNotification . type , { settings : getSettings ( ) } )
52+
5353 }
5454 }
5555 }
@@ -75,6 +75,17 @@ export function activate(context: ExtensionContext) {
7575
7676 function getSettings ( ) : JSON {
7777 let configXML = workspace . getConfiguration ( ) ;
78+
79+ let autoCloseTags = configXML . get ( "xml.completion.autoCloseTags" ) ;
80+ let autoClosingBrackets = configXML . get ( "[xml]" ) [ "editor.autoClosingBrackets" ] ;
81+ if ( autoCloseTags && autoClosingBrackets != "never" ) {
82+ window . showInformationMessage ( "Since xml.completion.autoCloseTags is enabled, [xml].editor.autoClosingBrackets was set to 'never'." ) ;
83+ workspace . getConfiguration ( ) . update ( "[xml]" , { "editor.autoClosingBrackets" : "never" } , true ) . then (
84+ ( ) => console . log ( "testSetting" + ' globally set to ' + "false" ) ,
85+ ( error ) => console . log ( error )
86+ ) ;
87+ }
88+
7889 configXML = configXML . get ( 'xml' ) ;
7990 let settings : JSON ;
8091 if ( ! configXML ) {
@@ -86,7 +97,7 @@ export function activate(context: ExtensionContext) {
8697 client : true
8798 } ,
8899 format : {
89- enabled : true ,
100+ enabled : true ,
90101 splitAttributes : false
91102 } ,
92103 completion : {
@@ -102,11 +113,8 @@ export function activate(context: ExtensionContext) {
102113 settings [ 'logs' ] [ 'file' ] = logfile ;
103114 return settings ;
104115 }
105-
106-
107-
108-
109116}
117+
110118function getIndentationRules ( ) : LanguageConfiguration {
111119 return {
112120 onEnterRules : [
0 commit comments