zed icon indicating copy to clipboard operation
zed copied to clipboard

Please improve the auto-completion of DOM tags in React.

Open path-of-reason opened this issue 1 year ago • 22 comments

Check for existing issues

  • [X] Completed

Describe the feature

Currently, when I type "div" in a tsx or jsx file, there is no IntelliSense support. Suggestions only work after I type the angle bracket '<', and I still have to close the tag manually, which is inconvenient.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

path-of-reason avatar Jan 15 '24 08:01 path-of-reason

@path-of-reason This really helps a lot, rewriting tags all the time is tiring

emersonjds avatar Feb 26 '24 19:02 emersonjds

@JosephTLyons This is a feature that brings a totally different experience to the developer, let's look more at the experience to build a cutting-edge product

emersonjds avatar Feb 26 '24 19:02 emersonjds

I agree, this is the only issue that stop me from using this IDE. Might implement it myself, if it's not the priority.

KoHorizon avatar Mar 18 '24 15:03 KoHorizon

Coming from #5267, the tag auto-close doesn’t seem to work for HTML either.

chungweileong94 avatar May 30 '24 04:05 chungweileong94

Coming from #5267, the tag auto-close doesn’t seem to work for HTML either.

Which version of Zed are you on? Do you have the HTML extension installed?

Moshyfawn avatar May 30 '24 04:05 Moshyfawn

Coming from #5267, the tag auto-close doesn’t seem to work for HTML either.

Which version of Zed are you on? Do you have the HTML extension installed?

I just tested on the latest preview 0.138.1, and the problem still persists. And I do have the HTML extension installed as well.

https://github.com/zed-industries/zed/assets/15154097/3b56a89e-1925-414e-aebd-237878e0ee8e

chungweileong94 avatar May 30 '24 05:05 chungweileong94

It's after you complete the tag with > that the LSP closes it for you.

Moshyfawn avatar May 30 '24 05:05 Moshyfawn

It's after you complete the tag with > that the LSP closes it for you.

Ah, my bad, I'm actually showing the wrong demo here. But yeah, but yeah, it's working in the latest 0.138 now😅 But it wasn't the case for 0.137 before.

chungweileong94 avatar May 30 '24 05:05 chungweileong94

This keeps me from switching to Zed! Also shortcuts for code snippets such as rsfc to create a React function component, etc... This makes your slogan obsolete ;)

IlirEdis avatar Jun 05 '24 10:06 IlirEdis

I don't know, there is always something basic that keeps me from switching to zed

leognmotta avatar Jun 07 '24 11:06 leognmotta

This and no snippets support are the main reason I have not switched to Zed fully

typing rfc and getting a react component scaffolded for you is way to good to pass up on

monarcode avatar Jun 11 '24 17:06 monarcode

For what it's worth, we've recently landed support for snippets in https://github.com/zed-industries/zed/pull/13253

osiewicz avatar Jun 24 '24 11:06 osiewicz

@osiewicz Hi, i did see the update on snippet support and already tried it out, how ever, i noticed that the formatting is seemingly bugged.

when the snipper is expanded it does not appear as it should..see screenshots bellow Monarch Twitter Media Monarch Twitter Media (1)

monarcode avatar Jun 24 '24 20:06 monarcode

Do you mean that <p></p> is getting de-indented?

osiewicz avatar Jun 24 '24 20:06 osiewicz

Yes, that

monarcode avatar Jun 24 '24 20:06 monarcode

Any way to fix that? @osiewicz

monarcode avatar Jun 26 '24 01:06 monarcode

No, I'm sorry, I haven't looked into it yet. A wild guess is that formatting gets applied to completions automatically, which may not be desired for snippets. If so, we should add a way for a language server to opt out of automatic formatting

osiewicz avatar Jun 26 '24 09:06 osiewicz

Any movement on this? I'm on Zed 0.143.7, with the extension and tags aren't closing.

https://github.com/user-attachments/assets/0b0ce348-448f-4032-b7ac-6fb9beb6caee

tpolito avatar Jul 14 '24 17:07 tpolito

Any news on this?

feldrok avatar Aug 10 '24 01:08 feldrok

Just switched over to zed, I primarily work in Next.JS so a lot of TSX files. Any update on if this is being fixed soon?

MK732 avatar Aug 20 '24 02:08 MK732