Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Gryf on June 26, 2018, 06:51:35 am

Title: Spellchecker, SFML and linux
Post by: Gryf on June 26, 2018, 06:51:35 am
Hello,
I'have a problem with the spellchecker of codeblocks he had not the dictionnary (.dic and .aff) into his files, I had to download these files and copy them into the spellchecker folder.
But when I configured my project for use SFML I realized that the spellchecker don't work for the SFML.
I'm using archlinux, I think there is a rapport but I preferred post my message on this forum
Please I need help, it's very awkward to program without spellchecker.

PS : Excuse me for the mistakes in my text, I don't speak english very well
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 26, 2018, 08:48:37 am
I hope, you know that the spell checker works only in comments and string literals.
Generally you don't have to copy files, just install the myspell packages with pacman and then point the spell checker to the correct folder.
On my machine it is /usr/share/myspell.
Title: Re: Spellchecker, SFML and linux
Post by: BlueHazzard on June 26, 2018, 03:40:47 pm
Does it work on other porjects? Did it ever worked? Only for this project? What language?
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 26, 2018, 03:46:42 pm
Sorry but what it the myspell package (disctionnary, thesaurus or both) ?
If it's the dictionnary I didn't found package in pacman, I musted download it.

I did not test on other projects but on windows that work. I use C++ for my project
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 26, 2018, 04:37:00 pm
I guess aspell could work, too.
On my gentoo I use myspell and on centos 6 I use aspell.

On both the paths are set to /usr/share/myspell. I have all paths set to point to myspell.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 26, 2018, 04:47:44 pm
That's the problem, I don't have any folder here, I have all my paths set to point to /usr/share/codeblocks/SpellChecker
How can I use aspell in codeblocks ?
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 26, 2018, 07:50:25 pm
Do you have it installed? Do you have any dictionaries installed?
Use pacman to find where are the dictionaries the use the correct paths.
I don't have arch to check where is everything placed.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 26, 2018, 10:22:18 pm
yes I have aspell installed and I already have install a dictionnary but codeblocks don't use it for SFML :(
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 26, 2018, 10:42:42 pm
What is the path where the dictionary is located?
What path have you entered in settings?
Do you see a flag in the status bar with your language?
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 26, 2018, 11:19:27 pm
the dictionanry is located here :/usr/share/codeblocks/SpellChecker and that's the folder that I entered in setting
Yes I see an american flag in the status bar
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 27, 2018, 01:19:25 am
Screenshot?
Title: Re: Spellchecker, SFML and linux
Post by: stahta01 on June 27, 2018, 04:18:19 am
Did you install "hunspell" or another spell check library on Linux? If yes, which one did you install?
https://www.archlinux.org/packages/extra/x86_64/hunspell/ (https://www.archlinux.org/packages/extra/x86_64/hunspell/)

Edit https://www.archlinux.org/packages/extra/any/hunspell-en/ (https://www.archlinux.org/packages/extra/any/hunspell-en/)

Tim S.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 27, 2018, 06:45:56 pm
I had installed hunspell from https://www.archlinux.org/packages/extra/x86_64/hunspell/

Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 27, 2018, 07:19:23 pm
Can I see a screenshot of the editor you expect to be spell checked?
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 27, 2018, 08:13:34 pm
Sorry but I don't understand what screenshot I need to send.
There is no correction for all I write wich use SFML
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 27, 2018, 09:16:30 pm
Ok, so you've missed my comment about when spell checker works, haven't you?
Type something like:
Code
// blabla test alabsdfa
callfunc("blabla this will be spell check, but the code won't");
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 27, 2018, 11:36:19 pm
Update:

I'm so sorry but I didn't realize that the spellchecker doesn't work for all in C++;
I can use it for autocomplete name of variables but he don't correct me when I write a function name with a mistake

In a code like that :
Code
std::string variableName = "abcdtestghikj";
variableName.find("test");
It will propose me the variableName at line 2 but don't tell me anything for the contains function or for the "string" at line 1
Title: Re: Spellchecker, SFML and linux
Post by: sodev on June 28, 2018, 12:24:42 am
Uhm, this is not spellchecking, this is code completion you are talking about.

Spellchecking checks the spelling of "natural" language and not a programming language, it especially skips every C++ "grammar".
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 28, 2018, 12:34:08 am
Also C::B at this moment doesn't have inline error messages.
So if you want to see if your code is correct you'll have to compile it.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 28, 2018, 04:15:29 am
Ok I see. sorry for the confusion

but oBFusCATed if I do that I lost the adventage of using C::B, I can also use vim
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 28, 2018, 09:32:52 am
Patches welcome.
The advantage of C::B over vim is alt-g.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 28, 2018, 04:04:04 pm
I want to patch it but that I ask how can I do it ?
Title: Re: Spellchecker, SFML and linux
Post by: stahta01 on June 28, 2018, 05:05:46 pm
I want to patch it but that I ask how can I do it ?

Step 1: Be able to build Code::Blocks core from Source http://wiki.codeblocks.org/index.php/Developer_documentation (http://wiki.codeblocks.org/index.php/Developer_documentation)
Edit: http://wiki.codeblocks.org/index.php/Installing_Code::Blocks (http://wiki.codeblocks.org/index.php/Installing_Code::Blocks)
Step 2: If needed be able to build an [contrib] C::B Plugin (if you need to edit an contrib Plugin)
Step 3: Do the code changes to fix or add feature
Step 4: Submit an Subversion(SVN) patch file to sourceforge.net (sf.net) http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker) (http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker))

Edit2: I am guessing you would need to edit the Code Completion (CC) Plugin; but, this is a big guess on my part.
Edit3: You might want to look at the Clang CC Plugin that another person is working on and see if it works for you.
http://forums.codeblocks.org/index.php?topic=20623.225 (http://forums.codeblocks.org/index.php?topic=20623.225)

Tim S.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 28, 2018, 05:30:08 pm
That's not what I meant. I want to fix it but I don't want to edit any plugin. I just ask you which package exactly I need to install or what I need to change in the settings.
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 28, 2018, 05:33:24 pm
The only plugin which has this feature at the moment is https://github.com/yvesdm3000/ClangLib I think, but I have not tried it.
Hopefully in the not so distant future we would have a language server plugin, which will also support this.
Title: Re: Spellchecker, SFML and linux
Post by: Gryf on June 28, 2018, 07:46:12 pm
I did not found a compilable version or a version for archlinux.
I will search plugin for the autocompletion.
Thank's very much for your help ;D
Title: Re: Spellchecker, SFML and linux
Post by: BlueHazzard on June 29, 2018, 12:09:14 am
Yes the clang plugin has jit error detection and a lot other things. On unix it should be easy to compile....
Title: Re: Spellchecker, SFML and linux
Post by: BlueHazzard on June 29, 2018, 12:11:26 am
Hopefully in the not so distant future we would have a language server plugin, which will also support this.
Are you working on it? Do you have some code to show?
Title: Re: Spellchecker, SFML and linux
Post by: oBFusCATed on June 29, 2018, 08:10:14 am
Yes, I'm (paused now, but I'll get back to it at some moment this year).
It is too crude and useless at the moment. And doesn't do diagnostics. Also clangd is too early in its development.