Skip to content
This repository was archived by the owner on Aug 12, 2023. It is now read-only.
This repository was archived by the owner on Aug 12, 2023. It is now read-only.

Keep explicit support for non-lspconfig setup #58

@marcelbeumer

Description

@marcelbeumer

Hi @jose-elias-alvarez, thanks for your work on typescript.nvim (and nvim-lsp-ts-utils before)!

I have a feature request.

I'm not using lspconfig. Instead I do vim.lsp.start inside a FileType autocommand myself (https://github.com/marcelbeumer/nvim-config/blob/e449f80d1e1a4e92ab4008d6ec392a9fe4345c29/lua/conf/lsp/server/tsserver.lua).

By reading through the source I've managed to using typescript.nvim by doing the same as your lsp.lua does:

-- once
require("typescript/config").setupConfig({})

vim.api.nvim_create_autocmd("FileType", {
-- ...
      vim.lsp.start({
        -- ...
        handlers = vim.tbl_extend("force", util.get_handlers(), {
          ["_typescript.rename"] = require("typescript/handlers").renameHandler,
        }),
        -- ..
        on_attach = function(client, bufnr)
          -- ...

          if not require("typescript/config").config.disable_commands then
            require("typescript/commands").setupCommands(bufnr)
          end
        end,

This seems to work fine but of course the risk is that things break later as I'm poking in typescript.nvim internals.

Would it be possible to keep explicit support for such a non-lspconfig setup, by adding instructions to the README, and then making sure things keep working? And in case of breaking changes update the README and preferably mark commit as breaking change?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions