Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get this package work with Grammarly premium. #50

Open
ffsammak opened this issue Apr 25, 2023 · 17 comments
Open

How to get this package work with Grammarly premium. #50

ffsammak opened this issue Apr 25, 2023 · 17 comments

Comments

@ffsammak
Copy link

Hi,
Thank you for this project to get Grammarly to work inside Emacs. Please, bear with me on my questions. How can you install Grammarly-language-server in the first place? When I follow the link, it directs me to another page that mentions Grammarly for VSCode. I am confused, do I need to install VSCode on my Ubuntu 22.04 machine to get the server working?
I appreciate your help in explaining the installation on Ubuntu 22.04.

@jcs090218
Copy link
Member

The language server is here, emacs-grammarly/grammarly-language-server.

To install server just M-x lsp-install-server, and select grammarly-ls.

I am confused, do I need to install VSCode on my Ubuntu 22.04 machine to get the server working?

Yeah, sorry for the confusion. You don't need to install VSCode. For the reason why, see #40 (comment). With the current state of the language server, it's tough to tell weather the user are using the premium version or not.

@ffsammak
Copy link
Author

ffsammak commented Apr 25, 2023

Thanks for your quick reply. I have the code below in my init.el:

(use-package lsp-grammarly
  :straight (lsp-grammarly
	     :host github
	     :repo "emacs-grammarly/lsp-grammarly"
	     :branch "master")
  :hook (text-mode . (lambda ()
                       (require 'lsp-grammarly)
                       (lsp))))

when I launch Emacs, I get a message in the mini-buffer: Building lsp-grammarly -> Cloning lsp-mode...
it will be there forever.

To install server just M-x lsp-install-server, and select grammarly-ls.

I don't see lsp-install-server on my end. What am I missing? In the Grammarly-language-servere page, it says: this project relies on pnpm

pnpm install
pnpm run build

How can I install pnpm on Ubuntu 22.04?

I am now trying:

wget -qO- https://get.pnpm.io/install.sh | sh -
.... in progress...

@jcs090218
Copy link
Member

I don't see lsp-install-server on my end. What am I missing?

That's from lsp-mode. Make sure you have installed lsp-mode before calling the command.

In the Grammarly-language-servere page, it says: this project relies on pnpm

You don't need to install pnpm, its for development only. All you need is node.js and lsp-mode.


If you are using straight.el to install packages, it's better to open the issue there.

@ffsammak
Copy link
Author

If you are using straight.el to install packages, it's better to open the issue there.

sorry for bothering you with my comments. It finally worked without doing anything. I just had to wait for the cloning process; it took a while. Then I was prompted to install the Grammarly server, I typed yes, and everything went fine.

@ffsammak
Copy link
Author

ffsammak commented Apr 25, 2023

Now when I start to test, I get this error from Grammarly server:
Error: Cannot find module 'node:perf_hooks. Require stack: I found this error message in the grammarly-ls::stderr buffer
I have Node.js v12.22.9.
I really appreciate your help.

@jcs090218
Copy link
Member

The language server requires v16. You might need to upgrade to node 16.

@ffsammak
Copy link
Author

The language server requires v16. You might need to upgrade to node 16.

Did it, finally it worked. But I am lost now, I find markings in the fringe, on the words, but how to get suggestions?

@ffsammak
Copy link
Author

With the current state of the language server, it's tough to tell weather the user are using the premium version or not.

I have a premium account in Grammarly. I would be glad to develop a test sentence to tell the difference, whether it is a premium or not. But off the top of my head, plagiarism is only supported in the premium. Can this be tested using lsp-grammarly?

@jcs090218
Copy link
Member

Did it, finally it worked. But I am lost now, I find markings in the fringe, on the words, but how to get suggestions?

I am using sideline with sideline-lsp backend. Another choice is lsp-ui.

@ffsammak
Copy link
Author

ffsammak commented Apr 25, 2023

Did it, finally it worked. But I am lost now, I find markings in the fringe, on the words, but how to get suggestions?

I am using sideline with sideline-lsp backend. Another choice is lsp-ui.

lsp-ui is working great. Thanks. I have a problem with the map keybinding for the lsp-mode, C-c l is suggested in this website:

(setq lsp-keymap-prefix "C-c l") will interfere with org-store-link command, what do you suggest using instead?

@ffsammak
Copy link
Author

ffsammak commented Apr 25, 2023

I found some a keybinding:

(use-package lsp-mode
  :straight (lsp-mode
	     :host github
	     :repo "emacs-lsp/lsp-mode"
	     :branch "master")
  :init
  (setq lsp-keymap-prefix "C-'")
  :bind-keymap
  ("C-'" . lsp-command-map)
  :hook ((lsp-mode . lsp-enable-which-key-integration)
	 )
  :commands lsp
  )

But is it safe to use lsp-grammarly-login? It will try to connect to Grammarly account.

image

@ffsammak
Copy link
Author

I get this error:

LSP :: Error from the Language Server: Unhandled method $/resume (Method not Found)
LSP :: Error from the Language Server: Request initialize failed with message: request to https://js.grammarly.com/grammarly-sdk@2.3 failed, reason: connect ETIMEDOUT 108.139.79.15:443 (Internal Error)
LSP :: Error from the Language Server: Unhandled method $/resume (Method not Found)

What does that mean?

@ffsammak
Copy link
Author

if you write:

Would you borrow me your umbrella?

Does is suggest to you to replace borrow with lend? This is how fluency is checked in Grammarly.

@jcs090218
Copy link
Member

What does that mean?

It seems like they have changed the protocol calls, let me find time to fix it. 🤔

Does is suggest to you to replace borrow with lend? This is how fluency is checked in Grammarly.

Got it! Thanks for sharing the experiment result.


Since only I work on the whole emacs-grammarly, it would be nice if experienced people would like to be one of the core developers. ;)

@ffsammak
Copy link
Author

ffsammak commented Apr 27, 2023

f you write:

Would you borrow me your umbrella?

Does is suggest to you to replace borrow with lend? This is how fluency is checked in Grammarly.

This is just to make sure we are on the same page. This is how to check whether you have premium account features working or not inside Emacs. If it suggests to you to do the replacement, then you know this is premium. From what I have experienced so far, I get only basic suggestions. Premium is not working. So back to my original question, thanks to your guidance and help to let me reach this point, how to get the premium kick in?

@ffsammak
Copy link
Author

ffsammak commented Apr 27, 2023

But is it safe to use lsp-grammarly-login? It will try to connect to Grammarly account.

image

When I hit the green button in the browser of "Continue" I get an error like this:

Screenshot from 2023-04-27 10-13-34

Brave Browser Version 1.50.125 Chromium: 112.0.5615.165 (Official Build) (64-bit)

@anajuliabit
Copy link

anajuliabit commented Aug 16, 2023

I have the same problem as @ffsammak while attempting to log in to Grammarly.
Any updates?

Invalid redirect URI
Error: KIwcQYFYgq

update: I was able to log in using VS Code by following the instructions on README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants