Skip to content

Commit

Permalink
Extend and tidy extension configuration (#5)
Browse files Browse the repository at this point in the history
* Expand extension settings

* Pass settings to alex vsc plugin

* Add extended configuration

* Enable user initiated linting

* Improve profanitySureness setting description

* Add utilization of the profanity sureness setting

* Lower delay for check

* Switch default checking strategy

* Tidy up settings

* Update readme
partially resolves #4
  • Loading branch information
tlahmann authored Aug 9, 2020
1 parent 6b3ea6c commit e69dc58
Show file tree
Hide file tree
Showing 10 changed files with 3,023 additions and 3,410 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ If you encounter any issues, feel free to open a ticket on [github](https://gith

### Extension Settings

| Parameter | Description | Default |
| --------------------- | --------------------------------------------------- | ------- |
| `alexLinter.enabled` | Enable (true) or disable (false) AlexLinter | true |
| `alexLinter.strategy` | Run the linter on save (onSave) or on type (onType) | onSave |
| Parameter | Description | Default |
| ------------------------------ | ------------------------------------------------------------------------------------- | ------- |
| `alexLinter.strategy` | Run the linter on save (onSave), on type (onType) or on user initiation (user) | onSave |
| `alexLinter.noBinary` | Check if pairs like 'he or she' or 'garbageman or garbagewoman' are considered errors | false |
| `alexLinter.profanitySureness` | Set the level of profanity check. Possible values are 'likely', 'maybe' and 'unlikely'. If set to 'maybe' words like 'addict' and 'asshat' are considered profanity. If set to 'likely' the word 'addict is not marked with a warning. | maybe |

## Future features

* Enable further settings
* Strategy: 'user' - only trigger on user initiation
* Quick-Fix extension
* implement a 'change all occurrences' and 'change in all files' feature
* Include an 'ignore this'/'ignore all' functionality
* Implement a 'change all occurrences' and 'change in all files' feature
* Implement an 'ignore this'/'ignore all' functionality
* Extend the filetypes to check

## License

Expand Down
3 changes: 2 additions & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
LanguageClient,
LanguageClientOptions,
ServerOptions,
TransportKind,
TransportKind
} from 'vscode-languageclient';

const DIAGNOSTICS_COLLECTION_NAME = 'AlexLinter';
Expand Down Expand Up @@ -58,6 +58,7 @@ export function activate(context: ExtensionContext) {
serverOptions,
clientOptions
);

// Start the client. This will also launch the server
context.subscriptions.push(
client.start(),
Expand Down
2,491 changes: 37 additions & 2,454 deletions package-lock.json

Large diffs are not rendered by default.

48 changes: 36 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,58 @@
"activationEvents": [
"onLanguage:plaintext",
"onLanguage:markdown",
"onLanguage:latex"
"onLanguage:latex",
"onCommand:alexLinter.lint"
],
"main": "./client/out/extension",
"contributes": {
"configuration": {
"type": "object",
"title": "AlexJS Linter",
"properties": {
"alexLinter.enabled": {
"type": "boolean",
"default": true,
"description": "Control whether AlexJS Linter automatically check files or not."
},
"alexLinter.strategy": {
"strategy": {
"type": "string",
"default": "onType",
"default": "onSave",
"description": "Sets when the Alex linter checks for inconsiderate writing",
"enum": [
"onSave",
"onType",
"onSave"
"user"
],
"enumDescriptions": [
"Check the document while typing",
"Check the document when saving"
"Check the document when saving",
"Check the document on user initiation"
]
},
"noBinary": {
"type": "boolean",
"default": false,
"description": "Control whether AlexJS Linter warns for pairs like 'he or she'."
},
"profanitySureness": {
"type": "string",
"default": "maybe",
"description": "The profanity sureness is a minimum rating for alex to check for. If set to 'maybe' then alex will warn for the levels 'maybe' and 'likely' profanities, but not for 'unlikely' profanity.",
"enum": [
"likely",
"maybe",
"unlikely"
],
"enumDescriptions": [
"Words that are likely profanity are marked as waring",
"Words that are possibly profanity are marked as waring",
"Words that are unlikely profanity are marked as waring"
]
}
}
}
},
"commands": [
{
"command": "alexLinter.lint",
"title": "AlexLiner: Check for insensitive, inconsiderate writing"
}
]
},
"scripts": {
"compile": "tsc -b",
Expand All @@ -63,7 +88,6 @@
"@types/mocha": "^8.0.1",
"@types/node": "^14.0",
"@types/vscode": "^1.47",
"alex": "^8.2.0",
"eslint": "^7.0.0",
"is-md": "^2.0.0",
"typescript": "^3.9"
Expand Down
Loading

0 comments on commit e69dc58

Please sign in to comment.