@@ -28,11 +28,16 @@ registerConfigurations([{
2828 }
2929} ] )
3030
31- let autoClosingTags = getConfiguration < boolean > ( undefined , 'html.autoClosingTags' ) !
32- onConfigurationChanged ( e => {
33- if ( e . affectsConfiguration ( 'html.autoClosingTags' ) ) {
34- autoClosingTags = getConfiguration < boolean > ( undefined , 'html.autoClosingTags' ) !
35- }
31+ let autoClosingTags = false
32+
33+ setTimeout ( ( ) => {
34+ // In a timeout so the service can be overriden
35+ autoClosingTags = getConfiguration < boolean > ( undefined , 'html.autoClosingTags' ) !
36+ onConfigurationChanged ( e => {
37+ if ( e . affectsConfiguration ( 'html.autoClosingTags' ) ) {
38+ autoClosingTags = getConfiguration < boolean > ( undefined , 'html.autoClosingTags' ) !
39+ }
40+ } )
3641} )
3742
3843function autoCloseHtmlTags ( editor : monaco . editor . ICodeEditor ) : monaco . IDisposable {
@@ -100,13 +105,17 @@ function autoCloseHtmlTags (editor: monaco.editor.ICodeEditor): monaco.IDisposab
100105 return disposableStore
101106}
102107
103- const codeEditors = monaco . extra . StandaloneServices . get ( monaco . extra . ICodeEditorService ) . listCodeEditors ( )
104- for ( const editor of codeEditors ) {
105- autoCloseHtmlTags ( editor )
106- }
107- monaco . editor . onDidCreateEditor ( editor => {
108- autoCloseHtmlTags ( editor )
108+ setTimeout ( ( ) => {
109+ // In a timeout so the service can be overriden
110+ const codeEditors = monaco . extra . StandaloneServices . get ( monaco . extra . ICodeEditorService ) . listCodeEditors ( )
111+ for ( const editor of codeEditors ) {
112+ autoCloseHtmlTags ( editor )
113+ }
114+ monaco . editor . onDidCreateEditor ( editor => {
115+ autoCloseHtmlTags ( editor )
116+ } )
109117} )
118+
110119/**
111120 * End autoclosing html tags
112121 */
0 commit comments