Hacker News new | ask | show | jobs
by petrzjunior 1091 days ago
JetBrains's IntelliJ and friends do that with language plugins. They detect the language according to keywords and patterns and are able to do highlighting and intellisense for multiple languages in a single file. I have not tried this with LSP though, because LSP support landed just in the last version.
2 comments

Yeah, (neo)vim can do that for non-lsp with a filetype like html.css or similar whichbloads both syntax rules possibly with customizations to determine when it switches into which of the two modes. But again, I don’t know how that works with lsp.
In Intellij you can connect to the DB and get autocomplete in SQL strings.