Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Fixes #511

Closed
wants to merge 42 commits into from
Closed

Some Fixes #511

wants to merge 42 commits into from

Conversation

SimonSiefke
Copy link
Contributor

@SimonSiefke SimonSiefke commented Jan 11, 2020

I really like this extension and figured that it probably benefits a lot of people, so I decided to fix some issues. :)

Some notable changes

  • multi-cursor support
  • rename multi-line start-tags
  • better comment support
  • faster parsing

You can try out this version by downloading the vsix: auto-rename-tag-0.1.1.zip

Update: Since it might take some time until this Pull Request will be merged, I published this version to the VSCode marketplace https://marketplace.visualstudio.com/items?itemName=SimonSiefke.auto-rename-tag

Fixes

Probably fixes

cc @formulahendry

@skourismanolis
Copy link

THANK YOU for your PR and for publishing the merged version! Although this functionality has sort-of been implemented in one of the latest vscode updates, their solution is not as elegant as this extension's, and it doesn't work for .vue files (and I suspect other frameworks might have similar issues), whereas this extension does it seamlessly.

@doggy8088
Copy link

This PR is truly big. Would you split to smaller PRs, one issue linked to only one PR?

@SimonSiefke
Copy link
Contributor Author

It's not like I fixed those issues one by one, instead I implemented a different parser/algorithm. The old parser uses a regex to parse the file from top to bottom, which can unfortunately caused high cpu load and some other issues with multiline-start-tags and comments.

I instead used a handcoded parser that starts at the current cursor position and then parses to the left and to the right to find the matching start- and end-tag. It is loosely based on the Html Parser of VSCode, which already handles things like multiline-start-tags and comments.

So the different parser solved almost all the issues. Some issues like the typing-fast-issue (#36, #62) required some other solutions, but I don't think that extracting those solutions into separate PR's would be worth the effort. Also I can easier publish and update my fork when it's one version.

@grrowl
Copy link

grrowl commented Mar 13, 2020

Works great in my testing — is noticeably faster, doesn't have issues "keeping up" or stopping updating halfway through typing.

@grrowl
Copy link

grrowl commented Mar 17, 2020

hey @SimonSiefke, I found one bug during my usage related to React fragments. Given this code:

  return (
    <BoardLayout
      footer={
        <>
          Hello
        </>
      }
    >
      {children}
  )

if I add the closing tag for BoardLayout after { children }, typing </Bo, it will update the fragment after footer={ to be <Bo> as I type.

@SimonSiefke
Copy link
Contributor Author

@grrowl Fixed! Let me know if you have any further issues.

@jerone
Copy link

jerone commented Mar 21, 2020

@formulahendry Please merge this PR or give @SimonSiefke access to this repo. Don't let this extension go stale.

@seahindeniz
Copy link

@formulahendry please keep up with this PR

@formulahendry
Copy link
Owner

Awesome!!!
Thanks @SimonSiefke a lot!
I have already merged the PR. Not sure why it is not marked as 'merge' status.

@formulahendry
Copy link
Owner

The new extension is published: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag

Kudos to @SimonSiefke !

@seahindeniz
Copy link

Finally 🚀

@doggy8088
Copy link

@SimonSiefke ROCKS! 👍

@jerone
Copy link

jerone commented Apr 22, 2020

Note: it looks like those 102 linked issues in this PR are not automatically closed now this PR is not merged through GitHub UI.

SimonSiefke added a commit to SimonSiefke/vscode-auto-rename-tag that referenced this pull request Apr 27, 2020
* auto-rename-tag-server (work in progress)

* fix

* fix a bug

* fix some bugs and clean code

* fix another issue

* clean up a bit

* remove note about performance issue

* still quotes problem

* fixed quote issue

* fix tests

* fix more bugs

* refactor: remove dead code

* bring back enabledlanguageids setting

* fix webpack build

* test for another issue

* clean up a bit

* clean up issues

* refactor: remove dead code

* refactor: less code and a bit faster

* fix: don't throw error on invalid code

* better error handling

* add prettier script

* test agains latest vscode and clean up tests

* update travis ci script

* update travis ci script

* try to fix ci

* chore: try to fix ci

* chore: try to fix ci

* ignore built vscode rename in playground

* remove unused file

* remove more unused files

* remove unused test cases

* chore: try to fix ci

* remove unused file

* chore: update deps

* fix: support all file schemes

* performance improvement for large files by throttling requests

* inrease test timeout because of throttling

* fix: jsx fragment with self-closing tag

* chore: update deps

* Update README.md

* fix: react bug with {{}}
@icleolion
Copy link

icleolion commented May 25, 2020

Expecting this PR to also fix:
#527
#529
#532

Hopefully at some point the 454 issues can be closed! It is the season for spring cleaning after all 😄

Regarding the 454 issues, seems @SimonSiefke has managed to find a bug with GitHub. All 454 issues show that they are linked to this PR, but the PR itself only shows 102 issues linked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment