gtarawneh / languagetool-sublime

Proof-reading and grammar checker for English, French, German, Polish and 20+ other languages
73 stars 13 forks source link

[Bug] Don't move between spellcheckings results #12

Open Kristinita opened 8 years ago

Kristinita commented 8 years ago

Description

It does not always move between spellchekings results.

Steps to reproduce

I run LanguageTool in this file. Ctrl+Shift+PLanguageTool: Check Text → I moved between problems via Alt+↑ and Alt+↓. Sometimes I succeed, sometimes not obtained.

key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
Traceback (most recent call last):
  File "E:\Sublime Text 3\sublime_plugin.py", line 568, in run_
    return self.run(edit, **args)
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\LanguageTool.sublime-package", line 116, in run
IndexError: list index out of range
key evt: alt+up
command: goto_next_language_problem {"jumpForward": false}
key evt: alt+up
command: goto_next_language_problem {"jumpForward": false}
key evt: alt+up
command: goto_next_language_problem {"jumpForward": false}
Traceback (most recent call last):
  File "E:\Sublime Text 3\sublime_plugin.py", line 568, in run_
    return self.run(edit, **args)
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\LanguageTool.sublime-package", line 122, in run
IndexError: list index out of range

Environment

Windows 10 Sublime Text Build 3114

Thanks.

Kristinita commented 8 years ago

@gtarawneh, problem is actually in Build 3124. Thanks.

gtarawneh commented 8 years ago

@Kristinita I just published v0.2.3 which should be available on Package Control shortly. Once you update, can you please check whether this problem still exists?

Kristinita commented 8 years ago

@gtarawneh After update LanguageTool not worked for me. Ctrl+Shift+PLanguageTool: Check Text → I saw message in status bar:

could not parse server response (may be due to quota if using http://languagetool.org)

Status Bar Language Tool

Stack trace in terminal:

 C:\WINDOWS\system32>java -jar e:/LanguageTool/languagetool.jar
 Setting up thread pool with 10 threads
 Starting LanguageTool 3.4 (build date: 2016-06-27 09:04) server on http://localhost:8081...
 Server started
 2016-09-23 07:28:39 An error has occurred, sending HTTP code 400. Access from 127.0.0.1, text length 1984. HTTP user agent: Python-urllib/3.3, Stacktrace follows:
 java.lang.IllegalArgumentException: 'auto' is not a language code known to LanguageTool. Supported language codes are: ast-ES, be-BY, br-FR, ca-ES, ca-ES-valencia, da-DK, de, de-AT, de-CH, de-DE, de-DE-x-simple-language, el-GR, en, en-AU, en-CA, en-GB, en-NZ, en-US, en-ZA, eo, es, fa, fr, gl-ES, is-IS, it, ja-JP, km-KH, lt-LT, ml-IN, nl, pl-PL, pt, pt-BR, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sv, ta-IN, tl-PH, uk-UA, xx-XX, zh-CN. The list of languages is read from META-INF/org/languagetool/language-module.properties in the Java classpath. See http://wiki.languagetool.org/java-api for details.
         at org.languagetool.Languages.getLanguageForShortName(Languages.java:153)
         at org.languagetool.server.V1TextChecker.getLanguage(V1TextChecker.java:110)
         at org.languagetool.server.TextChecker.checkText(TextChecker.java:87)
         at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:130)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
         at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
         at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
         at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

Ctrl+Shift+PLanguage Tool: Change Language → I select, for example, English (American) → I restart Sublime Text and Language Tool → the problem remains the same.

Thanks.

gtarawneh commented 8 years ago

@Kristinita LanguageTool switched to a new API so your server setting in Sublime must be changed to: "languagetool_server": "http://localhost:8081/v2/check"

Kristinita commented 8 years ago

I change my server setting, but problem still exists 😿:

key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
Traceback (most recent call last):
  File "E:\Sublime Text 3\sublime_plugin.py", line 812, in run_
    return self.run(edit, **args)
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 116, in run
IndexError: list index out of range
Kristinita commented 8 years ago

Problem remained on 02.10.2016 version. My file: https://gist.github.com/Kristinita/f340edbe3c2478ac4c3babfe2da2b625:

key evt: alt+down
command: goto_next_language_problem {"jumpForward": true}
Traceback (most recent call last):
  File "E:\Sublime Text 3\sublime_plugin.py", line 812, in run_
    return self.run(edit, **args)
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 114, in run
IndexError: list index out of range

Language Tool stack trace

gtarawneh commented 8 years ago

@Kristinita I ran a language check on this file but did not experience any issues when moving between problems. This might be because of an interaction with the markdown plugin you're using. I'll install it and test again within the next few days.

Kristinita commented 8 years ago

@gtarawneh, I engaged in debugging and I find cause.

  1. Please, install SublimeBookmark plugin.
  2. Create in any line of any text one bookmark use SublimeBookmark: Ctrl+Shift+PSublimeBookmarks: Add Bookmark.
  3. Run LanguageTool in, for example, in https://gist.github.com/a1deddf4c8a7fb84b7435ef3c5ec0996 file and move between errors use Alt+↑ and Alt+↓ . You must get stack trace as me.

Thanks.