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

Tab / auto tag completion incorrectly adds closing tag when pasting text in jsx file #62893

Closed
joshunger opened this issue Nov 10, 2018 · 3 comments
Assignees
Labels
confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Milestone

Comments

@joshunger
Copy link
Contributor

Issue Type: Bug

  1. Create a new file and save with a .jsx file extension.

  2. Paste the following content:

<!-- Footer -->
<footer class="footer">
    <div class="container">
        <div class="has-text-centered">
            <div class="has-text-centered">
                <img class="small-footer-logo" src="assets/images/logos/bulkit-logo-g.png" alt="">
            </div>
        </div>
        <div class="has-text-centered">
            <span class="more-info-company">Startup and SaaS template</span>
        </div>
    </div>
</footer>
<!-- /Footer -->
  1. Note the first line.

image

Expecting: no incorrect text.

Actual: </footer> is incorrect added.

My use case: convert existing .html to a .jsx component. I was doing it this way -

  1. Create empty .jsx file.
  2. Paste html.
  3. Wrap in export default () => ( and ).
  4. Clean up.

VS Code version: Code - Insiders 1.29.0-insider (5438af1, 2018-11-07T00:54:27.213Z)
OS version: Darwin x64 18.0.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz (4 x 3100)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 3
Memory (System) 16.00GB (0.03GB free)
Process Argv .
Screen Reader no
VM 0%
Extensions (17)
Extension Author (truncated) Version
vscode-eslint dba 1.7.0
xml Dot 2.3.2
EditorConfig Edi 0.12.5
prettier-vscode esb 1.7.1
flow-for-vscode flo 0.8.5
python ms- 2018.10.0
vscode-jest Ort 2.9.2
vscode-docker Pet 0.3.1
java red 0.33.0
sass-indented rob 1.4.9
vscode-fileutils sle 2.12.0
code-spell-checker str 1.6.10
sort-lines Tyr 1.7.0
vscode-java-debug vsc 0.15.0
vscode-java-pack vsc 0.4.0
vscode-java-test vsc 0.10.0
vscode-maven vsc 0.11.1
@vscodebot vscodebot bot added the insiders label Nov 10, 2018
@chrmarti
Copy link
Contributor

/confirm No extensions needed. Reproduced maybe not the first, but all subsequent times.

@vscodebot vscodebot bot added the confirmed Issue has been confirmed by VS Code Team member label Nov 12, 2018
@mjbvz mjbvz self-assigned this Nov 12, 2018
@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Nov 15, 2018
@mjbvz mjbvz added this to the November 2018 milestone Nov 15, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 15, 2018

Two issue issues:

  1. I fixed a bug for jsx tag complete for multi-line paste with Incorrect jsx tag completion on multi-line paste #63178

  2. That html is not valid jsx what with the comments, but the img tag is also not properly closed: />. This causes the invalid tag completion. I've opened Bad auto closing jsx tag returned for if you have an unclosed element TypeScript#28541 to track possibly improving behavior for this. Can't guarantee that will be fixed since we only officially support proper jsx

Closing as upstream and duplicate

@mjbvz mjbvz closed this as completed Nov 15, 2018
@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) *duplicate Issue identified as a duplicate of another issue(s) and removed bug Issue identified by VS Code Team member as probable bug labels Nov 15, 2018
@joshunger
Copy link
Contributor Author

Thanks!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants