Code Monkey home page Code Monkey logo

vscode-spellright's Introduction

Multilingual, Offline and Lightweight Spellchecker for Visual Studio Code

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating The MIT License

Features

  • Spells plain text/markdown/LaTeX documents, comments/strings parts of most source code (C++, C, Python, JavaScript, Batch, ..., D, Julia etc.) documents and text/comment nodes on XML/HTML class documents.
  • Supports every language that can be used with either of the below mentioned native spelling engines (e.g. all languages that are available in Microsoft Office, see here, multiple languages in Windows Single Language editions, like here etc.)
  • Supports use of multiple workspace plaintext file dictionaries which may be used for specialized vocabularies like medical terms, trademark names etc.
  • Spelling documents' syntactic elements e.g. comments/strings in different languages (e.g. strings spelled in English and comments spelled in French).
  • Spelling of multiple languages in one document either by selecting more than one language for spelling or using In-Document commands to switch between languages.
  • Case sensitive which means that it will distinguish between english and English, french and French and which is critical in some western languages like e.g. German.
  • Spells, among others, short words, abbreviations, contractions (I, I'm, I'll, i.e., doesn't, etc.) and parenthetical plurals (word(s), process(es), etc.)
  • Spells CamelCase, snake_case and digit2inside compound phrases respecting Unicode capital/small letters distinction (e.g.: SuperŚlimak is spelled as Super Ślimak) and capital letter adhesion (e.g.: HTMLTest is spelled as HTML Test).
  • Unobtrusive GUI/command interface for switching spelling dictionary (language) and turning spelling ON/OFF for particular document class.
  • In-Document commands allow to switch spelling ON or OFF despite global settings and change spelling language multiple times within the document.
  • Small memory & CPU usage footprint - uses offline, OS native spell checking backends: Windows Spell Checking API (windows 8/10), NSSpellChecker (macOS) and Hunspell (Linux, Windows 7).
  • Extension uses background processing (on idle) and differential edit notifications to minimize area spelled during editing only to lines touched by changes.

Installation

Search for Spell Right from the extension installer within VSCode or execute below line in the command palette (F1 or Ctrl+Shift+P):

ext install ban.spellright

Spell Right requires spelling back-end which is different for various platforms. Please read carefully the section below on how to provide dictionaries for Spell Right to work properly.

If you have any problem with installation or you see that Spell Right does not work with some type of document please read carefully the lengthy README file below and if nothing seems to be related to the problems you face post an issue here.

Dictionaries

Windows 8+

On Microsoft Windows from version 8 on Spell Right uses system spelling API. Follow system guidelines, like here or here, on how to install additional system spelling dictionaries.

macOS

On macOS Spell Right uses system spelling API.

Linux and Windows 7

On Linux/ and Windows 7 Spell Right uses built in Hunspell spell checker library. To use it a pair of Dictionary (*.dic) and Affixes (*.aff) files with UTF-8 encoding have to be downloaded (remember to download RAW files) e.g. from here (multiple languages), here (Portuguese) or here (French) and placed in Dictionaries subfolder of VSCode's user global configuration directory, located at:

  • Windows: %APPDATA%\Code\Dictionaries\
  • Linux: $HOME/.config/Code/Dictionaries/

Dictionaries subfolder does not exists there by default and has to be created manually.

In case you run Insiders edition of VSCode then Code part of the path has to be changed to Code - Insiders appropriately.

Spell Right cannot automatically match the dictionary name with system locale settings when using Hunspell dictionaries hence at first run dictionary has to be selected manually (e.g from status bar).

On most Linux distributions system-wide dictionaries can be reused (for now only UTF-8 encoded dictionaries are supported, verify SET line in *.aff file) by soft linking the system folder e.g.:

ln -s /usr/share/hunspell/* ~/.config/Code/Dictionaries

The location may vary among distributions (e.g.: on Fedora Linux it is /usr/share/myspell etc.) It also has been suggested that some flavors of Linux require that the dictionary name should not contain spaces and/or parentheses.

Dictionaries from the folder will be listed in the language selection list and used for spelling documents. Because Hunspell engine is slower in serving suggestions to misspelled words it may be useful to set spellright.suggestionsInHints to false which will speed spelling up and suggestions will still be available in context menu called upon action for the suggestion.

WSL/Remote/GitHub Repositories

While editing WSL/Remote/GitHub files (Remote SSH/Remote-WSL) SpellRight should use host dictionaries so all the above should apply.

User Dictionaries

Spell Right stores words considered as spelled correctly and not existing in the main spelling engine (a.k.a. ignored words) in plaintext dictionary files. All the extension's commands add words to two main files, user and workspace dictionaries, both contained in spellright.dict files, one located in user settings folder and the other in workspace settings folder (.vscode). Besides these there can be any number of *.dict files in workspace settings folder e.g. dictionaries containing specialized vocabularies like medical terms, trademark names etc. User dictionary is always used and workspace dictionaries are used in the context of opened folder. All provided dictionaries are used in conjunction.

Symbols in Source Code Documents

When spelling source code class of document which provides symbol information for the document (e.g. the symbols which are used when Ctrl+Shift+O is pressed to perform GoTo symbol operation) the symbols are used for spelling of the document. It reduces the number of false spelling warnings mostly in comments which provide source code documentation on the usage of these symbols, e.g. variables, function parameters etc.

Screenshots

Documents

Spelling of plain text/markdown/LaTeX documents:

screenshot

Source Code & Markup Documents

It can spell strings/comments parts of most source code (C++, Python, JavaScript, Batch and lots of others) and text/comment nodes on XML/HTML class documents:

screenshot

Usage

Correcting Spelling Errors

Press Ctrl+. (Windows, Linux) +. or Cmd+. (macOS) or click Lightbulb to show a context menu with suggestions:

dictionary

Use F8 or Shift+F8 to jump to next/previous spelling error.

Changing Language and Turning OFF

Extension has a handy list interface for switching spelling dictionary (language) or turning spelling OFF for currently open document type:

dictionary

It can be reached by clicking on indicator field with an "eye" symbol in status bar:

switch

Alternatively same result can be achieved selecting command SpellRight: Select Dictionary (Language) or SpellRight: Turn OFF for Current Document Type from the command palette (F1/Ctrl+Shift+P).

Status bar indicator also shows when spelling for particular document class has been turned OFF:

switch

Or when it has been forced OFF by In-Document command (spellcheck-off) or rule in .spellignore:

switch

Multiple languages in one document

Language selector allows to select more than one language. Document is then spelled using all of the dictionaries and when a token (word) is considered correct in one of the dictionaries it is considered as spelled correctly. When it is not, then suggestions for all selected languages are shown.

Language can also be switched by using In-Document command spellcheck-language placed within document:

switch

And when at least one language spelled is missing dictionary:

switch

Commands

This extension contributes the following commands:

SpellRight: Select Dictionary (Language)

Pops dictionary selection list. Selecting language also turns spelling ON. The list also allows to turn spelling OFF for currently open document type. Can also be reached by clicking indicator field in status bar.

SpellRight: Turn OFF for Current Document Type

Turn spelling OFF for currently open document type.

SpellRight: Open User Dictionary File

Open in editor spellright.dict file from user settings folder.

SpellRight: Open Workspace Dictionary File

Open in editor spellright.dict file from workspace settings folder (.vscode) appropriate for currently open document in (multi root) workspace.

SpellRight: Add Selection to Workspace Dictionary

Add text selected in editor to main workspace dictionary appropriate for currently open document in (multi root) workspace.

SpellRight: Add Selection to User Dictionary

Add text selected in editor to main user dictionary.

SpellRight: Update Configuration

Saves current state of GUI (that is language and map of documents classes spell checked) to appropriate configuration file. Works only if "spellright.configurationUpdate" is set to false.

Settings

This extension contributes the following settings (with default values):

"spellright.language": [ "" ]

Default language (dictionary/country name) used for spelling. Typically in a LANGUAGE (e.g.: "en", "fr", when "spellright.groupDictionaries" is true) or LANGUAGE-COUNTRY format (e.g.: "en-US", "en-GB", "fr-CA", "pl-PL", when "spellright.groupDictionaries" is false). When Hunspell spelling engine is used (e.g. in Windows 7) this setting should be the name of the dictionary file without extension. In case language parameter is not set then language from OS locales is used.

"spellright.statusBarIndicator": true

Enable/disable language & status indicator switch in status bar.

"spellright.suggestionsInHints": true

Enable/disable including suggested corrections in hints. Disabling suggestions significantly speeds checking up. May be useful in case of large, often switched or saved documents.

"spellright.addToSystemDictionary": false

When true words added to user dictionary are stored in system default custom spelling dictionary instead.

"spellright.groupDictionaries": true

Enable/disable grouping of dictionaries by language. Disabling grouping results in displaying dictionaries for all regional variants (e.g. en-US, en-GB, en-CA etc.) as separate entries. When enabled regional dictionaries are displayed as single dictionary under common language name (e.g. "English"). Works only on native Windows & macOS spelling APIs.

"spellright.recheckOnSave": false

Enable/disable re-checking of entire document after file is saved.

"spellright.documentTypes": [ "plaintext", "markdown", "latex" ]

Document types for which spelling will be turned ON by default.

"spellright.ignoreRegExps": []

Regular expressions ignored in spelling. Allows to ignore/consider as spelled correctly generalized expressions. Works on raw document before separating words to spell which allows to ignore larger parts of the document. Regular expressions have to be in double quoted JavaScript regular expression format. That is backslash has to be quoted as well e.g.: "/(\\.?)(gif|png)/g" to ignore file extensions like ".gif" and ".png".

"spellright.ignoreRegExpsByClass": {}

Extends setting of "spellright.ignoreRegExps" per document type. Accepts object of key-multi-value pairs. For example following settings:

"spellright.ignoreRegExpsByClass": {
    "markdown": [ "/&/g", "/ /g" ],
    "cpp": [ "/#include\\s+\\\".+\\\"/g" ],
    "html": [ "/<script>[^]*?</script>/gm" ],
    "latex": [ "/\\\\begin{minted}[^]*?\\\\end{minted}/gm" ]
}
  • avoid spelling of &amp; and &nbsp; literals in markdown documents;
  • avoid spelling of strings in #include "file" construct in CPP documents;
  • avoid spelling of multiline <script></script> tag content in HTML documents;
  • avoid spelling of "minted" code blocks in LaTeX documents.

Please mind the fact that both "spellright.ignoreRegExps" and "spellright.ignoreRegExpsByClass" may have serious impact on performance. They are applied on whole document before every, even smallest spell check, has to reapply these filters so they may cost time in complicated expressions.

"spellright.ignoreFiles": [ "**/.gitignore", "**/.spellignore" ]

Set of file patterns to globally, silently exclude files from being spelled. Files described with this setting will not be reported as forced OFF spelling (red indicator in status bar). Patterns defined as for gitignore.

"spellright.notificationClass": "error"

Allows to change class of diagnostic messages produced by Spell Right which changes in turn underline color. Possible values (with corresponding underline color) are: "error" (red), "warning" (green), "information" (green), "hint" (invisible).

"spellright.notificationClassByParser": {}

Extends "spellright.notificationClass" to allow change class of diagnostic messages per parser. For example following settings:

"spellright.notificationClassByParser": {
    "code": "information"
}

will produce "information" class diagnostics for documents spelled with code parser. Possible values on left side of the association are: plain, markdown, code, latex and xml.

"spellright.spellContext": "body comments strings"

Allows to enable (present in string) or disable (absent in string) spelling of syntactic parts of the documents. Currently supported are:

  • body - body of document (e.g. LaTeX, Plaintext, Markdown etc.);
  • code - code blocks in Markdown type documents (spelled as whole, not syntactically);
  • comments - comment (block & line) sections in programming languages, also LaTeX;
  • strings - strings in programming languages.

"spellright.spellContextByClass": {}

Same as "spellright.spellContext" but per document type. Accepts object of key-value pairs. For example following settings:

"spellright.spellContextByClass": {
    "latex": "body",
    "cpp": "comments",
    "python": "strings"
}
  • disable spelling of comments in LaTeX documents;
  • disable spelling of strings in CPP documents;
  • disable spelling of comments in Python documents.

"spellright.languageContext": {}

Allows to decide on which language is used to spell syntactical parts of the documents. For example following settings:

"spellright.languageContext": {
    "strings": [ "en-US" ],
    "comments": [ "en-GB" ]
}

will spell strings in American English and comments in British English of course if the "spellright.groupDictionaries" flag is set to false.

Configuration item "spellright.languageContext" is more important than "spellright.language" but less important than In-Document commands.

"spellright.languageContextByClass": {}

Same as "spellright.languageContext" but per document type. For example following settings:

"spellright.languageContextByClass": {
    "latex": {
        "body": [ "fr" ],
        "comments": [ "en" ]
    }
}

will spell body of latex documents in French and comments in English.

Configuration item "spellright.languageContextByClass" is more important than "spellright.language" and "spellright.languageContext" but less important than In-Document commands.

"spellright.configurationUpdate": true

If set to true then each operation on the GUI (change of language, turning spelling OFF for particular document type) is automatically saved in appropriate configuration settings (workspace if workspace is open and user if not). Setting to false requires using of "spellright.configurationUpdate" command to save the changes performed in GUI.

"spellright.configurationScope": "workspace"

Allows to decide which configuration gets updated when "spellright.configurationUpdate" is set to true. Possible values are user and workspace.

"spellright.latexSpellParameters": (see below for default value)

Defines LaTeX commands that should have both mandatory ([]) and optional ({}) parameters spelled. Other commands are removed from spelling. Default value:

"spellright.latexSpellParameters": [
    "author",
    "title",
    "date",
    "chapter",
    "section\\*?",
    "subsection\\*?",
    "subsubsection\\*?",
    "part",
    "paragraph",
    "subparagraph",
    "text(rm|sf|tt|md|bf|up|it|sl|sc|normal)",
    "underline",
    "emph",
    "item",
    "footnote(text)?",
    "caption(of)?",
    "multicolumn",
    "href",
    "hyperref",
    "begin\\{frame\\}"
]

"spellright.parserByClass": {}

Allows to assign or override generic parser for particular document class. For example following settings:

"spellright.parserByClass": {
    "perl": {
        "parser": "code"
    }
}

assigns parser of generic type code (Source Code Parser) to perl (Perl) document class. Possible values are:

  • plain - spells entire content of the document;
  • markdown - spells everything except code blocks;
  • code - spells comments and strings;
  • latex - spells everything except LaTeX commands;
  • xml - spells comments and everything outside markup.

"spellright.useDocumentSymbolsInCode": true

If set to true Spell Right will use document symbols (variable, function names etc.) when spelling source code documents. Significantly reduces number of misspelled words in doc-strings and in comments whenever a symbol used in code is used and the symbol does not disassemble to properly spelled parts using CamelCase, snake_case etc. separation.

In-Document Commands

Beside global settings following commands can be embedded inside spelled parts of the document (e.g.: comments, strings etc.):

spellcheck-language "CODE" ["CODE"]* (alternative syntax: spellcheck: language "CODE" ["CODE"]* and !TEX spellcheck = "CODE", but with only one language code in comment areas of latex document class only)

Forces switching spelling language for the following part of the document or until next spellcheck-language "CODE" command. CODE is language code according to used spellcheck background service, typically in a LANGUAGE or LANGUAGE-COUNTRY format (e.g.: "en", "fr", "en-US", "en-GB", "fr-CA", "pl-PL" etc.) If CODE is empty switches back to default spelling language.

In-Document commands for switching spelling language have highest priority over "spellright.languageContextByClass" and "spellright.languageContext" and "spellright.language" configuration items.

spellcheck&#x2d;off (alternative syntax: spellcheck: off)

Forces spelling OFF for the entire document despite global settings.

spellcheck&#x2d;on (alternative syntax: spellcheck: on)

Forces spelling ON for the entire document despite global settings. Has higher priority than turning spelling off with both In-Document spellcheck&#x2d;off command and .spellignore patterns.

Ignore file

.spellignore file located in workspace root directory, appropriate to currently open file in (multi root) workspace, can be used to disable spelling for files described by gitignore syntax file patterns.

Unknown document type

Spell Right must have an idea of the document structure in order to be able to spell it. Most document types have parts that do not need to be spelled (e.g. code blocks in Markdown, commands in LaTeX documents etc.) When an unregistered document type is encountered then Spell Right proposes a list of generic parsers to choose from:

dictionary

Select appropriate class to be able to spell the document. If spellright.configurationUpdate is set to true assignment will be written to the configuration settings either user or workspace according to the value of spellright.configurationScope setting.

Known Issues

  • There is a limit, imposed by VSCode, on the number of diagnostics that an extension (Spell Right among) can provide for one file. The number is 1000 and Spell Right cannot display more spelling errors. Once the spelling errors from the head of the file are corrected or added to the dictionaries more issues will appear at the end.
  • Due to bug in NSSpellChecker layer of macOS Spell Right cannot currently use dictionaries installed in ~/Library/Spelling folder, just those that came with the system.
  • There are rare situations when dictionaries are not reported correctly on Windows using Windows Spelling API (Windows 8+). They can result in no dictionary or only some dictionaries available. So far the reason for this is unknown but seems to be outside of the extension (see #106 and #53, especially this and this comments for details).

Notice

This extension can be considered a Work In Progress. Please report all the errors and/or annoyances that you see on the issues page.

Release Notes

Changelog

vscode-spellright's People

Contributors

antichris avatar bartosz-antosik avatar borekb avatar dependabot[bot] avatar gandalfsaxe avatar janpio avatar jjallaire avatar joschac avatar nkuehn avatar roblourens avatar segphault avatar sequitur avatar superflue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-spellright's Issues

How to ignore `code` in Markdown using spellright.ignoreRegExps?

I want to suppress spell checking inside Markdown code words and I've got a feeling that spellright.ignoreRegExps will be the way to go, however, I can't figure out how to write that regexp. Could you provide an example please? Is it possible at all? I've tried:

    "spellright.ignoreRegExps": [
        "/`.*`/g"
    ]

which doesn't seem to work.

Thanks for an awesome extension BTW.

Manual install

I want to try out this extension, but it current says

This extension is currently limited to 64-bit Windows platform. It is due to problems with distribution of native modules in current VSCode's distribution model. For details see (and up-vote maybe) discussion about VSCode's feature request #20266.

I briefly read the issue and understand that you cannot provide an easy way to install on macOS for now. But is there any manual way? Can I build node-spellchecker myself and install it somehow? Any instructions?

Undo editor action doesn't trigger word re-check

  1. Type word with spell error
  2. Word is marked as bad
  3. Fix word spelling
  4. Word is marked ok
  5. Pres Ctrl-Z to undo last change
  6. Word is marked ok
  7. Do some more editing somewhere
  8. Word is re-checked and marked as bad

I thing steps 6 and 7 should be eliminated.

TypeError: Cannot read property '_documentData' of undefined

When I go into Help -> Toggle Developer Tools, I see some errors.

shell.ts:423 Cannot read property '_documentData' of undefined: TypeError: Cannot read property '_documentData' of undefined
at C:\Users[Username].vscode\extensions\ban.spellright-1.1.4\src\spellright.js:170:35
at e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:55038)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:56829)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:392875
at e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:55038)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:56829)
at t.$acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:348628)
at t.e.handle (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:308751)
at s (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:188848)
at h (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:189503)
e.onUnexpectedError @ shell.ts:423
shell.ts:423 Cannot read property '_documentData' of undefined: TypeError: Cannot read property '_documentData' of undefined
at C:\Users[Username].vscode\extensions\ban.spellright-1.1.4\src\spellright.js:170:35
at e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:55038)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:56829)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:392875
at e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:55038)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:56829)
at t.$acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:348628)
at t.e.handle (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:308751)
at s (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:188848)
at h (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:189503)
e.onUnexpectedError @ shell.ts:423

Highlights disappear on edit when more than 250 spelling errors in document

When document contains more than 250 spelling errors Spell Right produces list that exceeds the number of allowed diagnostic hints (which is 250). It leads to a situation when during editing of the document misspelled words are not highlighted because they diagnostic hints land at the end of the list, on positions beyond 250, which are not displayed by VSCode.

Language selected for file is reset to none after adding word to user dict

Each time I add word to user dictionary language indicated at status bar is reset to [none].
Underlines and suggestion tooltips inside editor, spelling problems in PROBLEMS tab are preserved, but yellow bulb is not shown anymore.

After selecting language again it works... till next word added to dict.

Add support for disabling per file

Would you please consider adding support for disabling the extension if the file has the comment block:

/* spellright-disable */
<!-- spellright-disable -->

Right suggestion for wrong CamelCase word part displayed

The correct suggestion is displayed but for the wrong part.

Example 1:

all parts wrong, word with English dictionary: MyyOvnCemalCiseWerd (should be MyOwnCamelCaseWord):

cursor position marked with _ char

cursor position suggestion
_MyyOvnCemalCiseWerd Own
My_yOvnCemalCiseWerd Own
Myy_OvnCemalCiseWerd Camel
MyyO_vnCemalCiseWerd Camel
MyyOvn_CemalCiseWerd Case
MyyOvnCem_alCiseWerd Case
MyyOvnCemal_CiseWerd Word
MyyOvnCemalCise_Werd Word
MyyOvnCemalCiseWe_rd Word
MyyOvnCemalCiseWerd_ Word

Example 2:

one part correct, word with English dictionary: MyyOvnCamelCiseWerd (should be MyOwnCamelCaseWord):

cursor position suggestion
_MyyOvnCamelCiseWerd Own
My_yOvnCamelCiseWerd Own
Myy_OvnCamelCiseWerd Own
MyyO_vnCamelCiseWerd Own
MyyOvn_CamelCiseWerd Own
MyyOvnCam_elCiseWerd Own
MyyOvnCamel_CiseWerd Word
MyyOvnCamelCise_Werd Word
MyyOvnCamelCiseWe_rd Word
MyyOvnCamelCiseWerd_ Word

There is no way to display suggestion for the first part of CamelCase word.

Selected suggestion corrects right word Cemal -> Camel etc.

Extensions fails to load when there's a trailing comma in settings.json

Trying to execute select dictionary with a trailing comma in settings.json leads to a popup error that says:

command 'spellright.selectDictionary' not found

Developer tools's console outputs this error:

Activating extension `ban.spellright` failed: Cannot read property 'spellright.ignoreWords' of null.

I only realized I had a trailing comma when adding some console.logs in the extension src files. The problem is the JSON.parse in line 1384 of spellright.js. It fails when parsing settings.json, returns null as the value and leads to the reading ignoreWords of null error above.

