Supplementary LSP that extracts <script> sections from HTML files and
forwards TypeScript/JavaScript requests to typescript-language-server.
Currently neither Nvim nor Zed support inline javascript.
There is probably a better way of doing this but so far this method was the easiest and fastest.
-
Install dependencies:
npm install
-
Start the server as the LSP command for your editor.
2.1. nvim
lspconfigsnippet:require('lspconfig').inline_ts_ls = { default_config = { cmd = { 'node', '/path/to/inline-ts-lsp/src/server.js' }, filetypes = { 'html' }, root_dir = function() return vim.loop.cwd() end, } } require('lspconfig').inline_ts_ls.setup({})
2.2. Zed:
TODO - link zed extension