Skip to content

Commit

Permalink
chore: comment explaining use of root_dir to selectively attach LSP
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jan 13, 2025
1 parent bb67599 commit b8d5ba6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/lspconfig/configs/gh_actions_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit b8d5ba6

Please sign in to comment.