File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ export namespace QuteClientCommandConstants {
39
39
* Client command to execute an XML command on XML Language Server side.
40
40
*/
41
41
export const EXECUTE_WORKSPACE_COMMAND = 'qute.workspace.executeCommand' ;
42
+
43
+ /**
44
+ * Bind Qute inlay hint setting to editor inlay hint setting.
45
+ */
46
+ export const BIND_QUTE_INLAY_HINT = 'bind.qute.inlayHint.enabled' ;
42
47
}
43
48
44
49
/**
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export function registerVSCodeQuteCommands(context: ExtensionContext) {
19
19
registerJavaDefinitionCommand ( context ) ;
20
20
registerConfigurationUpdateCommand ( context ) ;
21
21
registerQuteValidationToggleCommand ( context ) ;
22
+ registerQuteInlayHintBindToEditorSetting ( context ) ;
22
23
context . subscriptions . push (
23
24
workspace . onDidOpenTextDocument ( ( document ) => {
24
25
updateQuteLanguageId ( context , document , true ) ;
@@ -184,6 +185,20 @@ export function registerConfigurationUpdateCommand(context: ExtensionContext) {
184
185
} ) ) ;
185
186
}
186
187
188
+ export function registerQuteInlayHintBindToEditorSetting ( context : ExtensionContext ) {
189
+ context . subscriptions . push ( commands . registerCommand ( QuteClientCommandConstants . BIND_QUTE_INLAY_HINT , async ( ) => {
190
+ const editorInlayHintSetting = workspace . getConfiguration ( ) . get < string > ( `editor.inlayHints.enabled` , "on" ) ;
191
+ if ( editorInlayHintSetting === "off" ) {
192
+ const edit = {
193
+ value : false ,
194
+ editType : ConfigurationItemEditType . Add ,
195
+ section : QuteSettings . QUTE_INLAY_HINT
196
+ } as ConfigurationItemEdit ;
197
+ await commands . executeCommand ( QuteClientCommandConstants . COMMAND_CONFIGURATION_UPDATE , edit ) ;
198
+ }
199
+ } ) ) ;
200
+ }
201
+
187
202
/**
188
203
* Sets the `editorQuteValidationEnabled` based on `qute.command.validation.template.status` and `qute.validation.enabled`.
189
204
*/
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ export namespace QuteSettings {
30
30
*/
31
31
export const QUTE_OVERRIDE_LANGUAGE_ID = 'qute.templates.override.languageId' ;
32
32
33
+ /**
34
+ * Qute inlay hint setting.
35
+ */
36
+ export const QUTE_INLAY_HINT = 'qute.inlayHint.enabled' ;
37
+
33
38
export function getQuteTemplatesLanguageMismatch ( ) : QuteTemplateLanguageMismatch {
34
39
return workspace . getConfiguration ( ) . get < QuteTemplateLanguageMismatch > ( QUTE_TEMPLATES_LANGUAGE_MISMATCH ) ;
35
40
}
You can’t perform that action at this time.
0 commit comments