From edd9123d241b5de3e6ee08da86f6fccd7a6097d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=83=81=ED=98=84?= <84452145+arch-spatula@users.noreply.github.com> Date: Sat, 27 Jul 2024 11:58:32 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EB=AA=A8=EB=85=B8=EB=A0=88=ED=8F=AC?= =?UTF-8?q?=20=ED=99=98=EA=B2=BD=EC=86=8D=20vue-lsp=20#77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/plugins/lsp.lua | 60 +++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 77e172b..d6163f2 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -83,54 +83,34 @@ return { -- JS & TS - local secret = os.getenv("VUE_LSP_PATH") - -- WARN: Version 2 stop working with nvim lsp - -- https://github.com/vuejs/language-tools/issues/3925 - -- https://github.com/williamboman/mason-lspconfig.nvim/issues/371#issuecomment-1988153959 - -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#volar - -- npm install -g @vue/language-server # vue lsp를 전역으로 설치 - -- npm list -g # 이 명령으로 설치된 경로를 알아낼 수 있음 - -- .zshrc, bash, posh rc 파일에 설치한 @vue/language-server의 경로를 VUE_LSP_PATH에 설정할 것. - -- VUE_LSP_PATH="명령으로_알아낸_설치_경로/node_modules/@vue/language-server" - -- 모든 해결책이 소용없다면 다음 명령 활용 - -- :MasonInstall vue-language-server@1.8.27 - -- TODO: 모노레포에서 VUE_LSP_PATH 활용가능하게 설정하기 - if secret == nil then - print("VUE LSP PATH not set") - lspconfig.tsserver.setup({ - capabilities = capabilities, - }) - else - lspconfig.tsserver.setup({ - init_options = { - plugins = { - { - name = "@vue/typescript-plugin", - location = secret, - languages = { - "typescript", - "javascript", - "vue", - }, - }, + -- NOTE: 공식 문서 내용 + -- https://github.com/vuejs/language-tools?tab=readme-ov-file#community-integration + -- If you are using mason.nvim, you can get the ts_plugin_path like this + local mason_registry = require("mason-registry") + local vue_language_server_path = mason_registry.get_package("vue-language-server"):get_install_path() + .. "/node_modules/@vue/language-server" + + lspconfig.tsserver.setup({ + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = vue_language_server_path, + languages = { "vue" }, }, }, - filetypes = { - "javascript", - "typescript", - "vue", - }, - capabilities = capabilities, - }) - end - - lspconfig.marksman.setup({ + }, + filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" }, capabilities = capabilities, }) lspconfig.volar.setup({ capabilities = capabilities, }) + lspconfig.marksman.setup({ + capabilities = capabilities, + }) + -- Go lspconfig.gopls.setup({ capabilities = capabilities, From ec8e1938210d9c90dc2539ed0e90535f57e76d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=83=81=ED=98=84?= <84452145+arch-spatula@users.noreply.github.com> Date: Thu, 8 Aug 2024 21:36:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=9C=A0=EC=A7=80=EB=B3=B4=EC=88=98?= =?UTF-8?q?=20=EC=95=88=20=ED=95=98=EB=8A=94=20gospel=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=20#77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/plugins/lsp.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index d6163f2..897b331 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -22,7 +22,6 @@ return { "spell", "codespell", "prettierd", - "gospel", --"gofumpt", --"biome", "pylint", From d07dc574aa44129ee654f78893607d0aedf4bf88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=83=81=ED=98=84?= <84452145+arch-spatula@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:36:27 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=ED=83=9C=EA=B7=B8=20=EB=8B=AB?= =?UTF-8?q?=EA=B8=B0=EC=97=90=20=EC=9E=90=EB=8F=99=EC=99=84=EC=84=B1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20#48?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/plugins/autocomplete.lua | 48 ++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/lua/plugins/autocomplete.lua b/lua/plugins/autocomplete.lua index e5dca30..3783fd1 100644 --- a/lua/plugins/autocomplete.lua +++ b/lua/plugins/autocomplete.lua @@ -1,28 +1,27 @@ return { -- NOTE: cmp-path, - { - "hrsh7th/cmp-nvim-lsp" + "hrsh7th/cmp-nvim-lsp", }, { "L3MON4D3/LuaSnip", dependencies = { - 'saadparwaiz1/cmp_luasnip', - 'rafamadriz/friendly-snippets' - } + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, }, { "hrsh7th/nvim-cmp", config = function() -- Set up nvim-cmp. - local cmp = require 'cmp' + local cmp = require("cmp") require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) - require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. end, }, window = { @@ -30,19 +29,32 @@ return { documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, -- For luasnip users. + { name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. }, { - { name = 'buffer' }, - }) + { name = "buffer" }, + }), }) - end - } + end, + }, + { + "windwp/nvim-ts-autotag", + ft = { + "vue", + "javascript", + "typescript", + "jsx", + "tsx", + }, + config = function() + require("nvim-ts-autotag").setup() + end, + }, }