Skip to content

Conversation

@chrisgrieser
Copy link
Contributor

cc @disrupted

This saves the user the extra setup work of copypasting the vim.filetype.add snippet, making this language server work out of the box.

Follow-up to #3551, on this suggestion: https://github.com/neovim/nvim-lspconfig/pull/3551/files#r1912833011

@chrisgrieser chrisgrieser requested a review from glepnir as a code owner January 13, 2025 10:02
This saves the user the extra setup work of copypasting the
`vim.filetype.add` snippet, making this language server work out of the
box.

Implementation of this suggestion:
https://github.com/neovim/nvim-lspconfig/pull/3551/files#r1912833011
@disrupted
Copy link
Contributor

I agree that this is probably a sensible default and less manual maintenance for users. Although personally, I am not a fan of the runtime check and will likely continue using the special filetype as it keeps things tidier.
We should also decide on a common strategy. gitlab_ci_ls is a very similar candidate

Co-authored-by: glepnir <glephunter@gmail.com>
@justinmk
Copy link
Member

justinmk commented Jan 13, 2025

We should also decide on a common strategy. gitlab_ci_ls is a very similar candidate

Agreed. I have never seen a .github file on any project I'm familiar with, so the runtime check is probably the right approach.

@disrupted
Copy link
Contributor

disrupted commented Jan 13, 2025

I have never seen a .github file on any project I'm familiar with, so the runtime check is probably the right approach.

d'oh. That was meant for the .github folder that contains workflows etc. I believe the root pattern function works on folders as well as files, does it not?

@justinmk
Copy link
Member

That was meant for the .github folder that contains workflows etc. I believe the root pattern function works on folders as well as files, does it not?

Oh sorry I saw yaml.github in #3551 (comment) and didn't look closely enough. I see now that it's only defining a filetype with that name.

In any case, avoiding the need for users to manually call vim.filetype.add() in their configs, is worthwhile. However it may require the single_file_support=false trick as mentioned in this PR.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
@justinmk justinmk merged commit 0c24b48 into neovim:master Jan 13, 2025
11 checks passed
@chrisgrieser chrisgrieser deleted the dev branch January 13, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants