File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ export namespace QuteClientCommandConstants {
3939 * Client command to execute an XML command on XML Language Server side.
4040 */
4141 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' ;
4247}
4348
4449/**
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export function registerVSCodeQuteCommands(context: ExtensionContext) {
1919 registerJavaDefinitionCommand ( context ) ;
2020 registerConfigurationUpdateCommand ( context ) ;
2121 registerQuteValidationToggleCommand ( context ) ;
22+ registerQuteInlayHintBindToEditorSetting ( context ) ;
2223 context . subscriptions . push (
2324 workspace . onDidOpenTextDocument ( ( document ) => {
2425 updateQuteLanguageId ( context , document , true ) ;
@@ -184,6 +185,20 @@ export function registerConfigurationUpdateCommand(context: ExtensionContext) {
184185 } ) ) ;
185186}
186187
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+
187202/**
188203 * Sets the `editorQuteValidationEnabled` based on `qute.command.validation.template.status` and `qute.validation.enabled`.
189204 */
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ export namespace QuteSettings {
3030 */
3131 export const QUTE_OVERRIDE_LANGUAGE_ID = 'qute.templates.override.languageId' ;
3232
33+ /**
34+ * Qute inlay hint setting.
35+ */
36+ export const QUTE_INLAY_HINT = 'qute.inlayHint.enabled' ;
37+
3338 export function getQuteTemplatesLanguageMismatch ( ) : QuteTemplateLanguageMismatch {
3439 return workspace . getConfiguration ( ) . get < QuteTemplateLanguageMismatch > ( QUTE_TEMPLATES_LANGUAGE_MISMATCH ) ;
3540 }
You can’t perform that action at this time.
0 commit comments