Skip to content

Commit fe47a75

Browse files
authored
Merge pull request #31 from emacs-grammarly/use-sdk
Switch to newer language server
2 parents 76f8412 + ce452e5 commit fe47a75

File tree

6 files changed

+431
-288
lines changed

6 files changed

+431
-288
lines changed

.github/workflows/activate.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Activate
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
emacs-version:
21+
- 28.1
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- uses: jcs090218/setup-emacs@master
27+
with:
28+
version: ${{ matrix.emacs-version }}
29+
30+
- uses: actions/setup-node@v2
31+
with:
32+
node-version: '16'
33+
34+
- uses: emacs-eask/setup-eask@master
35+
with:
36+
version: 'snapshot'
37+
38+
- name: Run tests
39+
run:
40+
make activate

Eask

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(package "lsp-grammarly"
2-
"0.2.2"
3-
"LSP Clients for Grammarly ")
2+
"0.3.0"
3+
"LSP Clients for Grammarly")
44

55
(package-file "lsp-grammarly.el")
66

@@ -14,4 +14,7 @@
1414
(depends-on "s")
1515
(depends-on "ht")
1616

17+
(development
18+
(depends-on "markdown-mode"))
19+
1720
(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ SHELL := /usr/bin/env bash
33
EMACS ?= emacs
44
EASK ?= eask
55

6-
TEST-FILES := $(shell ls test/lsp-grammarly-*.el)
7-
86
.PHONY: clean checkdoc lint package install compile test
97

10-
ci: clean package install compile
8+
ci: clean package install compile checkdoc lint
119

1210
package:
1311
@echo "Packaging..."
@@ -23,7 +21,19 @@ compile:
2321

2422
test:
2523
@echo "Testing..."
26-
$(EASK) exec ert-runner -L . $(LOAD-TEST-FILES) -t '!no-win' -t '!org'
24+
$(EASK) ert ./test/*.el
25+
26+
checkdoc:
27+
@echo "Run checkdoc..."
28+
$(EASK) checkdoc
29+
30+
lint:
31+
@echo "Run package-lint..."
32+
$(EASK) lint
2733

2834
clean:
2935
rm -rf .eask *.elc
36+
37+
activate:
38+
$(EASK) install --dev
39+
$(EASK) load ./test/activate.el

README.md

Lines changed: 41 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# lsp-grammarly
66

77
[![CI](https://github.com/emacs-grammarly/lsp-grammarly/actions/workflows/test.yml/badge.svg)](https://github.com/emacs-grammarly/lsp-grammarly/actions/workflows/test.yml)
8+
[![Activate](https://github.com/emacs-grammarly/lsp-grammarly/actions/workflows/activate.yml/badge.svg)](https://github.com/emacs-grammarly/lsp-grammarly/actions/workflows/activate.yml)
89

9-
`lsp-mode` client leveraging [unofficial-grammarly-language-server](https://github.com/emacs-grammarly/unofficial-grammarly-language-server).
10+
`lsp-mode` client leveraging [grammarly-language-server](https://github.com/emacs-grammarly/grammarly-language-server).
1011

1112
<p align="center"><img src="./etc/screenshot.png"/></p>
1213

@@ -18,10 +19,6 @@
1819
- [📇 Commands](#📇-commands)
1920
- [🔧 Configuration](#🔧-configuration)
2021
- [📝 Roadmap](#📝-roadmap)
21-
- [💸 Using a Paid Grammarly Account](#💸-using-a-paid-grammarly-account)
22-
- [🔍 Method 1: Login with VSCode (easier)](#🔍-method-1-login-with-vscode-easier)
23-
- [🔍 Method 2: Login with Emacs (a bit complicated)](#🔍-method-2-login-with-emacs-a-bit-complicated)
24-
- [Authentication from Grammarly website](#authentication-from-grammarly-website)
2522
- [Contribute](#contribute)
2623

2724
<!-- markdown-toc end -->
@@ -38,6 +35,9 @@
3835

3936
## 📇 Commands
4037

38+
> ⚠️ We are moving to the newer grammarly-language-server that uses the official
39+
> API. Some features are disabled for now, but we will later add them back.
40+
4141
List of commands interact with `language server` and `Grammarly.com`.
4242

4343
| Commands | Description |
@@ -51,83 +51,49 @@ List of commands interact with `language server` and `Grammarly.com`.
5151
## 🔧 Configuration
5252

5353
`lsp-grammarly` supports following configuration. Each configuration is described in
54-
detail in [Grammarly Settings](https://github.com/emacs-grammarly/unofficial-grammarly-language-server#extension-settings).
55-
56-
* `grammarly.autoActivate` via `lsp-grammarly-auto-activate`
57-
* `grammarly.audience` via `lsp-grammarly-audience`
58-
* `grammarly.dialect` via `lsp-grammarly-dialect`
59-
* `grammarly.domain` via `lsp-grammarly-domain`
60-
* `grammarly.emotions` via `lsp-grammarly-emotions`
61-
* `grammarly.goals` via `lsp-grammarly-goals`
62-
* `grammarly.userWords` via `lsp-grammarly-user-words`
63-
* `grammarly.overrides` via `lsp-grammarly-override`
54+
detail in [Grammarly Extension Settings](https://github.com/emacs-grammarly/grammarly-language-server/blob/main/extension/package.json).
55+
56+
* `grammarly.patterns` via `lsp-grammarly-patterns`
57+
* `grammarly.selectors` via `lsp-grammarly-selectors`
58+
* `grammarly.config.documentDialect` via `lsp-grammarly-dialect`
59+
* `grammarly.config.documentDomain` via `lsp-grammarly-domain`
60+
* `grammarly.config.suggestions.ConjunctionAtStartOfSentence` via `lsp-grammarly-suggestions-conjunction-at-start-of-sentence`
61+
* `grammarly.config.suggestions.Fluency` via `lsp-grammarly-suggestions-fluency`
62+
* `grammarly.config.suggestions.InformalPronounsAcademic` via `lsp-grammarly-suggestions-informal-pronouns-academic`
63+
* `grammarly.config.suggestions.MissingSpaces` via `lsp-grammarly-suggestions-missing-spaces`
64+
* `grammarly.config.suggestions.NounStrings` via `lsp-grammarly-suggestions-noun-strings`
65+
* `grammarly.config.suggestions.NumbersBeginningSentences` via `lsp-grammarly-suggestions-numbers-beginning-sentences`
66+
* `grammarly.config.suggestions.NumbersZeroThroughTen` via `lsp-grammarly-suggestions-numbers-zero-through-ten`
67+
* `grammarly.config.suggestions.OxfordComma` via `lsp-grammarly-suggestions-oxford-comma`
68+
* `grammarly.config.suggestions.PassiveVoice` via `lsp-grammarly-suggestions-passive-voice`
69+
* `grammarly.config.suggestions.PersonFirstLanguage` via `lsp-grammarly-suggestions-person-first-language`
70+
* `grammarly.config.suggestions.PossiblyBiasedLanguageAgeRelated` via `lsp-grammarly-suggestions-possibly-biased-language-age-related`
71+
* `grammarly.config.suggestions.PossiblyBiasedLanguageDisabilityRelated` via `lsp-grammarly-suggestions-possibly-biased-language-disability-related`
72+
* `grammarly.config.suggestions.PossiblyBiasedLanguageFamilyRelated` via `lsp-grammarly-suggestions-possibly-biased-language-family-related`
73+
* `grammarly.config.suggestions.PossiblyBiasedLanguageGenderRelated` via `lsp-grammarly-suggestions-possibly-biased-language-gender-related`
74+
* `grammarly.config.suggestions.PossiblyBiasedLanguageHumanRights` via `lsp-grammarly-suggestions-possibly-biased-language-human-rights`
75+
* `grammarly.config.suggestions.PossiblyBiasedLanguageHumanRightsRelated` via `lsp-grammarly-suggestions-possibly-biased-language-human-rights-related`
76+
* `grammarly.config.suggestions.PossiblyBiasedLanguageLgbtqiaRelated` via `lsp-grammarly-suggestions-possibly-biased-language-lgbtqia-related`
77+
* `grammarly.config.suggestions.PossiblyBiasedLanguageRaceEthnicityRelated` via `lsp-grammarly-suggestions-possibly-biased-language-race-ethnicity-related`
78+
* `grammarly.config.suggestions.PossiblyPoliticallyIncorrectLanguage` via `lsp-grammarly-suggestions-possibly-politically-incorrect-language`
79+
* `grammarly.config.suggestions.PrepositionAtTheEndOfSentence` via `lsp-grammarly-suggestions-preposition-at-the-end-of-sentence`
80+
* `grammarly.config.suggestions.PunctuationWithQuotation` via `lsp-grammarly-suggestions-punctuation-with-quotation`
81+
* `grammarly.config.suggestions.ReadabilityFillerwords` via `lsp-grammarly-suggestions-readability-fillerwords`
82+
* `grammarly.config.suggestions.ReadabilityTransforms` via `lsp-grammarly-suggestions-readability-transforms`
83+
* `grammarly.config.suggestions.SentenceVariety` via `lsp-grammarly-suggestions-sentence-variety`
84+
* `grammarly.config.suggestions.SpacesSurroundingSlash` via `lsp-grammarly-suggestions-spaces-surrounding-slash`
85+
* `grammarly.config.suggestions.SplitInfinitive` via `lsp-grammarly-suggestions-split-infinitive`
86+
* `grammarly.config.suggestions.StylisticFragments` via `lsp-grammarly-suggestions-stylistic-fragments`
87+
* `grammarly.config.suggestions.UnnecessaryEllipses` via `lsp-grammarly-suggestions-unnecessary-ellipses`
88+
* `grammarly.config.suggestions.Variety` via `lsp-grammarly-suggestions-variety`
89+
* `grammarly.config.suggestions.Vocabulary` via `lsp-grammarly-suggestions-vocabulary`
6490

6591
## 📝 Roadmap
6692

6793
List of todos, but I have not got time to implement these features.
6894

6995
- [ ] Create another package that displays information from [Grammarly.com](https://www.grammarly.com/)
7096
(To display useful information, `score`, `readability`, `word counts`, etc).
71-
- [ ] Implement command `Ignore Grammarly Issue`.
72-
- [ ] Implement `diagnostics` and `severity` for configuration.
73-
74-
## 💸 Using a Paid Grammarly Account
75-
76-
> ***NOTE:** To login, make sure you have package [keytar](https://github.com/emacs-grammarly/keytar)
77-
set up properly. See [keytar#installation](https://github.com/emacs-grammarly/keytar#installation)
78-
for setup instruction.*
79-
80-
You can either login with [vscode-grammarly](https://marketplace.visualstudio.com/items?itemName=znck.grammarly)
81-
using VSCode or hit `M-x lsp-grammarly-login`. They both share the same credentials
82-
so you can login with either side.
83-
84-
### 🔍 Method 1: Login with VSCode (easier)
85-
86-
Install VSCode and install extension [vscode-grammarly](https://marketplace.visualstudio.com/items?itemName=znck.grammarly)
87-
from the extension panel.
88-
89-
<p align="center"><img src="./etc/login/vscode-grammarly-extension.png"/></p>
90-
91-
Then call command palette (default to <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>p</kbd>)
92-
and type to search `grammarly login` command.
93-
94-
<p align="center"><img src="./etc/login/vscode-grammarly-login.png"/></p>
95-
96-
You should see [Grammarly Website](#authentication-from-grammarly-website) and
97-
login with your Grammarly account.
98-
99-
<p align="center"><img src="./etc/login/open-app-vscode.png"/></p>
100-
101-
🎉 Make sure you click on the button `Open Visual Studio Code`. Done! You
102-
can now close VSCode and go back to Emacs!
103-
104-
### 🔍 Method 2: Login with Emacs (a bit complicated)
105-
106-
Hit `M-x lsp-grammarly-login` and you should see the Grammarly's website pop out
107-
from your favorite browser. See below [screenshot](#authentication-from-grammarly-website),
108-
109-
After login, click the button `Open URL:vscode`, If you have VSCode installed, then
110-
this button would be `Open Visual Studio Code` instead yet it doesn't matter.
111-
112-
<p align="center"><img src="./etc/login/open-url-vscode.png"/></p>
113-
114-
Then click <kbd>F12</kbd> to open the DevTool window. You should able to see
115-
an URI like the following
116-
117-
<p align="center"><img src="./etc/login/external-handler.png"/></p>
118-
119-
Copy and paste the URI back to Emacs and hit return.
120-
121-
<p align="center"><img src="./etc/login/emacs-paste.png"/></p>
122-
123-
🎉 Done! Now you should be loggin!
124-
125-
### Authentication from Grammarly website
126-
127-
Login with your Grammarly account (This step does not require VSCode to be
128-
installed)!
129-
130-
<p align="center"><img src="./etc/login/grammarly-website.png"/></p>
13197

13298
## Contribute
13399

0 commit comments

Comments
 (0)