codemirror6-plugin icon indicating copy to clipboard operation
codemirror6-plugin copied to clipboard

HTML should not suggest invalid tags

Open bradymadden97 opened this issue 2 years ago • 3 comments

See below video for examples. The plugin currently suggests invalid HTML tags, and seems to just match any given string. In VSCode, it does not do this. It only suggests Emmet Autocomplete when there is a valid HTML tag.

CodeMirror:

https://user-images.githubusercontent.com/16962017/220470127-cc4d4622-7a51-482d-ba59-5223c1efc9c3.mov

VSCode:

https://user-images.githubusercontent.com/16962017/220470095-6ca78751-b4a3-4962-b01f-d19633e1f380.mov

bradymadden97 avatar Feb 21 '23 22:02 bradymadden97

In terms of Emmet, there's no such thing as valid/invalid HTML tag. It can expand any word into tag, which could be custom XML or component tag in Vue/Angular/Svelte/JSX.

That's why it doesn't suggest anything as autocomplete in CM6, it only adds subtle hint that given word can be expanded. You can disable this hint or change it with CSS

sergeche avatar Feb 21 '23 22:02 sergeche

That makes sense, but is there a reason VSCode behaves differently?

The CM plugin API doesn't seem to allow us to see potential expansions and perform further filtering to only display UI elements when those suggestions make sense.

bradymadden97 avatar Feb 21 '23 22:02 bradymadden97

VSCode has it’s own implementation of Emmet UX, which is not not exactly as it expected to work.

And I’m not sure what you mean by potential expansions and UI filtering

sergeche avatar Feb 22 '23 08:02 sergeche