formulahendry / vscode-auto-rename-tag Goto Github PK
View Code? Open in Web Editor NEWAutomatically rename paired HTML/XML tag
Home Page: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
License: MIT License
Automatically rename paired HTML/XML tag
Home Page: https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
License: MIT License
even though I did the following:
{
"auto-rename-tag.activationOnLanguage": [
"erb:
]
}
if I select the whole text of a tag ie the text 'div' in a tag by double clicking the tag, and then type in a new tag, it doesn't update the matching tag.
if I highlight PART of a tag like 'one' in 'divone' and change it, then it does work.
Thanks for providing this extension - very useful. However there's one issue that is stopping me using it:
When a tag name is changed it breaks redo. i.e. undo the tag name change then try and redo it. The redo doesn't work and does't redo any upstream changes that you may have done after the tag renaming.
OSX 10.12.1
Code 1.7.2
Auto Rename Tag 0.0.8
Illegal value for line
: Error: Illegal value for line
at t._lineAt (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:229497)
at Object.lineAt (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:228287)
at TagManager.getWordAtPosition (C:\Users\admin.vscode-insiders\extensions\formulahendry.auto-rename-tag-0.0.11\out\src\tagManager.js:32:33)
at TagManager.getCurrentWord (C:\Users\admin.vscode-insiders\extensions\formulahendry.auto-rename-tag-0.0.11\out\src\tagManager.js:28:25)
at vscode.window.onDidChangeTextEditorSelection.event (C:\Users\admin.vscode-insiders\extensions\formulahendry.auto-rename-tag-0.0.11\out\src\tagManager.js:10:18)
at e.invoke (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:30930)
at e.fire (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:34737)
at t.$acceptSelectionsChanged (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:347776)
at t.e.handle (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:266430)
at s (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:154933)
at h (c:\Program Files (x86)\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:155610)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
changing a tagname and then hitting cmd+z to undo now requires hitting undo many extra times (once per letter of the tag). Is there a way for this plugin to make it's changes in a way that don't cause any history entries?
Randomly throughout my project my intellisense and user snippets stop working, and it is only happened since I installed this extension and updated to VSCode 1.7.1
I do not know how to recreate it, but it should not take long to try and replicate it. I first noticed it when I tried to edit a tag, and it didn't edit both tags, and since then the intellisense and user snippets stop working, so I have to restart VSCode to get them working again.
I do however get the following error.
shell.ts:440 Illegal argument: character must be positive: Error: Illegal argument: character must be positive at Object.h [as illegalArgument] (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:5:4907) at new e (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:9:7079) at e.translate (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:9:8741) at TagManager.updatePairedTag (C:\Users\kyle\.vscode\extensions\formulahendry.auto-rename-tag-0.0.7\out\src\tagManager.js:72:47) at vscode.workspace.onDidChangeTextDocument.event (C:\Users\kyle\.vscode\extensions\formulahendry.auto-rename-tag-0.0.7\out\src\tagManager.js:13:18) at e.invoke (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:5:7347) at e.fire (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:5:15669) at t.$acceptModelChanged (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:11:5992) at t.e.handle (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:10:10602) at s (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:7:21356)
I don't know why, but with the recent update it stop working. When I rename a tag, the closing tag it's not longer renamed too.
Below case does not work:
testUtil.insertAtPosition("<div a=b></div>", "r", new vscode.Position(0, 4), "<divr a=b></divr>", done);
While below case does work:
testUtil.insertAtPosition("<div a=b></div>", "r", new vscode.Position(0, 3), "<dirv a=b></dirv>", done);
When moving lines up or down using the "alt+up/down" shortcut, it renames tags in the lines it moves over automatically. This makes it impossible to use this extension for me, because I tend to use this shortcut a lot, Otherwise great extension!
I'm using VSCode version 1.7.1
Not working for angular tag e.g.:
<ng-component></ng-component>
It should work for any kinds of tags
The closing a
tag is not renamed on renaming of the opening tag in the following code snippet:
<a href="#"
style="text-decoration: none; color: white; margin-right: 0.35rem;"
(click)="onDelete(ingredient); $event.preventDefault();"><i class="ion-trash-a"></i></a>
Hi
I'm editing a web.config file.
I select a tag, delete some chars, the closing tag is also updated, then I type some chars but the closing tag stop updating.
I have to click elsewhere and then click again on the tag to make it work again.
Given code like:
<View
prop1="1"
>
<Button />
</View>
Renaming <View
will not rename </View>
However, it will be correctly renamed with code like:
<View prop1="1">
<Button />
</View>
Thanks for this extension! Seems like an idea subtle and good enough to become standard in future editors. I look forward to using it!
Cannot read property 'document' of undefined: TypeError: Cannot read property 'document' of undefined
at TagManager.isEnabled (/Users/selcuk/.vscode/extensions/formulahendry.auto-rename-tag-0.0.13/out/src/tagManager.js:56:56)
at TagManager.updatePairedTag (/Users/selcuk/.vscode/extensions/formulahendry.auto-rename-tag-0.0.13/out/src/tagManager.js:67:19)
at vscode.workspace.onDidChangeTextDocument.event (/Users/selcuk/.vscode/extensions/formulahendry.auto-rename-tag-0.0.13/out/src/tagManager.js:14:18)
at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:14715)
at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:53565)
at t.$acceptDirtyStateChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:343547)
at t.e.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:312304)
at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:176531)
at h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:177208)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
Hi It does not seem to rename the html tags that are multiline. For example
<div ref="input"
:html="value"
@html="$emit('input', $event)"
class="input-field"
:disabled="!edit"
:class="label + '-field'"
v-else-if="params.type === 'textarea'">
</div>
I have read the issue note from the November 2016, which seemed to be the similar issue but not.
If I undo after renaming the tag, I lose all undo stacks and can only undo the last character of the tag.
If I change to and then press ctrl+z, vscode will repeat back and forth between and
I installed the plugin today through vscode plugin installer
when type <
in class binding exp in vue files, it cause an unknown problem in vscode and makes the typing after <
very slow.
I've created an issue in vscode but found it is caused by auto-rename-tag:
I use vscode 1.9 both in windows7 and macos with jsx file,
and when I edit single tag like <input />
or <img />
inside ,
add a className or other attribute,
it makes the vscode eidtor so lag.
I had a div tag in a test file. I go to after the v in the opening tag and backspace three times to change to a p tag. after I backspaced the 'd' the closing tag kept the 'd' and then when I typed the 'p' the closing tag was out of synch.
I have the extention installed and added
"auto-rename-tag.activationOnLanguage": [ "html", "xml", "php" ]
to my settings but it's not working
Problem:
When a .ejs file is saved, the CPU usage rises to 99%.
How to reproduce:
Evidence that this extension has something to do with it: I disabled all the other VSCode extensions and the issue does not happen, enabling only this one causes the problem, enabling any other plugin does not.
Running ps aux | grep 32942 returns:
/Downloads/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Downloads/Visual Studio Code.app/Contents/Resources/app/out/bootstrap --type=extensionHost
(being 32942 the PID of a Code Helper task is using 99% of the CPU)
VSCode version: 1.15.1
Extension version: 0.0.14
File is attached.
index.ejs.zip
VSCode made some changes to JSX (at least), and now this extension isn't working.
My settings.json:
{
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"editor.snippetSuggestions": "top",
"editor.tabSize": 4,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"files.associations": {
"*.js": "javascriptreact"
},
"git.enableSmartCommit": true,
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0
}
I was just messing around in my user settings.json in VS Code, and I found the auto-rename-tag settings. I thought it was part of VS Code so I got excited and deleted this extension, but that actually removed the settings :)
I added it back, and then I re-investigated and noticed it had "*" for languages, so I pasted the setting into my user settings to overwrite the defaults, and it works now. I noticed if I type really fast, it gets screwed up though. You should probably check that out.
Put in:
<Test>
</Test>
and then inside the closing tag, type 'lksjdfhlaksjdhf' pretty fast. It seems almost like there is a refresh rate that causes a problem if you type too fast.
Anyway, it works now so I'm happy!
<md- *ngFor="let productPrice of model.productPrices"> <!-- started replacing DIV tag -->
<div layout="row" layoutSm="column" layoutXs="column" >
<md-input placeholder="Location" [(ngModel)]="productPrice.location" readonly flex></md-input>
<md-input placeholder="Purchase Price" [(ngModel)]="productPrice.purchasePrice" readonly flex></md-input>
</md-> <!-- renames first, not pairing DIV tag - FAIL -->
<div layout="row" layoutSm="column" layoutXs="column" >
<md-input placeholder="Retail Price 1" [(ngModel)]="productPrice.retailPrice1" readonly flex></md-input>
<md-input placeholder="Retail Price 2" [(ngModel)]="productPrice.retailPrice2" readonly flex></md-input>
<md-input placeholder="Retail Price 3" [(ngModel)]="productPrice.retailPrice3" readonly flex></md-input>
</div>
</div> // <!-- should rename this tag -->
Tags with dash in their name do not get autocompleted after the dash.
Example:
I want to rename <div></div>
into <company-header></company-header>
.
While typing 'company', all is well. However, the dash doesn't get reflected to the closing tag, or any characters behind the dash. So I end up with <company-header></company>
.
Cannot read property 'text' of undefined: TypeError: Cannot read property 'text' of undefined
at TagManager.updatePairedTag (/Users/imac/.vscode/extensions/formulahendry.auto-rename-tag-0.0.12/out/src/tagManager.js:64:70)
at vscode.workspace.onDidChangeTextDocument.event (/Users/imac/.vscode/extensions/formulahendry.auto-rename-tag-0.0.12/out/src/tagManager.js:14:18)
at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:14715)
at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:53565)
at t.$acceptDirtyStateChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:343547)
at t.$acceptModelSaved (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:343330)
at t.e.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:312304)
at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:176531)
at h (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:177208)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
Illegal value for line
: Error: Illegal value for line
at t._lineAt (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:254412)
at Object.lineAt (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:253202)
at TagManager.getWordAtPosition (/Users/imac/.vscode/extensions/formulahendry.auto-rename-tag-0.0.12/out/src/tagManager.js:33:33)
at TagManager.getCurrentWord (/Users/imac/.vscode/extensions/formulahendry.auto-rename-tag-0.0.12/out/src/tagManager.js:29:25)
at vscode.window.onDidChangeTextEditorSelection.event (/Users/imac/.vscode/extensions/formulahendry.auto-rename-tag-0.0.12/out/src/tagManager.js:11:18)
at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:14715)
at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:53565)
at t.$acceptSelectionsChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:391342)
at t.e.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:312304)
at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:23:176531)
If you try to edit a tag that happens to have a space before the >
, it will freeze the entire extension host and stop working completely. It will also increase CPU usage significantly. I assume there's an infinite loop going on somewhere?
Try creating an empty html file with these contents:
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z" />
</svg>
Then try editing the path tag. The extension host will freeze. This happens regardless if you use />
or ></path>
, as long as there is a space before.
Demo here :
https://www.useloom.com/share/d6b76efb26f749bd88372fa81f4d715a
Is it just for me or it's a bug?
Hello,
I had some strange happenings going on in my VS Code:
I looked everywhere for errors pertaining to this issue but couldn't find any anywhere.
I eventually started disabling all my extensions one-by-one. When I disabled this one, everything started working find again.
I wanted to report the issue here to make you aware. I'm sorry I don't have more information.
Using the delete key instead of backspace causes weird behaviour
Also if you do that in a nested table, it gets even worse (note the parent <t>
tags)
Potentially related to #12
Hello,
this extension should not by default be active in all sorts of files, because its behaviour is unpredictable. I suggest you set it to html, xmpl, php and javascript, as seen in the documentation.
Consider the following Java (!) class
public class A
{
public void xyz(int foo, int aaaaaaaaaaaaaaaa, int bbbbbbbbbbbbbbbbbb, int ccccccccccccccc, int ddddddddddddddd) throws Exception {
}
}
Insert a <
directly after the first int
, then delete it. Now the entire ide is severely laggy, eats up loads of CPU and the process even keeps running after window close, consuming more and more memory.
Even though this is probably just another example of #32, a lot of headaches could be prevented by not enabling this extension on all file types by default. Figuring out the auto rename extension was to blame for this is somehow really hard and just took me 1.5 hours. If someone installed this extension and sees that it doesnt do anything in e.g. his/her .jsx files, they will read the documentation anyways and modify the activationOnLanguage
setting.
Steps to reproduce:
<div>
<span>This is just a test</span>
</div>
a
to rename to an anchor tagNote: At this point, auto rename no longer works.
Steps to reproduce:
Each $B_i$ can be specified by $n$ bits, so we have that the input size is $O(mn)$, and since
$k < n$
(Keystrokes: Esc I $k < n$
)Result:
The cursor freezes after the <
character, and VSCode is unresponsive. Closing it down leaves a process hanging around in the background, which has to be killed manually. (killall code
)
Strangely enough, this does not occur when only one of the two extensions above are installed, but I can't imagine what the connection is. Viscerally, it seemed more related to vscode-auto-rename-tag, due to the opening <
, so I filed the bug report here.
Versions:
working :
<div some_fancy_attr>
some_fancy_html
</div>
not working :
<div some_fancy_attr
>
some_fancy_html
</div>
not working :
<div
some_fancy_attr>
some_fancy_html
</div>
not working :
<div some_fancy_attr>
some_fancy_html
</div
>
Would be great if this could work in TSX file too. I really like this extension keep up the good work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.