3 ms·
This looks awesome but I don’t really understand the complexities that mean this is new in late 2024 and wasn’t one of the first LSPs implemented? Can someone e
by petesergeant 2y ago
This looks awesome but I don’t really understand the complexities that mean this is new in late 2024 and wasn’t one of the first LSPs implemented? Can someone explain?
- smaudet 2y agoxml != html so you can't just plug an xml parser and a schema together and call it quits. Plus, there's things like browser support, relative paths, and content embedding to consider, which always made dedicated products like Adobe's (Macromedia's?) DreamWeaver hit-or-miss (on top of being a very clunky way to edit some tiny text files). As for why it took so long...well nobody cared enough, and everyone "just used scripts" i.e. Django, Wordpress, Ruby on Rails, etc, to get that "good enough" experience + access to testing. There's no reason this couldn't have been done back in 2014 when LSPs were first just starting to come into being...
- rozab 2y agoThere is an LSP from Microsoft, it just doesn't report this sort of syntax error (presumably for the sake of people doing templating etc)
- Semaphor 2y ago> doesn't report this sort of syntax error It’s because it’s not a syntax error, but a legal construct. SuperHTML disallows things HTML allows.
- OtomotO 2y agoSo it should be called SubHTML instead?!
- kristoff_it 2y agoI've never seen the language server that ships with VSCode produce any kind of diagnostic whatsoever, so I think it just doesn't implement any error checking.
- Semaphor 2y agoThis is not HTML. This is HTML, but without allowing all kinds of shortcuts. In HTML, <li>item<li> is correct (it gets parsed as <li>item</li><li></li> I think). In SuperHTML it throws an error. Essentially, this is an opinionated subset of HTML, and no one cared enough before.
- afavour 2y ago…so it’s XHTML?
- taeric 2y agoCan seem similar, but realize that the parsing rules for HTML are far more complicated than you'd think from this simple example. It is the idea of when tags are automatically closed that is odd, here. Consider how `<li><div>Hello<li>world. How <div/>Does this</li> work?` gets turned into elements. The common trap many run into is that `<div/>` essentially closes at the next boundary.
- smaudet 2y agoNot sure why I got down-voted on my other reply, but basically this. XML != HTML, not sure what is controversial to say about that.
- kristoff_it 2y agoIt's not just that, I've never seen any other HTML language server produce diagnostics at all. All the major editors use the VSCode stock HTML language server and that thing just doesn't produce any diagnostic at all.
- Semaphor 2y agoHuh. Wow. I don’t normally use VSCode, and you are correct. JetBrain IDEs correctly report some nonsense like <p><div><img></ul>test</p> as an error, but VSCode does nothing. That’s really weird.
- IshKebab 2y agoNot many people write HTML by hand and I guess nobody bothered. I don't think there's a secret reason but you do need someone to actually do it and nobody bothered until now. Where's the Makefile LSP server? (Ok technically there is one but it barely does anything.)