vincaslt / vscode-highlight-matching-tag

Highlights matching opening or closing tag in VSCode
https://marketplace.visualstudio.com/items?itemName=vincaslt.highlight-matching-tag
MIT License
154 stars 16 forks source link

Enabling this extension makes VS Code very laggy. #56

Closed Manukam closed 5 years ago

Manukam commented 5 years ago

Enabling the extension makes the cursor gets stuck for like 2 minutes and then VS code goes to not responding state and have to restart to get it to working again.

k-ivan commented 5 years ago

Also, when selecting the code, the editor begins to lag heavily

vincaslt commented 5 years ago

Can you provide the example code that would cause lag when selecting/enabling the extension? I presume the files are rather large or the extension is crashing in some unexpected way, because I do not get lags using it in an everyday work.

k-ivan commented 5 years ago

Everything was normal, delays began recently, obviously, after update extension.

For example, the JS file on lines 709 is written on vanillajs(es2015). The code has a small html template stored in a variable (nothing special). Noticeable even in a small html-file of 160 lines. You can hold the mouse and select the code up and down. The editor is beginning to lag far behind. Sometimes during normal operation you have to restart the editor.

I want to note that lags appeared recently. After disable the extension, everything returns to normal.

Manukam commented 5 years ago

Yes it began recently. There is no specific type code, I noticed it in PHP, JS, HTML, CSS and etc. At first VS Code gets stuck for like 6 seconds and then resumes. Then it gets stuck and has to restart. This happens especially when highlighting and traversing code with the arrow keys. PS- the files i am working with are not that big. Most are 50 lines of code (PHP) and around 150 line code HTML files.

cbanack commented 5 years ago

I've noticed this issue as well, and I definitely saw it start immediately after the latest release. (I got the update in the middle of the afternoon while I was working in VS Code.)

Here's what I can add:

1) the problem seems to build up with time, i.e. it gets worse and worse the more I'm moving the cursor around and typing and stuff. I don't really notice it at first when I open VS Code and start working.

2) I'm working with php/html/js files that are relatively small (a few hundred lines, for the most part) and I will eventually end up with cursor lags of about 2 seconds (like I'll press the arrow key, and two seconds later the cursor will move.)

3) Disabling the plugin solves the problem immediately, as does restarting VS Code.

I love this plugin, btw. Hopefully this issue isn't too hard to track down.

vincaslt commented 5 years ago

Could you provide me with these things (in order of importance):

  1. Your PC specs: RAM, CPU, OS
  2. Extension settings you're using, if other than default
  3. Copy-paste-able code example where it's possible to see the errors.
  4. Copy the list of extensions you're using, in terminal: code --list-extensions if code command is not found, first use command in vscode: Shell command: install 'code' in PATH
  5. VSCode version and this extension version

My laptop and home PC are relatively powerful, and I'm not experiencing any delays or lag, so it would help me a lot in debugging if I could get this info from someone who experiences these problems.

k-ivan commented 5 years ago

1) Intel i7 4770k, 16GB RAM, Windows 10. 2) Default settings 3) Any code, even a small html 4)

arcticicestudio.nord-visual-studio-code
azemoh.one-monokai
brofox86.theme-espresso-soda-light
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
dbankier.vscode-quick-select
eamodio.gitlens
EditorConfig.EditorConfig
emmanuelbeziat.vscode-great-icons
Equinusocio.vsc-material-theme
formulahendry.auto-rename-tag
hollowtree.vue-snippets
kleber-swf.ocean-dark-extended
krizzdewizz.tag-rename
midnightsyntax.vscode-wrap-console-log
mkaufman.HTMLHint
ms-vscode.sublime-keybindings
ms-vsliveshare.vsliveshare
octref.vetur
PKief.material-icon-theme
robinbentley.sass-indented
Shan.code-settings-sync
shinnn.stylelint
techer.open-in-browser
vincaslt.highlight-matching-tag
wayou.vscode-todo-highlight

5) VSCode 1.28.2 / Extension 0.8.1

The VSCode is installed on ssd, the code is on hdd.

Manukam commented 5 years ago

Intel i7, 8GB RAM, Windows 10 Default settings any type of code eg2.tslint HookyQR.beautify ignorethis.teste kokororin.vscode-phpfmt ms-python.python small.php-ci vincaslt.highlight-matching-tag

Extension - 0.8.1 VS Code - 1.28.2

BTW I love this extension, it makes things a lot easier. Hopefully this will be fixed soon!

reggiegutter commented 5 years ago

I wrote a review in the extension page on VSCode Marketplace about this very issue. I also have been experiencing lag in VSCode recently and sometimes the VSCode window even crashes.

I have many extensions enable, so at first I didn't know what was causing the problem. I went on to disabled each one so I could identify the cause of the issue and found out that this extension was causing the crashes.

vincaslt asked for some code example, but in any file where there is html, this problem happens.

I have been using the extension for a long time. It's really helpful. I hope this issue gets fixed soon. Unfortunatly I don't have the knowledge to help w ith anything else.

My specs:

Intel i7-7500U @ 2.70GHz
RAM: 8GB
Running Windows 10 Pro

List of installed extensions:

dbaeumer.vscode-eslint
eamodio.gitlens
EditorConfig.EditorConfig
esbenp.prettier-vscode
felixfbecker.php-intellisense
formulahendry.auto-close-tag
formulahendry.auto-rename-tag
igorming.useful-react-snippets
kondratiev.sshextension
liximomo.sftp
mikestead.dotenv
mkaufman.HTMLHint
mrmlnc.vscode-apache
PeterJausovec.vscode-docker
PKief.material-icon-theme
wesbos.theme-cobalt2

User settings:

{
    "workbench.iconTheme": "material-icon-theme",
    "workbench.colorTheme": "Cobalt2",
    "files.autoSave": "afterDelay",
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "editor.tabCompletion": "on",
    "editor.formatOnSave": false,
    "[javascript]": {
        "editor.formatOnSave": true,
        "editor.tabSize": 2,
    },
}
KamasamaK commented 5 years ago

I think implementing debouncing earlier for the onDidChangeTextEditorSelection handler would help this. It's currently not being done until decoratePair.

jlosadasan commented 5 years ago

The same happens to me. "VS Code" often freeze and crash when I select text or moving cursors in html pages. I only works with files html/php/js. I desactivated this puglin until the problem is fixed. After reboot VS CODE all is rigth now.

vincaslt commented 5 years ago

Thanks guys for info it helped me find the issue. I dispose decorations, but forgot to cleanup the list I myself maintained 😬, and eventually it fills up to the point garbage collector's sweep stage takes a very long time to process and hangs the editor... Its super simple to fix, but I now have to review some "fixes" I did before that were just masking the issue rather then solving it, so gonna do that in the morning tomorrow.

vincaslt commented 5 years ago

Should be fixed in new version #57