Author Topic: SpellChecker plugin  (Read 156571 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SpellChecker plugin
« Reply #15 on: July 15, 2010, 03:08:46 pm »
I'd like to see this plugin added to contrib too!

Me too  :D
I also agree!!! This is a great plugin!!!

I have some problem to enable the "online spell check", in fact, I can't enable the "online spell check".

Here are the steps:
1, check out the trunk code to the "E:\code\cb\cc_branch\src\plugins\contrib\spellcheck", and apply laube's patch
2, open SpellChecker.cbp and build it.
3, run the update.bat, download the language file from: English (United States)
4, run the CB under output folder.

Then set the directory folder correctly. see:


but I can only select some text, then use the context menu "spell..."
See:


Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline laube

  • Single posting newcomer
  • *
  • Posts: 3
Re: SpellChecker plugin
« Reply #16 on: July 15, 2010, 03:23:31 pm »
I cannot reproduce this bug. I am testing it with svn6386 Code::Blocks with no modifications to the C::B code.

Does it work with the trunk code without the patch?

Maybe I did something wrong with the scintilla events.
I am new to scintilla and threw something together to make it work faster for me.
One problem with the code is that when multiple wxEVT_SCI_MODIFIED events arrive before the next wxEVT_SCI_UPDATEUI event, the stored update regions can get out of sync with the editor. (and thus some words are not checked correctly) Is there a way we can set markers that stay in sync with the editor?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SpellChecker plugin
« Reply #17 on: July 15, 2010, 04:05:10 pm »
I cannot reproduce this bug. I am testing it with svn6386 Code::Blocks with no modifications to the C::B code.

Does it work with the trunk code without the patch?

thanks for your reply.
I have tested under the latest CC_branch.

If not applied your patch, there is a build error, around line: 72 of SpellCheckerPlugin.cpp

should be:

Code
#ifdef CB_STATUS_BAR
    ,m_fld(NULL)
#endif

But I still can't enable the online spell. :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 205
Re: SpellChecker plugin
« Reply #18 on: July 15, 2010, 07:30:01 pm »
@laube:
Thanks for your patch.
Since I had similar issues (slow down of scrolling made me ... arrgh! ) I tried a different approach: to only check the visible lines but never came to a working version (no event which showed that the range visible changed) the "OccurrenceHighlighter"(http://forums.codeblocks.org/index.php/topic,12569.msg85128.html#msg85128) is a side effect of these experiments (and not working correctly... yet). I will test your patch and give you feedback.

@ollydbg:
When building this plugin using C::B worspace .. it creates this directory:

CodeBlocksSVN\src\devel\share\CodeBlocks\SpellChecker
with one xml file.
Then I run update.bat (using WinXP), which should copy this directory into "output" folder ... but this does not happens .. is this only my problem? Without this configuration file is plugin not functional.
...
The xml file is named "OnlineSpellChecking.xml" and contains a list of indices (to check in) for every lexer-language.


regards,

danselmi
« Last Edit: July 21, 2010, 11:09:43 pm by danselmi »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SpellChecker plugin
« Reply #19 on: July 16, 2010, 01:49:37 am »

@ollydbg:
When building this plugin using C::B worspace .. it creates this directory:

CodeBlocksSVN\src\devel\share\CodeBlocks\SpellChecker
with one xml file.
Then I run update.bat (using WinXP), which should copy this directory into "output" folder ... but this does not happens .. is this only my problem? Without this configuration file is plugin not functional.
...
The xml file is named "OnlineSpellChecking.xml" and contains a list of indices (to check in) for every lexer-language.


regards,

danselmi


Thanks for the help, it works now. So we need to copy the folder (containing  "OnlineSpellChecking.xml" )
from
E:\code\cb\cc_branch\src\devel\share\CodeBlocks\SpellChecker
to
E:\code\cb\cc_branch\src\output\share\CodeBlocks\SpellChecker

 :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2808
Re: SpellChecker plugin
« Reply #20 on: July 16, 2010, 02:39:22 pm »

Thanks for the help, it works now. So we need to copy the folder (containing  "OnlineSpellChecking.xml" )
from
E:\code\cb\cc_branch\src\devel\share\CodeBlocks\SpellChecker
to
E:\code\cb\cc_branch\src\output\share\CodeBlocks\SpellChecker

 :D


There used to be a couple of lines in the update.bat that copied all .exe's and all .dll's from \devel\... and contribs to \output\...

But those lines were removed. It was declared that every plugin should execute its own update.bat in its post build step.

This really causes a mess. The plugin is now responsible for  creating the ...\src\output folder chain in its prebuild or postbuild step if the ...\src\output folder chain doesn't exist yet.

This happens when CB is first built, or when ...\src\output is deleted before CB is re-built in order to get a completely clean \output build.
 
« Last Edit: July 16, 2010, 02:55:14 pm by Pecan »

oleg_kaa

  • Guest
Re: SpellChecker plugin
« Reply #21 on: August 05, 2010, 10:42:13 am »
A plugin to spell check comments in source codes can be found here: http://svn.berlios.de/svnroot/repos/spellchecker/trunk .
Could you build dll plugin for codeblocks-10.05 windows xp 32bit?

Offline Cryogen

  • Regular
  • ***
  • Posts: 260
Re: SpellChecker plugin
« Reply #22 on: August 31, 2010, 05:15:00 pm »

 Hi danselmi,

SpellChecker is looking good. Thanks. :-)

Feature request:
Please make the Dictionaries and Thesauri fields full width so we can see what's in them. These fields should be manually editable, too.

Bug report:
The compiler complains about auto-importing occurring without being enabled.

Code
||warning: auto-importing has been activated without --enable-auto-import specified on the command line.|
||Info: resolving TiXmlString::nullrep_       by linking to __imp___ZN11TiXmlString8nullrep_E |
||Info: resolving vtable for TiXmlDocument by linking to __imp___ZTV13TiXmlDocument |
||Info: resolving vtable for wxDialogHelper by linking to __imp___ZTV14wxDialogHelper |
||Info: resolving vtable for wxScrollingDialog by linking to __imp___ZTV17wxScrollingDialog |

You can fix this by adding:

-Wl,--enable-auto-import

to the linker settings' "Other linker options:" for the "plugin" target.

Cheers,

  Cryo.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 205
Re: SpellChecker plugin
« Reply #23 on: September 09, 2010, 01:15:03 am »
Hi

Thanks for your feedbacks. It now has the fields full width and editable.
By the way, has anybody tested the "cbStatusBar" patch?


regards,

danselmi

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: SpellChecker plugin
« Reply #24 on: September 09, 2010, 06:07:51 am »
By the way, has anybody tested the "cbStatusBar" patch?
I am using it literally since day one. ;-) No issues, except that for the spellchecker the field is always too small for me and instead of "en-EN" I see "en-". Also, it looks a bit ugly as the statusbar has a grey background, but the label is on white background.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

