Skip to content

hyperstown/inline-ts-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inline-ts-lsp

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.

Quick start

  1. Install dependencies:

    npm install
  2. Start the server as the LSP command for your editor.

    2.1. nvim lspconfig snippet:

    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

About

Provides TypeScript LSP features for inline scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors