gtarawneh / languagetool-sublime

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

Output information in the console #8

Closed Kristinita closed 8 years ago

Kristinita commented 8 years ago

I offer an option that users of your plugin could receive output information on mistakes in the Ctrl+' console, but not in Status Bar. Not default, but option.

Reasons:

  1. From the Status Bar not copied words. I can't be copy and paste into the program for the translation, If I do not understand the meaning of words in the Status Bar.
  2. In the words of Status Bar visible for ~3 seconds. It is not enough to have time to read it. In the console, the words are always visible to the closure of Sublime Text.

Thanks.

gtarawneh commented 8 years ago

@Kristinita I added an option to display problems in a panel, can you check and let me know what do you think? The option is currently enabled by default.

Kristinita commented 8 years ago

@gtarawneh, many bugs for me.

  1. When I start LanguageTool: Check Text in one file, there is this:
Traceback (most recent call last):
  File "E:\Sublime Text 3\sublime_plugin.py", line 574, in run_
    return self.run(edit)
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 261, in run
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 48, in selectProblem
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 67, in showProblem
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 76, in showProblemPanel
  File "LanguageTool in E:\Sublime Text 3\Data\Installed Packages\languagetool-sublime.sublime-package", line 90, in showPanelText
TypeError: begin_edit() missing 2 required positional arguments: 'edit_token' and 'cmd'


  1. When I start LanguageTool: Check Text in other file, in Status Bar there a message:

error, enable to connect via http, is languagetool running?

And LanguageTool not checking text.

  1. Not work LanguageTool: Clear Problems for me.

    Windows 10 Education, Sublime Text 3 Build 3114.
    Thanks.
gtarawneh commented 8 years ago

@Kristinita Sorry there were apparently some compatibility issues with ST3, can you test again?

Kristinita commented 8 years ago

@gtarawneh , 1 and 3 solved, thanks!

Problem 2 I have stayed. I can not check my long texts 1100+ lines and more, I get error, enable to connect via http, is languagetool running? in my Status Bar. Shorter texts, for example, in 400 lines are scanned normally. Perhaps there is some limit on the length of the text. If this is so, then, in my opinion, it must be specified in the documentation.

gtarawneh commented 8 years ago

@Kristinita Thanks for letting me know. Problem 2 is caused by a limitation of the public LanguageTool server (I updated the readme file to stress this).

You can check larger texts if you download and run a local copy of LanguageTool (in the LanguageTool GUI, press Ctrl+s to open the Options dialog then check Run as server on port 8081. Afterwards add the line "languagetool_server": "http://localhost:8081/" in your user settings file.)

Hope that helps.

Kristinita commented 8 years ago

@gtarawneh, I install and open Stand-Alone LanguageTool for Desktop:

E:\LanguageTool>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

Text CheckingOptions → check Run as server on port 8081.

Run as server

PackageResourceViewer: Open ResourceLanguage ToolLanguageTool.sublime-settings → I commented out the first line and second line uncommented, my LanguageTool.sublime-settings file looks like this:

{
    // "languagetool_server": "https://languagetool.org:8081/" //limited to 20 calls per minute
    "languagetool_server": "http://localhost:8081/" // local server
    ,"display_mode": "panel"
}

I run your plugin in my file to size 75 KB:

key evt: control+alt+l
command: language_tool

But in Status Bar still error, enable to connect via http, is languagetool running? On my 27 KB file LanguageTool work is good.

What do I do incorrectly?

Thanks.

gtarawneh commented 8 years ago

@Kristinita looks like one of the recent LanguageTool updates slightly changed their API causing the plugin to break. I made a slight change to fix this and it should work fine now.

Kristinita commented 8 years ago

@gtarawneh, yes, now all right!

e:\LanguageTool>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-08-09 11:54:52 Check done: 55907 chars, ru-RU[auto], null, handlers:1, 2409 matches, 16454ms, class: V1TextChecker, agent:-, sent

Whether and it is possible to make so that it wasn't necessary to start a terminal when I want to make spell check to the big file? For example, to add the LanguageTool command to Command Palette LanguageTool: Start Server.

Thanks.

gtarawneh commented 8 years ago

@Kristinita there's no easy way to start LanguageTool from Sublime without knowing where it's installed. I'll do some research and see if I can do something about it though (maybe enable users to specify the path manually). Thanks for the suggestion.