I see 2 solutions:

  1. Add better error on getUserSettings(), so that the user is notified the settings.json file has bad syntax, and can realize why the extension is not loading.
  2. Ignore the trailing comma. Other extensions seem to use vscode.workspace.getConfiguration('extension'), instead of reading the file manually and parsing it (internally VScode parser seems to ignore trailing commas). Maybe the code can be modified for this?

Which would be the better option? I could make a PR if it would help.

Multitude of dictionary/culture pairs should be managed

When node-spellchecker module used by the extension is using Windows native Spell Checking API it reports a multitude of dictionaries of same language and different culture:

dictionaries

It would be convenient to have some way to filter the dictionaries (in positive or negative manner) only displaying main or selected dictionaries (e.g. fr_FR instead of all fr_ dictionaries etc.)

It would lead to cleaner view and quicker selection.

Spell checking not working in .mustache (HTML) files

  • VSC 1.11.2
  • WIndows 10 Pro 15063.138
  • Spell Right 1.0.12

With spell checking enabled on a .mustache template file that is HTML no spelling is checked. Need options to check spelling if it's in code or in strings or just text files.

image

spellchecker.json vs. user settings.json

I've got a question. On my PC, I seem to have custom ignore words in two files:

  • spellchecker.json
  • settings.json (also in the ../Code/User directory)

When I do Add "customword" to global ignore list, it seems to be added to my user settings.json. How does the spellchecker.json file work? Is there a way to add my custom words there? I would prefer that as I synchronize my user settings.json between two computers and custom words create a lot of noise and possible merge conflicts there. Thanks.

Add support reStructuredText

Hello!

Firstly, thank you for your work.

In our projects we use readthedocs.org and as consequence reStructuredText (*.rst files). I tried to configure Spell Right using spellright.json as described below but it didn't give a result.

{
    "language": "en",
    "documentTypes": [
        "restructuredtext",
        "markdown",
        "latex",
        "plaintext"
    ],
    "groupDictionaries": true,
    "statusBarIndicator": true,
    "suggestionsInHints": true,
    "ignoreWords": [],
    "ignoreRegExps": [],
    "ignoreFiles": [
        "**/.gitignore",
        "**/.spellignore"
    ]
}

Wrong file type handling in split view

If you have a .tex file in the left editor group and a .txt file in the right editor group, the .tex file seems to be checked with the rules for .txt file.

spell-iloveimg-compressed

Spell check large file blocks all other extensions

Hey Bartosz, our PM pointed me to an awesome spell checking extension on the marketplace and the amazing part is we already knew each other :) I played with your extension, it's pretty fast and the results are really reasonable (aka I really like it , even though I need to run node-gyp rebuild myself 😃, tada).

