Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Helper classes to assist in implementation of linter-spell dictionaries based on word lists.

License

Notifications You must be signed in to change notification settings

AtomLinter/linter-spell-word-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linter-spell-word-list

Helper classes to assist in implementation of linter-spell dictionaries based on word lists.

Usage

To implement a dictionary which stores its word list in Atom's configuration file use an implementation of provideDictionary like the following.

provideDictionary () {
  let a = new ConfigWordList({
    name: 'Plain Text',
    keyPath: 'linter-spell.plainTextWords',
    grammarScopes: [
      'text.plain',
      'text.plain.null-grammar'
    ]
  })
  this.disposables.add(a)
  return provideDictionary()
}

To store the word list elsewhere you will need to derive a class from WordList and implement getWords and addWord as shown below.

class MyWordList extends WordList {
  constructor (options) {
    super(options)
    this.words = []
  }

  getWords (textEditor, languages) {
    return this.words
  }

  addWord (textEditor, languages, word) {
    this.words.push(word)
  }
}

About

Helper classes to assist in implementation of linter-spell dictionaries based on word lists.

Resources

License

Stars

Watchers

Forks

Packages

No packages published