Skip to content

LSP not activating in Deno Node Compatible projects #4216

@VioletWoodETL

Description

@VioletWoodETL

Description

Neovim version: v0.11.5

Noticed in downstream @ LazyVim/LazyVim#6816

It is common, for example in a Tauri project running Deno, to have a Deno project with a package.json and a deno.lock without a deno.json. See https://docs.deno.com/runtime/fundamentals/node/#first-class-package.json-support. However, after this change, a Deno project set up this way will no longer have LSP support.

Reproduction script using lazy.nvim repro tools. This creates a typical LazyVim setup that has vtsls and denols enabled:

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    { "LazyVim/LazyVim", import = "lazyvim.plugins.extras.lang.typescript" },
    {
      "neovim/nvim-lspconfig",
      commit = "b34fbdf",
      opts = {
        servers = {
          -- as an example, this is also applicable for other non-Deno LSPs that technically work.
          vtsls = {
            enabled = true,
          },
          denols = {
            enabled = true,
          },
        },
      },
    },
  },
})

Running this and trying to edit Typescript or Javascript in a repo with package.json and deno.lock, without a deno.json, will result in no LSPs being triggered.

An open question here to address this regression is which LSP should be activated in this situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions