Code Monkey home page Code Monkey logo

Comments (11)

yerol avatar yerol commented on June 26, 2024 5

this is especially important with html templating such as angular templates where we have a lot of attributes/directives on most elements. Great extension but only works half the time because of this limitation.

from vscode-auto-rename-tag.

jessejanderson avatar jessejanderson commented on June 26, 2024 2

Any progress on this? I love the idea of this plugin, but since I work in React where many of my tags are multiline, using it actually puts me into a false sense of security because I forget to change the closing tags every single time I edit a multiline tag.

from vscode-auto-rename-tag.

sunew avatar sunew commented on June 26, 2024 2

actually this is related to a hamful bug - if you have a multiline div inside another div, and rename the outer div, the matching is wrong, and the inner closing is renamed, causing your document structure to break.

example: renaming the first div, causes the closing tag of the <div class="article-text" to be renamed

      <div *ngIf="!submitted_backend">
        <header>
          <h1 class="article-title h2">{{ context.title }}</h1>
          <h5>{{ context.description }}</h5>
        </header>

        <div class="article-text"
             *ngIf="text"
             [innerHTML]="text | transformlinks | safehtml">
        </div>

        <sf-form [schema]="schema"
                 [model]="model"
                 [actions]="actions"
                 [validators]="validators"></sf-form>

        <div *ngIf="formError"
             class="alert alert-danger submit-alert">Fejlene ovenfor skal rettes fΓΈr formularen kan sendes ind.
        </div>

      </div>

from vscode-auto-rename-tag.

jessejanderson avatar jessejanderson commented on June 26, 2024 1

@sunew I've been unable to use this plugin because of this. 😞

I keep an eye on hoping for a fix because I love the plugin, but the projects I work on have a lot of nested multiline divs which causes this to break often.

from vscode-auto-rename-tag.

formulahendry avatar formulahendry commented on June 26, 2024

Currently, this extension does not handle multi-line tags, since it may produce unexpected renaming tag if we do not handle well. I will investigate if it is possible to handle that well.

from vscode-auto-rename-tag.

kylpo avatar kylpo commented on June 26, 2024

Got it - thanks. Really appreciate your work on this!

from vscode-auto-rename-tag.

sirius0xff avatar sirius0xff commented on June 26, 2024

I would suggest an experimental feature that enable multi-line support first.

Adding the following regex to the original start tag regex should solve most of the problem:
(?:^\s*(?:<!--\s*)?<(\w)+| ....... )

99% of the time multi-line tag would be the first of the line.
It is very unlikely, and probably shouldn't be, that a line is start with < but not a tag.
Finding closing bracket is not necessary in this case.
It also avoid dueling with attributes that contains <> .

One potential trouble is from comments, but any mess can be written in comments anyway.

Not pretty, but it should cover most of the use case.
I believe most users would gladly take the trade.

from vscode-auto-rename-tag.

olee avatar olee commented on June 26, 2024

Same here - this is quite the bummer

from vscode-auto-rename-tag.

GiancarlosIO avatar GiancarlosIO commented on June 26, 2024

πŸ‘€

from vscode-auto-rename-tag.

devnoel avatar devnoel commented on June 26, 2024

This is also the case for me. This is an excellent plugin and I absolutely love it, but I can't use it because of this issue.

from vscode-auto-rename-tag.

scriptcoded avatar scriptcoded commented on June 26, 2024

I would suggest an experimental feature that enable multi-line support first.

Adding the following regex to the original start tag regex should solve most of the problem:
(?:^\s*(?:<!--\s*)?<(\w)+| ....... )

99% of the time multi-line tag would be the first of the line.
It is very unlikely, and probably shouldn't be, that a line is start with < but not a tag.
Finding closing bracket is not necessary in this case.
It also avoid dueling with attributes that contains <> .

One potential trouble is from comments, but any mess can be written in comments anyway.

Not pretty, but it should cover most of the use case.
I believe most users would gladly take the trade.

@sirius0xff you don't happen to have a fork with this change?

from vscode-auto-rename-tag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.