Skip to content

[html] "Expand selection" misses { } in <script> tag #85306

Closed

Description

@ultraGentle

Because "expand selection" is language-aware, you can't use it to expand to block scope
{....[cursor is here]....} in a mixed HTML/Javascript file. Coding within the <script> tags, "expand selection" still looks for HTML "scopes" to expand to.

Aren't there extensions that will do this?
I have tried many, many, and all fail in mixed HTML/CSS/JS files in one way or another.

So, my request is either

  1. "expand" to recognize when it's in a <script> tag, or
  2. alternatively allow the user to toggle a "universal" mode, so that expand always just expands to ANY* next bound (matched-character pair {[(<, delimiter _-, whitespace)
    *these bounds could be user-configurable.

Activity

  1. vscodebot commented on Nov 21, 2019

    @vscodebot

    (Experimental duplicate detection)
    Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

  2. ultraGentle commented on Nov 22, 2019

    @ultraGentle
    ContributorAuthor

    I'm wondering if the cause of this is related to #85411 (can't "rename symbol" within <script> tags) in which case perhaps both individual issues should be closed in favor of something like, "some editor features do not work within <script> tags."

  3. changed the title [-]"Expand selection" misses { } in <script> tag[/-] [+][html] "Expand selection" misses { } in <script> tag[/+] on Nov 26, 2019
  4. added
    html
    feature-request
    on Nov 26, 2019
  5. added a commit that references this issue on Nov 27, 2019
    231b0c5
  6. added
    verification-needed
    on Dec 3, 2019
  7. aeschli commented on Dec 3, 2019

    @aeschli
    Contributor

    To verify:

    • Have HTML with embedde css and JavaScript
    • Set cursor inside the embededded code and use Expand Selection multiple times
    • Verify that the selection grows according to the embedded language's syntax, and then using the surrounding HTML.
  8. ultraGentle commented on Dec 3, 2019

    @ultraGentle
    ContributorAuthor

    Confirmed! Much appreciated.

  9. locked and limited conversation to collaborators on Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requesthtmlverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions