From 2583aa5ac262e1d280a14cba132630df40fac645 Mon Sep 17 00:00:00 2001 From: Emiliano Deustua Date: Thu, 26 Dec 2024 16:22:00 -0500 Subject: [PATCH 1/2] feat: cue language server --- lua/lspconfig/configs/cue.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lua/lspconfig/configs/cue.lua diff --git a/lua/lspconfig/configs/cue.lua b/lua/lspconfig/configs/cue.lua new file mode 100644 index 0000000000..cf9d98953a --- /dev/null +++ b/lua/lspconfig/configs/cue.lua @@ -0,0 +1,24 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'cue.mod', + '.git', +} + +return { + default_config = { + cmd = { 'cue', 'lsp' }, + filetypes = { 'cue' }, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/cue-lang/cue + +CUE makes it easy to validate data, write schemas, and ensure configurations align with policies. +]], + }, +} From 04e63d41166692ba0600299550ea6249fe2fb96e Mon Sep 17 00:00:00 2001 From: glepnir Date: Sun, 29 Dec 2024 10:25:36 +0800 Subject: [PATCH 2/2] fixup! --- lua/lspconfig/configs/cue.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/lspconfig/configs/cue.lua b/lua/lspconfig/configs/cue.lua index cf9d98953a..05ae06fc67 100644 --- a/lua/lspconfig/configs/cue.lua +++ b/lua/lspconfig/configs/cue.lua @@ -1,16 +1,11 @@ local util = require 'lspconfig.util' -local root_files = { - 'cue.mod', - '.git', -} - return { default_config = { cmd = { 'cue', 'lsp' }, filetypes = { 'cue' }, root_dir = function(fname) - return util.root_pattern(unpack(root_files))(fname) + return util.root_pattern(unpack({ 'cue.mod', '.git' }))(fname) end, single_file_support = true, },