-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
SCM: Support input box spell checking #35571
Comments
This could be interesting: https://github.com/electron-userland/electron-spellchecker |
This would be a very valuable feature, there is nothing worse than creating a spelling mistake in a commit and discovering many commits later. |
@joaomoreno , Working on this and using https://github.com/electron-userland/electron-spellchecker as suggested. |
@joaomoreno , I tried various ways of using that module but keep getting an error("Activating extension 'vscode.git' failed: Cannot find module 'electron-spellchecker'.), can you please share any example of how to install and use an external module like electron-spellchecker? |
Is that module special? Does it need to run in Electron itself? Note that extensions do not run in Electron, but in an extension host. |
@joaomoreno , I got the point that extensions run in extensions host, is there any way to install and use this module there ? |
That's a very good indication that this will not work. I suggest to pick another issue to work on. 👍 I'll remove the |
@joaomoreno Could you maybe provide some "on changed" callback API call with the content of the edit box which e.g. a spell checking extension (like Spell Right of mine) could service? And another "diagnostics" type to provide suggestions? |
That would be awesome, I use Spell Right all the time. |
@joaomoreno , There is already a validateInput function that validates the input in many ways( e.g commitMessageWhitespacesOnlyWarning in https://github.com/Microsoft/vscode/blob/master/extensions/git/src/repository.ts#L658 ) . |
@skprabhanjan I was about to suggest we try that. Git now exposes a rich API. We could open that API to let extensions register additional input validators. |
@joaomoreno , I will try with that but I have a small doubt, |
We need to expose new Git extension API: one which lets other extensions register input validators. Though this is not the end, since you'd want the input box to render spell checking warnings/errors inline with the content, which the current widget does not support. I keep my suggestion to pick another issue to work on. Sorry about that. |
@joaomoreno , Okay I will look into how to achieve that. |
@joaomoreno But it seems half way though: There needs to be some way to correct spelling (underline, right click menu etc.) |
Any updates? |
Is there any way to open a new editor tab the way Sublime Text does and use that for the commit message? |
As a workaround you can open a new file, paste/write the commit message in there and copy it back into the commit afterwords. |
Glad to hear that things are working as expected. Most of the credit goes to @JohnnyCrazy who contributed the new flow to use the full text editor as the commit message editor. In July I will take a look to see if there is a way to expose the document of the SCM input box to extensions to enable spell checking there as well. I will keep this issue updated with my progress. |
If anyone else here wants to see Markdown preview support for the new commit message using an editor feature then please upvote #154392. Thanks! |
@lszomoru, I tried to click commit button without a commit message but I get a Bad status code 500 error, is there a setting which I need to enable first? |
@urenajose, you are hitting an issue that is currently being tracked as #154449 |
Probably you didn't set user name and password for git. |
After talking to the team today, as it turns out, extensions already have access to the text document that is associated with the SCM input field which enables extension authors to implement spell check for the SCM input field. The text document is in the Today I have submitted a pull request to the Spell Right extension, and next I will be looking at the Code Spell Checker extension and will probably reach out to the extension author either with a pull request or with the exact steps that they need to make to their extension. As soon as diagnostic information is emitted to the text document that is associated with the SCM input field, there are some "papercuts" that I need to address in the "Problems View": 1) the file name associated with the problem should have the repository name, 2) clicking on a problem should focus the SCM input field. |
I have also submitted a pull request to the Code Spell Checker extension. The changes to that extension as minimal since all it has to do is remove |
The author of the Code Spell Checker extension published an update ( "cSpell.allowedSchemas": ["file", "gist", "sftp", "untitled", "vscode-notebook-cell", "vscode-userdata", "vscode"],
"cSpell.enabledLanguageIds": ["scminput"], |
It is better to use:
Because of limitations in the way VS Code merges settings, lists are overwritten instead of merged. So, setting |
Related to [SCM: Support input box spell checking · Issue #35571 · microsoft/vscode](microsoft/vscode#35571)
I'll turn it on by default, but it does generate an error when trying to fix any issues. I'll take a look if it is anything on the extension side of things. |
Related to [SCM: Support input box spell checking · Issue #35571 · microsoft/vscode](microsoft/vscode#35571)
Today's Insiders release (2022-070-26) contains a change so that we adopt a dedicated scheme, "cSpell.allowedSchemas": ["file", "gist", "sftp", "untitled", "vscode-notebook-cell", "vscode-userdata", "vscode-scm"],
"cSpell.enableFiletypes": ["scminput"], @Jason3S, with this change, you can add the |
@lszomoru, I'll update Code Spell Checker. |
See: [SCM: Support input box spell checking · Issue #35571 · microsoft/vscode](microsoft/vscode#35571 (comment))
See: [SCM: Support input box spell checking · Issue #35571 · microsoft/vscode](microsoft/vscode#35571 (comment))
A recent change to VS Code changed the scheme used for the SCM input from `vscode` to `vscode-scm`. Recognize either scheme as that of the SCM input. See: microsoft/vscode#35571 (comment)
A recent change to VS Code changed the scheme used for the SCM input from `vscode` to `vscode-scm`. Recognize either scheme as that of the SCM input. See: microsoft/vscode#35571 (comment)
For longer commit messages it would be great to have a spell checker there. Ideally, VSCode would provide that out of the box but if the direction is to leave spell checking up to extensions (and there are already some great ones out there, like Spell Right by @bartosz-antosik), there could be an API for that.
Possibly related: Offline spell checker for VSCode #20266
UPDATE: since 2020, Electron supports spell checking natively, see below.
The text was updated successfully, but these errors were encountered: