From b8d5ba68a023356b84e1969450bc16b9829e45c1 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:07:18 +0100 Subject: [PATCH] chore: comment explaining use of root_dir to selectively attach LSP --- lua/lspconfig/configs/gh_actions_ls.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lspconfig/configs/gh_actions_ls.lua b/lua/lspconfig/configs/gh_actions_ls.lua index d7c1491f61..8fdac7b8d3 100644 --- a/lua/lspconfig/configs/gh_actions_ls.lua +++ b/lua/lspconfig/configs/gh_actions_ls.lua @@ -4,10 +4,15 @@ return { default_config = { cmd = { 'gh-actions-language-server', '--stdio' }, filetypes = { 'yaml' }, + + -- Only attach to yaml files that are GitHub workflows instead of all yaml + -- files. (A nil root_dir and no single_file_support results in the LSP not + -- attaching.) For details, see #3558 root_dir = function(filename) return filename:find('/%.github/workflows/.+%.ya?ml') and util.root_pattern('.github') or nil end, single_file_support = false, + capabilities = { workspace = { didChangeWorkspaceFolders = {