Skip to content

Conversation

@obrobrio2000
Copy link
Contributor

@obrobrio2000 obrobrio2000 commented Oct 2, 2025

Closes microsoft/vscode-html-languageservice#216

Summary

This PR adds a new setting html.suggest.hideEndTagSuggestions to the HTML extension, allowing users to disable automatic end tag completion suggestions.

Related Changes

⚠️ Important: This PR has corresponding changes in the vscode-html-languageservice repository: microsoft/vscode-html-languageservice#219

Changes

Added

  • New Setting: html.suggest.hideEndTagSuggestions
    • Type: boolean
    • Default: false
    • Description: "When enabled, end tag completion suggestions will not be shown"
    • Location: extensions/html-language-features/package.json

Files Modified

  • extensions/html-language-features/package.json - Added new configuration setting
  • extensions/html-language-features/package.nls.json - Added localized description

Behavior

Before

Users had no way to disable end tag suggestions. The html.suggest.html5 setting only controlled element suggestions but not closing tag suggestions.

After

Users can now set html.suggest.hideEndTagSuggestions: true to disable end tag completion suggestions:

{
  "html.suggest.hideEndTagSuggestions": true
}

When typing:

<body>
<

With the setting disabled (default), users see closing tag suggestions like </body>.
With the setting enabled, no closing tag suggestions appear.

Testing

This setting relies on the underlying implementation in microsoft/vscode-html-languageservice#219 which includes comprehensive unit tests.

Manual testing:

  1. Open an HTML file
  2. Type <body>\n< and verify closing tag suggestion appears
  3. Enable html.suggest.hideEndTagSuggestions
  4. Type <body>\n< and verify no closing tag suggestion appears

Dependencies

This PR depends on an updated version of vscode-html-languageservice that includes support for the hideEndTagSuggestions option in the CompletionConfiguration interface.

Checklist

  • Code follows VS Code contribution guidelines
  • Setting added to package.json with appropriate metadata
  • Localized strings added to package.nls.json
  • Setting description is clear and user-friendly
  • Commit message follows conventional format
  • Changes are backward compatible (default behavior unchanged)

Add html.suggest.hideEndTagSuggestions setting to allow users to
disable automatic end tag completion suggestions.

When enabled, prevents the completion provider from suggesting
closing tags for open elements (e.g., </body> when typing after <body>).

Fixes microsoft/vscode-html-languageservice#216

Signed-off-by: Giovanni Magliocchetti <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@aeschli aeschli added this to the October 2025 milestone Oct 15, 2025
@aeschli aeschli merged commit 0067347 into microsoft:main Oct 21, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting to disable end tag suggestions

3 participants