We talked about async interface in microsoft/vscode#20266 (comment) and at that time I think it's not a big deal as we can use setTimeout to make spellchecker's api async. But this doesn't mitigate the performance issue.

  • In your current implementation, we call spellcheck.checkspelling directly, which is a synchronous function. It means this onDidTextDocumentChange handler is synchronous, when nodejs is running this function, no other events will be handled in the event loop.
  • Then let's say we put it into setTimeout or whatever delaying function, this onDidTextDocumentChange handler is finished immediately, which is good. However when nodejs picks up the spellcheck.checkspelling, it still blocks all other events.

So this time let me describe it more precisely, if the spellchecking api is running in the main thread (the event loop), the main thread is blocked. For small documents, it's okay as spellchecking is pretty fast. But for medium to large files (eg, https://github.com/Microsoft/vscode-docs/blob/master/release-notes/v1_8.md ), it takes several seconds to finish the spellchecking, then none other extension is reactive.

A proper reproduce step:

To mitigate this issue and the node-gyp rebuild problem, I tried two ways

You may want to go with the first option or similar solutions to solve the node-gyp problem and even better not block the extension host :)

Lastly I'm thinking about how to ignore ranges in a document, your approach is really inspiring.

StatusBarItem

image

  1. It seems that the config doesn't work
  2. It would be better to remove the default white foreground as it overrides the theme color

Add support for Asciidoc files

Currently SpellRight doesn't work on files with the extension *.asc, *.adoc, and *.asciidoc.

Asciidoc files are just text files. Asciidoc is a lightweight markup language similar to markdown but targeting longer documents like books.

http://asciidoctor.org/docs/asciidoc-recommended-practices/#document-extension

AsciiDoc doesn’t care which extension you use. GitHub supports the extensions .asciidoc, .adoc and .asc.
.adoc seems to be the most often used extension and the one we prefer. It does not conflict with other well known applications, is distinct, and not excessively long (like .asciidoc). It also reads as “a doc”. Our recommendation, therefore, is to use .adoc.

Thank you.

CamelCase word is marked as correct when only one part was corrected

Example: MyyOvnCemalCiseWerd again 😄

  1. Whole word is underlined as wrong spelling
  2. One part is corrected (Ovn -> Own) using suggestion or manually
  3. Whole word is not underlined (marked as OK?)
  4. After changing the line containing this word...
  5. ...underline is displayed again for wrong parts only

I think steps 3 and 4 should be eliminated.

One wrong regex will prevent other regexs to be applied

I want to ignore two expressions,

  • \verb|something| in LaTeX
  • Chinese words, e.g. 中文词语

I have tried many regexs but can't get them to work.

Finally, I tried abc and /abc/g to ignore abc and found they don't work too...

Could you please have a check whether the regexs are applied to ignore words?

image

Exclude code blocks from reStructuredText

Hello!

Today I tried to exclude code blocks from the analysis using ignoreRegExps and expression "/\\s{4,}.*/g". Here is my configuration:

{
    "language": "en",
    "documentTypes": [
        "restructuredtext",
        "markdown",
        "latex",
        "plaintext"
    ],
    "groupDictionaries": true,
    "statusBarIndicator": true,
    "suggestionsInHints": true,
    "ignoreWords": [],
    "ignoreRegExps": [
        "/\\s{4,}.*/g"
    ],
    "ignoreFiles": [
        "**/.gitignore",
        "**/.spellignore"
    ]
}

After few iterations I haven't gotten success and I need your help again. :) I also tested my expression here https://regex101.com/r/GJXToz/1 and it works fine (I think).

Thanks.

Weird behavior

I installed this extension on my Visual Studio Code and I couldn't figure it out how it works or if it is working properly on my computer.

The spell check didn't worked ever on new plain text files. I tried with LaTeX files (with syntax plugins) and it only works if I reselect the language that I want to correct (I already set it by default on settings.json).

Any help would be appreciated. I'm using Windows 10 Home Single Language with Creators Update.

Add words to a system dictionary on Windows

Would be nice if custom words could be added to a system dictionary on Windows. It is located at C:\Users\Me\AppData\Roaming\Microsoft\Spelling\en-US\default.dic for me but also very likely accessible via some API as Caret, a Markdown editor I use, stores custom words there.

Global/Workspace dictionary(ignoreWords)

When clicking on the "Add ??? to global dictionary" the spell checker adds the word to both global (settings.json) and workspace (spellright.json) ignore lists.

Additionally, in the global options file (settings.json) the ignoreWords list is created with a wrong name "spellchecker.ignoreWords" when the accepted one is "spellright.ignoreWords".

Extension doesn't work

Using Windows 7 64bit, Visual Studio Code latest stable version.

Extension is installed.

Tested on a text file (plain). Doesn't highlight any of the mistakes that exist.

Executing any of the "SpellRight" commands returns "command not found"

Other installed extensions: asciidoc; beautify; html preview; markdownlint; rewrap; write good linter.

I'm frustrated that I can't provide better feedback because I can't find any reason from my part for the failure of the extension to work.

Thank you.

Broken Name for the Norwegian Bokmål Dictionary

The name for the Norwegian Bokmål dictionary displays as Norwegian (Bokm?l) in both the status bar and the language selection menu. For reference, I'm running the latest version of VS Code (1.11.1) on Windows 10 x86_64.

Perhaps this issue is not specific to this dictionary, and might apply to any dictionary that has a name using characters outside of the ASCII range?

Spell checking default to "off" on User Settings files

  • VSC 1.11.2
  • WIndows 10 Pro 15063.138
  • Spell Right 1.0.12

Files listed in spellright.documentType do not auto start spell checking. These files should default to the set spellright.language when VSC starts / loads the file.

image

Comments are not spell-checked in .http files

I use the REST Client extension and their .http files. I have enabled Spell Right for it but the comments are not spell-checked:

image

Does this have something to do with the way they define their language? Is this a problem or their end or an issue in Spell Right? Thanks.

Turning off SpellRight leaves it stuck in enabled mode in other Editors

With SpellRight configured to not check any document types by default, try the following:

  1. Open a new instance of VS Code with no documents open.
  2. Hit Ctrl + N to start a new text file.
  3. Type some random/nonsense words.
  4. Hit Ctrl + N to open a second editor/tab.
  5. In the second file, type some random/nonsense words.
  6. While still in the second file, enable SpellRight from the status bar and notice that the words get underlined in red.
  7. Switch to the first file in the first tab. Notice that the words there get underlined in red too. So far so good.
  8. Switch back to the second file.
  9. Turn off SpellRight from the status bar (i.e. turn off for document type [plaintext])
  10. Go back to the first file, where the words are still underlined in red. Notice that according to the status bar, SpellRight is supposedly disabled.

Specify what to spell-check

If I enable Spell Right for TypeScript and other code files, it seems to spell-check comments and strings. Strings are usually technical stuff I don't want to spell check, for example, ES6 imports like import { env } from '../Dotenv'. I'd like only comments spell-checked in the code files.

I wonder if if the documentTypes could be enhanced like this:

"spellright.documentTypes": {
    "plaintext": true,
    "markdown": true,
    "typescript": "comments-only",
    "javascript": "comments-only"
}

Incorrect default language

I don't have any custom settings and this is in the default settings:

"spellright.language": "en_US"

But when I open any Markdown document, it defaults to a Czech language (which is one of my two languages I write in; where does Spell Right take the languages from anyway?). I think this might be a bug.

Since updating to 1.1.10 Spell Right starts off enabled when configured not to

Whenever I start VS Code, Spell Right is enabled for the text documents I currently have open, set to spell check in English.

This is despite me having this setting configured:

"spellright.documentTypes": [],

Even if I then disable Spell Right for the current document type, if I then quit and restart VS Code, Spell Right becomes enabled once again.

I believe this only started happening after the recent update to 1.1.10. Previously Spell Right was always disabled for all file types until I explicitly enabled it.

X64 VSCode is not supported?

It did not work at all for C++ code. It did not even show up on the status bar. VSCode X64 version: 1.14.2. I'm using Windows 10 Enterprise Version 1703 OS Build 15063.483

Fail to start

This is the console output

Activating extension `ban.spellright` failed: The module 
'\\?\C:\Users\username\.vscode-insiders\extensions\ban.spellright-1.0.8\node_modules\spellchecker\build\Release\spellchecker.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 50. This version of Node.js requires
NODE_MODULE_VERSION 53. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`)..

Windows 10 & vscode-insider build 2017-04-20

Spell check does not ignore punctuation.

If I have an unknown word such as a technical word like "flyout" at the end of a sentence as shown:

This opens a flyout.

The spell checker includes the punctuation. Even if I add "flyout" to the dictionary, it does not work because the spell checker still considers "flyout." to be an incorrect spelling.

Reuse system installed hunspell dictionaries

On Linux and Windows 7 Spell Right uses built in Hunspell spell checker library. To use it a pair of Dictionary (.dic) and Affixes (.aff) files have to be downloaded from here (please remember to download RAW files) and placed in Dictionaries subfolder of VSCode's user global configuration directory, located at:

  • Windows: %APPDATA%\Code\Dictionaries\
  • Linux: $HOME/.config/Code/Dictionaries/

Dictionaries subfolder does not exists there by default and has to be created manually.

On Linux it was sufficient for me to symlink system-wide installed dictionaries:

ln -s /usr/share/hunspell ~/.config/Code/Dictionaries

All dictionaries are detected and working.

Please verify if this is correct solution (this dir is readonly for users on Linux) and update SpellRight documentation.

Seems spellright gets confused with apostrophe

Hi, just updated to 1.0.10 and found that in markdown for example, phrases with apostrophe do not get recognized correctly.

image

spellright actually suggests to replace it with doesn't and right after replacing it, you get the same warning for doesn again ;)

Thanks for the great extension btw!

Spell problems prevent debugging

If there are some spell problems in a file such as README.md, when launching debug, a warning will popup and I need to click debug anyway.
For some specific 'spell errors', I don't want to either fix them or add them to .ignore.
But it's not good to have one more debug anyway click since they are not crucial errors.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.