MoonNote

반응형
     

 

 

참조 : https://marketplace.visualstudio.com/

 

Visual Studio Marketplace

Extensions for Visual Studio family of products on Visual Studio Marketplace

marketplace.visualstudio.com

 

 

 

Code Spell Checker

코드 작성시 잘못된 Spell을 체크해주는 Extension

영어만 가능

3글자 이상부터 체크

모든 기호 및 부호는 무시

 

Example

 

Suggestion

 

TIP
 
 

제안 목록을 보려면:
단어에 커서를 놓으면 다음 중 하나가 제안 목록을 표시합니다:
왼쪽 여백에 있는 💡(라이트 전구)를 클릭합니다.
빠른 수정 편집기 작업 명령:
Mac: ⌘+. or Cmd+.
PC: Ctrl+.

 

Supported Languages

▪ English (US)

English (GB) - turn on by changing "cSpell.language": "en" to "cSpell.language": "en-GB"

 

Enable File Types

  AsciiDoc

  C, C++

  C#

  css, less, scss

  Dart

  Elixir

  Go

  Html

  Java

  JavaScript

  JSON / JSONC

  LaTeX

  Markdown

  PHP

  PowerShell

  Pug / Jade

  Python

  reStructuredText

  Ruby

  Rust

  Scala

  Text

  TypeScript

  YAML

  SQL

 

Enable / Disable File Types

1. Status bar에서 Spell Checker status 클릭

2. Screen에서 체크 박스 클릭

 

 

Enable / Disable checking sections of code

코드 내에서 comment 추가로 spell checker를 Enable / Disable 할 수 있음

 

Disable Checking

  /* cSpell:disable */

  /* spell-checker: disable */

  /* spellchecker: disable */

  /* cspell: disable-line */

  /* cspell: disable-next-line */

Enable Checking

  /* cSpell:enable */

  /* spell-checker: enable */

  /* spellchecker: enable */

 

Example

// cSpell:disable
const wackyWord = ['zaallano', 'wooorrdd', 'zzooommmmmmmm'];
/* cSpell:enable */

// Nest disable / enable is not Supported

// spell-checker:disable
// It is now disabled.

var liep = 1;

/* cspell:disable */
// It is still disabled

// cSpell:enable
// It is now enabled

const str = 'goededag'; // <- will be flagged as an error.

// spell-checker:enable <- doesn't do anything

// cSPELL:DISABLE <-- also works.

// if there isn't an enable, spelling is disabled till the end of the file.
const str = 'goedemorgen'; // <- will NOT be flagged as an error.

 

Ignore

// cSpell:ignore zaallano, wooorrdd
// cSpell:ignore zzooommmmmmmm
const wackyWord = ['zaallano', 'wooorrdd', 'zzooommmmmmmm'];

 

VS Code Configuration Settings

    //-------- Code Spell Checker Configuration --------
    // The Language locale to use when spell checking. "en", "en-US" and "en-GB" are currently supported by default.
    "cSpell.language": "en",

    // Controls the maximum number of spelling errors per document.
    "cSpell.maxNumberOfProblems": 100,

    // Controls the number of suggestions shown.
    "cSpell.numSuggestions": 8,

    // The minimum length of a word before checking it against a dictionary.
    "cSpell.minWordLength": 4,

    // Specify file types to spell check.
    "cSpell.enabledLanguageIds": [
        "csharp",
        "go",
        "javascript",
        "javascriptreact",
        "markdown",
        "php",
        "plaintext",
        "typescript",
        "typescriptreact",
        "yml",
        "sql"
    ],

    // Enable / Disable the spell checker.
    "cSpell.enabled": true,

    // Display the spell checker status on the status bar.
    "cSpell.showStatus": true,

    // Words to add to dictionary for a workspace.
    "cSpell.words": [],

    // Enable / Disable compound words like 'errormessage'
    "cSpell.allowCompoundWords": false,

    // Words to be ignored and not suggested.
    "cSpell.ignoreWords": ["behaviour"],

    // User words to add to dictionary.  Should only be in the user settings.
    "cSpell.userWords": [],

    // Specify paths/files to ignore.
    "cSpell.ignorePaths": [
        "node_modules",        // this will ignore anything the node_modules directory
        "**/node_modules",     // the same for this one
        "**/node_modules/**",  // the same for this one
        "node_modules/**",     // Doesn't currently work due to how the current working directory is determined.
        "vscode-extension",    //
        ".git",                // Ignore the .git directory
        "*.dll",               // Ignore all .dll files.
        "**/*.dll"             // Ignore all .dll files
    ],

    // flagWords - list of words to be always considered incorrect
    // This is useful for offensive words and common spelling errors.
    // For example "hte" should be "the"`
    "cSpell.flagWords": ["hte"],

    // Set the delay before spell checking the document. Default is 50.
    "cSpell.spellCheckDelayMs": 50,

 

Dictionaries

General Dictionaries

▪ wordsEn - Derived from Hunspell US English words.

  wordsEnGb - Derived from Hunspell GB English words.

  companies - List of well known companies

  softwareTerms - Software Terms and concepts like "coroutine", "debounce", "tree", etc.

  misc - Terms that do not belong in the other dictionaries.

  Programming Language Dictionaries

  typescript - keywords for Typescript and Javascript

  node - terms related to using nodejs.

  php - php keywords and library methods

  go - go keywords and library methods

  python - python keywords

  powershell - powershell keywords

  html - html related keywords

  css - css, less, and scss related keywords

Miscellaneous Dictionaries

  fonts - long list of fonts - to assist with css

{
"cSpell.languageSettings": [
    { "languageId": '*',      "locale": 'en',              "dictionaries": ['wordsEn'] },
    { "languageId": '*',      "locale": 'en-US',           "dictionaries": ['wordsEn'] },
    { "languageId": '*',      "locale": 'en-GB',           "dictionaries": ['wordsEnGb'] },
    { "languageId": '*',                                   "dictionaries": ['companies', 'softwareTerms', 'misc'] },
    { "languageId": "python", "allowCompoundWords": true,  "dictionaries": ["python"]},
    { "languageId": "go",     "allowCompoundWords": true,  "dictionaries": ["go"] },
    { "languageId": "javascript",                          "dictionaries": ["typescript", "node"] },
    { "languageId": "javascriptreact",                     "dictionaries": ["typescript", "node"] },
    { "languageId": "typescript",                          "dictionaries": ["typescript", "node"] },
    { "languageId": "typescriptreact",                     "dictionaries": ["typescript", "node"] },
    { "languageId": "html",                                "dictionaries": ["html", "fonts", "typescript", "css"] },
    { "languageId": "php",                                 "dictionaries": ["php", "html", "fonts", "css", "typescript"] },
    { "languageId": "css",                                 "dictionaries": ["fonts", "css"] },
    { "languageId": "less",                                "dictionaries": ["fonts", "css"] },
    { "languageId": "scss",                                "dictionaries": ["fonts", "css"] },
];
}

 

cSpell.customDictionaries

interface Settings {
    'cSpell.customDictionaries': {
        [name: string]: CustomDictionary;
    };
}

interface CustomDictionary {
    /**
     * @title Name of Dictionary
     * The reference name of the dictionary.
     *
     *
     * Example: `My Words` or `custom`
     *
     *
     * If they name matches a pre-defined dictionary, it will override the pre-defined dictionary.
     * If you use: `typescript` it will replace the built-in TypeScript dictionary.
     */
    name?: DictionaryId;

    /**
     * @title Description of the Dictionary
     * Optional: A human readable description.
     */
    description?: string;

    /**
     * @title Path to Dictionary Text File
     * Define the path to the dictionary text file.
     *
     *
     * **Note:** if path is `undefined` the `name`d dictionary is expected to be found
     * in the `dictionaryDefinitions`.
     *
     *
     * File Format: Each line in the file is considered a dictionary entry.
     * Case is preserved while leading and trailing space is removed.
     * The path should be absolute, or relative to the workspace.
     *
     * **Example:** relative to User's folder
     *
     * ```
     * ~/dictionaries/custom_dictionary.txt
     * ```
     *
     * **Example:** relative to the `client` folder in a multi-root workspace
     *
     * ```
     * ${workspaceFolder:client}/build/custom_dictionary.txt
     * ```
     *
     * **Example:** relative to the current workspace folder in a single-root workspace
     *
     * **Note:** this might no as expected in a multi-root workspace since it is based upon the relative
     * workspace for the currently open file.
     *
     * ```
     * ${workspaceFolder}/build/custom_dictionary.txt
     * ```
     *
     * **Example:** relative to the workspace folder in a single-root workspace or the first folder in
     * a multi-root workspace
     *
     * ```
     * ./build/custom_dictionary.txt
     * ```
     */
    path?: FsPath;

    /**
     * @title Add Words to Dictionary
     * Indicate if this custom dictionary should be used to store added words.
     * @default true
     */
    addWords?: boolean;

    /**
     * @title Scope of dictionary
     * Options are
     * - `user` - words that apply to all projects and workspaces
     * - `workspace` - words that apply to the entire workspace
     * - `folder` - words that apply to only a workspace folder
     */
    scope?: CustomDictionaryScope | CustomDictionaryScope[];
}

 

 

 

 

 

 

 

※ 이 글이 도움이 되었다면 "👆🏻구독"과 "🤍공감" 버튼을 클릭해주세요. 클릭 한번이 글 쓰는데 큰 힘이 됩니다.

공유하기

facebook twitter kakaoTalk kakaostory naver band