Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ You may use `grammarly.files.exclude` to ignore specific files.

Run `grammarly.login` or **Grammarly: Login / Connect your account** command to connect your Grammarly account.
Run `grammarly.logout` or **Grammarly: Log out** to disconnect your account.
Run `grammarly.dictionary` or **Grammarly: Open Dictionary** to open grammarly.com to your personal dictionary.

## Configuration

Expand Down
8 changes: 8 additions & 0 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"onCommand:grammarly.check",
"onCommand:grammarly.login",
"onCommand:grammarly.logout",
"onCommand:grammarly.dictionary",
"onLanguage:plaintext",
"onLanguage:markdown",
"onLanguage:html"
Expand Down Expand Up @@ -773,6 +774,13 @@
"icon": "$(log-out)",
"enablement": "grammarly.isUserAccountConnected"
},
{
"title": "Open Dictionary",
"category": "Grammarly",
"command": "grammarly.dictionary",
"icon": "$(book)",
"enablement": "!grammarly.isRunning || !grammarly.isUserAccountConnected"
},
{
"title": "Restart language server",
"category": "Grammarly",
Expand Down
7 changes: 7 additions & 0 deletions extension/src/GrammarlyClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ export class GrammarlyClient implements Registerable {
await this.client.protocol.logout()
await window.showInformationMessage('Logged out.')
}),
commands.registerCommand('grammarly.dictionary', async () => {
const dictionaryExternalURL = 'https://account.grammarly.com/customize';

if (!(await env.openExternal(dictionaryExternalURL))) {
await window.showErrorMessage('Failed to open dictionary.')
}
}),
{ dispose: () => this.session?.dispose() },
)
}
Expand Down