mariocup

  • Guest
Re: SpellChecker plugin
« Reply #25 on: September 09, 2010, 08:53:44 am »
Hi,

yes I prefered using the statusbar patch, since it is very easy to switch between different languages. BTW I would prefer to have the status bar more interactive like in other IDEs.

For example the statusbar patch could be used to switch between different character encodings or even to enable block select mode. I think that some features in Code::Blocks are really hidden. For example if you don't know the shortcut for block select mode you will never find it out. The other nice context menu Aligner is not really obvious. It would be better to add an icon for this purpose too.


Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5514
Re: SpellChecker plugin
« Reply #26 on: September 09, 2010, 09:56:01 am »
how about a commit of that status bar patch on trunk, cc, debug ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: SpellChecker plugin
« Reply #27 on: September 09, 2010, 10:12:44 am »
how about a commit of that status bar patch on trunk, cc, debug ?
Without any use as of e.g. the SpellChecker plugin you won't see much difference. Also I remember that danselmi ones said it's only a feasibility study.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

mariocup

  • Guest
Re: SpellChecker plugin
« Reply #28 on: September 09, 2010, 12:30:58 pm »
Hi MortenMacFly,

I agree that it only makes sense if the feature is really used. Therefore we should think about what could be easier or reasonable if the status bar offers such a functionality.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: SpellChecker plugin
« Reply #29 on: September 09, 2010, 12:39:43 pm »
Therefore we should think about what could be easier or reasonable if the status bar offers such a functionality.
True. I would (however) wait for danselmi's answer on that topic concerning the readiness:
Also I remember that danselmi ones said it's only a feasibility study.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