Skip to content

Action "Extract into new dumb component" does not work with non-Vscode editors #3811

Closed
@vanarok

Description

@vanarok

vue language-server 1.8.25
typescript 5.2.2

Helix editor:

2023-12-12T18:43:27.068 helix_lsp::transport [ERROR] volar <- InternalError: Request codeAction/resolve failed with message: Cannot read properties of undefined (reading 'html')
2023-12-12T18:43:27.069 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(29)), original request likely timed out

Helix config:

[[language]]
name = "vue"
file-types = ['vue']
roots = ["package.json", "vite.config.js"]
injection-regex = "vue"
scope = "source.vue"
language-servers = [{ name = "vuels", except-features = ["format"] }]
indent = { tab-width = 2, unit = "  " }
auto-format = true

[[grammar]]
name = "vue"
source = { git = "https://github.com/ikatyang/tree-sitter-vue", rev = "91fe2754796cd8fba5f229505a23fa08f3546c06" }

[language-server.vuels]
command = "vue-language-server"
args = ["--stdio"]

[language-server.vuels.config.typescript]
tsdk = "/data/data/com.termux/files/home/.local/share/pnpm/global/5/node_modules/typescript/lib"

[language-server.vuels.config.languageFeatures]
semanticTokens = true
references = true
definition = true
typeDefinition = true
callHierarchy = true
hover = true
rename = true
renameFileRefactoring = true
signatureHelp = true
codeAction = true
completion = { defaultTagNameCase = 'both', defaultAttrNameCase = 'kebabCase' }
schemaRequestService = true
documentHighlight = true
documentLink = true
codeLens = true
diagnostics = true
takeOverMode = true

[language-server.vuels.config.documentFeatures]
documentColor = false
selectionRange = true
foldingRange = true
linkedEditingRange = true
documentSymbol = true
documentFormatting = { defaultPrintWidth = 100 }

Neovim editor:
Screenshot_20231220-121420_Termux

Neovim config:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	{ "neovim/nvim-lspconfig" },
})

vim.g.mapleader = " " 

local map = vim.api.nvim_set_keymap
local defaults = { noremap = true, silent = true }
map("i", "zr", "<esc>l", defaults)

vim.bo.shiftwidth = 3
vim.bo.tabstop = 3

-- Setup language servers.
local lspconfig = require('lspconfig')
lspconfig.volar.setup {
	filetypes = { 'typescript', 'javascript', 'vue' },
  init_options = {
		typescript = {
			tsdk = '/data/data/com.termux/files/home/.local/share/pnpm/global/5/node_modules/typescript/lib',
		}
	}
}


-- Global mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)

-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
  group = vim.api.nvim_create_augroup('UserLspConfig', {}),
  callback = function(ev)
    -- Enable completion triggered by <c-x><c-o>
    vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'

    -- Buffer local mappings.
    -- See `:help vim.lsp.*` for documentation on any of the below functions
    local opts = { buffer = ev.buf }
    vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
    vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
    vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
    vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
    vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
    vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
    vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
    vim.keymap.set('n', '<space>wl', function()
      print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
    end, opts)
    vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
    vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
    vim.keymap.set({ 'n', 'v' }, '<space>a', vim.lsp.buf.code_action, opts)
    vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
    vim.keymap.set('n', '<space>f', function()
      vim.lsp.buf.format { async = true }
    end, opts)
  end,
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood reproduction ✨This issue provides a good reproduction, we will be able to investigate it first

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions