vigoux / languagetool.nvim Goto Github PK
View Code? Open in Web Editor NEWAn asynchronous grammar checker for Neovim using LanguageTool
License: Other
An asynchronous grammar checker for Neovim using LanguageTool
License: Other
Describe the bug
[asciinema recording](https://asciinema.org/a/UlOAZC57ACUlVAAXCm2RcaElw
When running check it first it correctly spots a capitalisation error, but it does not spot a misspelling error. When I run check again after fixing misspelling error it catches the error
)To Reproduce
Steps to reproduce the behavior:
Expected behavior
two errors to appear
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
NVIM v0.5.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by nixbld
using commit hash 809e7d77fec834597f495fec737c59292a10025b
Hello, I've been trying to migrate from https://github.com/dpelle/vim-LanguageTool to this, and to set it up with the arch package, I just had this.
let g:languagetool_cmd='/usr/bin/languagetool'
let g:languagetool_lang="en-US"
I tried to read the documentation for this plugin and thought it was a simple:
let g:languagetool_server_command='/usr/bin/languagetool'
and do :LanguagetoolSetUp, however this have given me the error that I haven't started the server. I'm a bit confused on this and would appropriate the help.
I'm trying to get LanguageTool working with it installed locally on my system. which languagetool
outputs /usr/bin/languagetool
and so I put let g:languagetool_server_command='/usr/bin/languagetool'
in my init.vim
. After running :LanguageToolSetUp
(which gave no response after running it btw), running :LanguageToolCheck
I get a bunch of errors, including "LanguageTool server not started, please run :LanguageToolSetUp
" which I'm guessing is the reason for the rest of the following errors:
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported[2]..LanguageTool#server#get[1]..LanguageTool#server#send_sync:
line 2:
LanguageTool server not started, please run :LanguageToolSetUp
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported:
line 5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[10]..LanguageTool#languages#findLanguage
[11]..<SNR>235_languageIsSupported:
line 5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[12]..LanguageTool#languages#findLanguage
[5]..<SNR>235_languageIsSupported:
line 5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup[12]..LanguageTool#languages#findLanguage
[11]..<SNR>235_languageIsSupported:
line 5:
E714: List required
Error detected while processing function LanguageTool#check[3]..LanguageTool#config#get[2]..LanguageTool#config#setup:
line 14:
Failed to guess language from spelllang=[en] or from v:lang=[en_GB.UTF-8]. Defaulting to English (en-US). See ":help LanguageTool" regarding setting language
in g:languagetool.
Error detected while processing function LanguageTool#check[18]..LanguageTool#server#check[9]..LanguageTool#server#send:
line 2:
LanguageTool server not started, please run :LanguageToolSetUp
line 13:
E121: Undefined variable: s:lt_server_started
E15: Invalid expression: s:lt_server_started
What am I doing wrong?
Thanks for the work!
I installed in plugin with MacVim and experienced some problems. Since the name of the plugin is "LanguageTool.nvim", does it mean that it only supports neovim?
Describe the bug
I have a weird issue with getting LanguageTool to point out spelling errors. The only way I can get it to highlight them is like this:
> nvim test.md
:LanguageToolCheck
(throws an error):LanguageToolSetUp
:LanguageToolCheck
The test.md
file contains the following:
This plugn can uses job feature on Vim 8.0.27 (or later) or Neovim. It's enable asynchronous comand executin so you dont need to be blcked untill the check have been done on Vim8+ or Neovim.
If I skip step 2 the spelling errors are not discovered LanguageTool, and it only points out the "dont" (which is a grammar error) and nothing else. They don't show up in :LanguageToolSummary
either.
This is my init.vim
:
call plug#begin('~/.vim/bundle')
Plug 'vigoux/LanguageTool.nvim'
call plug#end()
let g:languagetool_server_command = '/usr/bin/languagetool --http'
To Reproduce
Follow the steps described above, but skip step 2.
Expected behavior
Spelling errors are highlighted without doing step 2.
Screenshots
When all four steps are followed:
I'm on Arch Linux.
nice work, I am always waiting for a nice vim plugin for language-tool, but no one is perfect.
First suggestion is could you specify that languagetool-server.jar
is needed, not languagetool-server
? MacOS's brew offer a languagetool-server cli when you brew install languagetool
. It will save time to config.
Second suggestion is that when you do LanguageToolCheck
, a java app is started and a java docker icon appear. Could we avoid this?
Third suggestion is that could you do some test on other language, for example Japanese, due to some coding problem, not every languagetool vim plugin can show the result correctly. I try this plugin, and I can not highlight for some problem and I can not jump to problem text block correctly.
Describe the bug
This plugin works fine for small toy text, such as the following:
just for an test.
But for real Markdown file, when I use :LanguageToolCheck
, after several minutes, I get errors when I invoke the :LanguageToolSummary
command. I guess it is because the previous command hasn't produced the result the latter command needs.
To Reproduce
Steps to reproduce the behavior:
set runtimepath+=/Users/jdhao/.local/share/nvim/plugged/LanguageTool.nvim
let g:languagetool_server_jar="/usr/local/opt/languagetool/libexec/languagetool-server.jar"
test.md
containing text here.:LanguageToolSetup
, followed by :LanguageToolCheck
:LanguageToolSummary
command to check the output.Expected behavior
A preview buffer is created to list all the found error for this file, but in
fact, I get the following error:
Error detected while processing function
LanguageTool#summary[1]
E121: Undefined variable: b:errors
E15: Invalid expression: b:errors
line 13:
E121: Undefined variable: l:errors
E116: Invalid arguments for function LanguageTool#ui#displayInWindow
I am not sure if this is an issue with languagetool or this plugin.
Desktop (please complete the following information):
vim-grammarous is a good plugin in theory, its features are fairly nice, but it just was littered with bugs when I tried to use it. Having the ability to autofix errors by pressing 'f' would bring this closer to feature parity with grammarous. Looking at my errors a lot of the time the fix I want is the first one, so having to just move to the error and pressing 'f' on either window would be nice.
This feature would ideally autorefresh with the fixed error then disappearing. Although with slow reading times i'm not sure how plausible this would be.
I am trying to use this plugin with a document in French, but I cannot change the language and I cannot list the supported languages either. When I do :LanguageToolSupportedLanguages
, I get the following (in French, because my system is in Fr):
Erreur détectée en traitant function LanguageTool#languages#supportedLanguages :
ligne 8 :
E714: Liste requise
And if I try :LanguageToolCheck! french
, I get :
Erreur détectée en traitant function LanguageTool#check[9]..LanguageTool#languages#findLanguage[5]..<SNR>35_languageIsSupported :
ligne 5 :
E714: Liste requise
Erreur détectée en traitant function LanguageTool#check[9]..LanguageTool#languages#findLanguage[11]..<SNR>35_languageIsSupported :
ligne 5 :
E714: Liste requise
Other commands seem to be working (but in English then).
I am using Languagetools 5.0
Thank you so much for this plugin, it would be so awesome if I was able to use it in other languages than English.
Describe the bug
asciicinema recording
when pressing f to fix on Summary window it returns an error as shown below
Error detected while processing function LanguageTool#errors#fix:
line 2:
E684: list index out of range: -21
E15: Invalid expression: a:error.replacements[a:sug_id].value
line 7:
E121: Undefined variable: l:fix
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context
NVIM v0.5.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by nixbld
using plugin commit 809e7d77fec834597f495fec737c59292a10025b
Hi everyone !
This issue will be tracking for the task of rewriting everything in lua. As this plugin focuses on Neovim, the rewrite will allow better performances and maybe more flexibility.
This may also allow us to leverage treesitter to simplify the markup/text extraction.
Describe the bug
Super weird. When I run :LanguageToolSetUp
Neovim returns that the server started. Then when I run :LanguageToolCheck
, swaylock
activates with a white lock screen. When I log in back again, another blank window has been created and if I close it on Neovim I receive the message:
Error detected while processing function LanguageTool#server#sendCallback:
line 2:
E474: Unidentified byte: Error: Could not parse JSON from 'data' parameter
If I try to use this plugin on LaTeX files, I can get to start the server but it doesn't detected any errors when I run :LanguageToolCheck
or :LanguageToolSummary
.
To Reproduce
Steps to reproduce the behavior:
:LanguageToolSetUp
:LanguageToolCheck
Expected behavior
The plugin to show the errors.
Desktop (please complete the following information):
NVIM v0.8.0-dev+11-gd3121f1e6-dirty
Describe the bug
asciicinema recording
Error detected while processing function LanguageTool#fixErrorAtPoint[1]..LanguageTool#errors#fix[1]..LanguageTool#errors#highlightRegex:
line 3:
E716: Key not present in Dictionary: "fromy == a:error.toy"
E15: Invalid expression: a:error.fromy == a:error.toy
line 17:
E121: Undefined variable: l:location_prefix
E15: Invalid expression: '\V' . l:location_prefix . '\<' . LanguageTool#errors#getText(a:error) . '\>\ze'
Error detected while processing function LanguageTool#fixErrorAtPoint[1]..LanguageTool#errors#fix:
line 2:
E716: Key not present in Dictionary: "replacements[a:sug_id].value"
E15: Invalid expression: a:error.replacements[a:sug_id].value
line 4:
E716: Key not present in Dictionary: "source_win)"
E116: Invalid arguments for function win_gotoid
line 7:
E716: Key not present in Dictionary: "fromy . ',' . a:error.toy . 's/' . l:location_regex . '/' . l:fix . '/'"
To Reproduce
Steps to reproduce the behavior:
:LanguageToolFixAtPoint
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
asciicinema above
Desktop (please complete the following information):
Additional context
NVIM v0.5.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by nixbld
using plugin commit 809e7d77fec834597f495fec737c59292a10025b
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.