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

Not working in Git COMMIT_EDITMSG #346

Closed
nrser opened this issue May 24, 2019 · 5 comments
Closed

Not working in Git COMMIT_EDITMSG #346

nrser opened this issue May 24, 2019 · 5 comments
Labels

Comments

@nrser
Copy link

nrser commented May 24, 2019

TL;DR

Extensions isn't working in the COMMIT_EDITMSG document that pops up when you have VSCode set as your Git editor and run git commit.

I've got git-commit listed in cSpell.enabledLanguageIds array, and have snippets working in it so I don't think I got the language ID wrong.

Any ideas?


Details

It seems pretty well established that VSCode users want am editing experience in the built-in Git commit input area better on par with the rest of the app, including spell checking support (#109).

In the meantime, I'm trying out the old-school git commit with VSCode setup as my $EDITOR so it opens a full document, like so:

Screenshot 2019-05-25 05 13 40

One of the features I was hopping to achieve most is spell checking (extension's been great BTW, thanks). However, as you can see from the screen shot, the extension does not appear to be picking it up.

My settings.json includes:

"cSpell.enabledLanguageIds": [
    "asciidoc",
    "c",
    "cpp",
    "crystal",
    "csharp",
    "css",
    "feature",
    "git-commit", // Don't seem to work..?
    "go",
    "handlebars",
    "html",
    "ignore",
    "jade",
    "javascript",
    "javascriptreact",
    "json",
    "jsonc",
    "latex",
    "less",
    "markdown",
    "php",
    "plaintext",
    "pub",
    "python",
    "restructuredtext",
    "ruby",
    "rust",
    "scss",
    "text",
    "typescript",
    "typescriptreact",
    "yaml",
    "yml"
]

The git-commit language ID has worked fine for snippets, which makes me feel like it's correct.

These commit message files live at <PROJECT>/.git/COMMIT_EDITMSG, which is ignored in the project as part of the .git directory, so maybe that has something to do with it?

I also see from #109 that there are path-based exclude filters on the spell check server, but neither any of the patterns listed there or where they seems to have moved in the current source

const defaultExclude: Glob[] = [

look like they would apply to the commit message files.

Solutions or suggestions much appreciated, thanks. If a change is needed I can see if I can find some time to take a swing, but time honestly is my most scarce resource at the moment.

@Jason3S
Copy link
Collaborator

Jason3S commented May 26, 2019

It is possible to enable the spell checker:
In VS Code settings:

    "cSpell.ignorePaths": [
        "**/node_modules/**",
        "**/package-lock.json",
        "**/vscode-extension/**",
        "**/.git/**",   // <-- Remove this line
        ".vscode"
    ],

image

Note: if you have a cspell.json file in your project root or under .vscode, you might need to change that file as well.

@Jason3S Jason3S added the FAQ label May 26, 2019
@Jason3S Jason3S closed this as completed May 27, 2019
@vegerot
Copy link

vegerot commented Dec 21, 2020

It looks like the comment (#346 (comment)) by @Jason3S should no longer be necessary as of f940193

@vegerot
Copy link

vegerot commented Dec 21, 2020

However, the issue still persists for me

@wijon
Copy link

wijon commented Sep 17, 2021

@vegerot I had the same issue. I solved it by setting the option cSpell.spellCheckOnlyWorkspaceFiles to false. Now spell checking is working inside the COMMIT_EDITMSG document.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants