formulahendry / vscode-auto-close-tag

Auto Close Tag for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag
MIT License
176 stars 52 forks source link

Extension causes VSCode to hang #184

Open thepuzzlemaster opened 3 years ago

thepuzzlemaster commented 3 years ago

Issue Type: Bug

I don't have a very simple repro, but using the new vscode extension bisect, I was able to narrow this down to this extension. This is something that has happened to me sporadically over the past year or so maybe? When working in .tsx files, sometimes, my vscode will be unable to correctly parse my file, and even if my file is valid, it will place red squigglies in various places. When it gets in this state, the only options are to reload window or quit/restart.

I found a consistent repro today while working in this file.

If I copy the <Container className='bordered'> and then delete it and its correspending closing </Container> tag. And then organize imports and save the file.

If I then paste the <Container className='bordered'> tag back into place. Then delete the 'r' to get the auto-import to add Container back to the react-bootstrap imports. And then manually add the '` closing tag back, it gets into the weird hanging state.

I know it's kind of a weird repro, but it's the simplest one I could get reliably to repro.

import * as React from 'react'
import { Col, Form, Row, Container } from 'react-bootstrap'

export const CalendarAccurate: React.FC = () => {

  return (
    <Row>
      <Col md={8}>
      <Container className='bordered'>
        <Row>
          <Col>
            <h2>Successful hosting starts with an accurate calendar</h2>
            <p>
              Guests will book available days instantly. Only get booked when you can host by
              keeping your calendar and availability settings up-to-date.
            </p>
            <p>
              Canceling disrupts guests' plans. If you cancel becaues your calendar is innacurate,
              you'll be charged a penalty fee and the dates won't be available for anyone else to
              book.
            </p>
          </Col>
        </Row>
        <Row className='addSpaceAbove'>
          <Col>
            <Form.Group controlId='confirmCheckbox'>
            </Form.Group>
          </Col>
        </Row>
        </Container>
      </Col>
      <Col md={4} className='d-none d-md-block'>
        <p>
          Guests will only be able to book instantly if they meet all these requirements and agree
          to all of your House Rules.
        </p>
      </Col>
    </Row>
  )
}

Extension version: 0.5.9 VS Code version: Code 1.52.0 (940b5f4bb5fa47866a54529ed759d95d09ee80be, 2020-12-10T22:46:53.673Z) OS version: Darwin x64 20.1.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2500)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|5, 7, 6| |Memory (System)|16.00GB (0.38GB free)| |Process Argv|--crash-reporter-id 92a35523-c6a2-4be5-b83f-4447c8b6afd3| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 openlogontheside:30221877 python763:30178808 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 python504:30227505 vswsl492:30211401 wsl2prompt:30224612 pythonvsdeb440cf:30233464 unusedprompt:30224610 folderexplorercf:30224615 openfilemenucf:30224648 ```
LKNSI commented 3 years ago

Literally have no idea why the developer won't fix this. It was amazing he made this, but it's been a bug for about a solid year now and I have no idea how he hasn't realized. That may come off as brash; but I've had to just not use his plugin or I have to wait 30 seconds for VSCode to reconnect.

mkandan commented 1 year ago

@thepuzzlemaster @LKNSI have either of you found an alternative extension?

thepuzzlemaster commented 1 year ago

I realized that my initial post didn't escape a bunch of html tags, so they were actually not showing up in my comment. I updated that post to actually show all the content now.

@mkandan, I don't use this extension anymore. I'm pretty sure that this behavior is now native to vscode. At least for all the languages that I use (primarily .tsx and .html). At least I don't see any installed extensions which would add this functionality, and my tags auto-close by themselves.