Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gitcommit files support #132

Closed
vigoux opened this issue Dec 8, 2021 · 6 comments
Closed

Add gitcommit files support #132

vigoux opened this issue Dec 8, 2021 · 6 comments
Assignees
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Milestone

Comments

@vigoux
Copy link

vigoux commented Dec 8, 2021

Hi and thanks for this awesome tool and your work ! This is a really handy tool !

Is your feature request related to a problem? Please describe.

When I edit my commit message, I like to have the things I write grammar-checked, and I'd like to use ltex-ls for that.

Describe the solution you'd like

There is actually two solutions:

  1. Add a gitcommit filetype, that ignores comments in the file (starting with #)
  2. Add the ability to create custom filetypes, with something like regexes to "parse" them.

Describe alternatives you've considered

I tried using the plaintext version, but it is not that great.

Additional context

Not sure if that applies here.

@vigoux vigoux added the 1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature label Dec 8, 2021
@valentjn
Copy link
Owner

valentjn commented Dec 8, 2021

Thanks for the suggestion. Regarding the suggested solutions:

  1. Which language ID(s) should this be mapped to (depends on your editor/language client)? VS Code apparently uses git-commit.
  2. I doubt that a regex would be really useful for the general case. Most languages cannot be expressed with a mere regex.

@vigoux
Copy link
Author

vigoux commented Dec 8, 2021 via email

@valentjn valentjn self-assigned this Dec 8, 2021
@valentjn valentjn added the 3-fixed Issue resolution: Issue has been fixed on the develop branch label Dec 12, 2021
@github-actions
Copy link

This issue is now fixed on develop. The fix will be included in the next release of LTEX.

If you don't want to wait, you can try out the nightly pre-release tomorrow. Nightly pre-releases are published every morning at around 4am UTC.

@valentjn valentjn added this to the 15.3.0 milestone Dec 12, 2021
@valentjn
Copy link
Owner

valentjn commented Dec 12, 2021

This is implemented now.

While LTEX LS will support both git-commit and gitcommit (in the sense that it will parse documents as Git commits when provided with one of these two LSP language IDs), the default value of ltex.enabled will only contain git-commit. The reason is that the LSP spec recommends git-commit, and IMO all servers and clients should follow the recommendations of the spec (Neovim struggles a bit there, at least with the LSP language IDs). This means that on Neovim, this feature will only work if the default of ltex.enabled is changed or if the filetype is mapped to git-commit.

@mjlbach
Copy link

mjlbach commented Dec 13, 2021

Neovim struggles a bit there, at least with the LSP language IDs

I don't think we have any issues with this? We just add the custom mapping per server in the lspconfig plugin. I can add it for git-commit no problem.

@valentjn
Copy link
Owner

@mjlbach That's what I meant with ”if the filetype is mapped to git-commit.“ Not sure if possible, but Neovim should use the LSP language IDs listed in the LSP spec by default for all servers, without having to add the relevant ones to a mapping for each server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature-request ✨ Issue type: Request for a desirable, nice-to-have feature 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
Status: 🎉 Done
Development

No branches or pull requests

3 participants