Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion not working correctly #1204

Closed
delbato opened this issue Mar 14, 2016 · 37 comments
Closed

Autocompletion not working correctly #1204

delbato opened this issue Mar 14, 2016 · 37 comments

Comments

@delbato
Copy link

delbato commented Mar 14, 2016

As the title says, auto correction is not working properly for me.
See this related SO question. Just posting this here, in case it is indeed a bug.

@eranif
Copy link
Owner

eranif commented Mar 14, 2016

What do you have under Settings->Code Completion->CTags->Search Paths?

@eranif
Copy link
Owner

eranif commented Mar 14, 2016

I just tested this and it works for me.
mutex
chrono

Few notes:

  • After you type, try to hit Ctrl-S (parsing is done on file save)
  • Double check that the search paths for code completion are set up properly

@delbato
Copy link
Author

delbato commented Mar 14, 2016

Well, cant check right now - but i believe only the TDM GCC default search paths. i Got autocompletion mostly fixed though - autocomplete delay set to 1 char seemed to fix it. the weird header path autocompletion persists though.

@eranif
Copy link
Owner

eranif commented Mar 14, 2016

See my comment on SO

@eranif
Copy link
Owner

eranif commented Mar 14, 2016

The file completion is not going to be fixed - a simple workaround: keep on typing and it will shrink the results properly

@eranif eranif closed this as completed Mar 14, 2016
@delbato
Copy link
Author

delbato commented Mar 16, 2016

Weird, after 2 days of it working like it should, autocompletion isnt working again.
Didn't change a thing either.

@delbato
Copy link
Author

delbato commented Mar 16, 2016

pic

It just suddenly stopped working.
Here are my search paths for CTags:

pic2

Do you have any idea why?
It shows namespaces and some members, but it wont show others. weird.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

I have no idea why, try:
main menu bar->workspace->parse workspace
and see if it helps
You can also enable clang code completion

@delbato
Copy link
Author

delbato commented Mar 16, 2016

tried everything. nothing is working so far. already parsed the workspace a number of times.
Now, when bressing CTRL+ENTER after the opening dots of the std::chono:: namespace, there are symbols in there that dont belong there, like my GameWindow, which is in the cyss:: namespace!

unbenannt333

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Ctrl-ENTER and Ctrl-SPACE are two different things.
Ctrl-ENTER - is the "Word Completion" plugin it will complete based on words found in all open editors
Ctrl-SPACE - triggers code completion (context aware)

@delbato
Copy link
Author

delbato commented Mar 16, 2016

A minor side note: Sometimes codelite kicks out my compiler settings, like now, i had to set the compiler again to build my project and then the path to GDB was invalid. fixing that, then restarting laptop+CL

@delbato
Copy link
Author

delbato commented Mar 16, 2016

wtf... it still doesn't want to work. what a shame, really. and it still worked yesterday, too.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Can you attach a sample source file with the problem? and let me debug it here
Thanks

@delbato
Copy link
Author

delbato commented Mar 16, 2016

i will.

main2.zip

See attached zip, github wont let me upload .cpp/.cxx files.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

I managed to reproduce your original problem (from SO). The difference is that I was testing using MinGW GCC 4.9.2 / 64 and you are using v5.1

I am investigating this now, will update - stay tuned!

@delbato
Copy link
Author

delbato commented Mar 16, 2016

alright thank you! BTW, CodeLite is pretty awesome, thanks for the IDE :D

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Update: I found the problem:
When calling Workspace->Parse Workspace CodeLite collects a list of files that should be parsed (i.e. it crawls through the include statements in the code and creates a list of files to parse)

chrono has no extension and therefor it was filtered out...
I solved this issue along time by examining the file content by searching for patterns

This logic is now also applied for parsing.

You might ask: OK, so why it worked sometimes !?
The answer is simple:
when hitting Ctrl-S CodeLite parses a single file + all its includes - and this code does not filter any header files.

Ok, so why different logics ? because a workspace may contain binary files (e.g. executables and basically any file type that you might think of) so when parsing the entire workspace we filter only relevant files ;)

eranif added a commit that referenced this issue Mar 16, 2016
…a file should be parsed.

by doing this, files without extensions are no longer skipped during parsing while calling 'Parse Workspace'
Fixes:
    #1204
@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Please try this installer with a fix and keep me updated:
http://codelite.org/downloads/codelite/weekly/wip/codelite-amd64-9.15.exe

@delbato
Copy link
Author

delbato commented Mar 16, 2016

unbenannt24

just installed it... seems to work now 👍 😄 thanks for your time! i really appreciate all your work.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Good to hear ;)
Can you also close SO question ? thanks!

@delbato
Copy link
Author

delbato commented Mar 16, 2016

OK, sorry to still bug you about this, but this is weird:
This is in the file main2.cpp that i sent you:

file1

And this is in the file main.cpp in the same workspace and project:

file2

How come it works in one file, but not in the other one? i already reparsed the project and all that.
Weirdly enough, in both cases, it finds the micro- and milliseconds members.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

Can you send me the workspace? or is it closed source?
Eran

@delbato
Copy link
Author

delbato commented Mar 16, 2016

oh, no it's not. i'm just gonna push to the repo and send you the link, hold on a sec.

@delbato
Copy link
Author

delbato commented Mar 16, 2016

the origin/new branch contains the code.

@eranif
Copy link
Owner

eranif commented Mar 16, 2016

of which project? (github link)

@delbato
Copy link
Author

delbato commented Mar 16, 2016

@delbato
Copy link
Author

delbato commented Mar 17, 2016

and? have you found anything out? code completion works only in main2.cpp, but not in main.cpp or the cysslib project at all, for that matter.

@eranif
Copy link
Owner

eranif commented Mar 17, 2016

I checked out the sources last night, and was not able to switch the the branch you mentioned...
It was late so I must have be done something stupid... will try again this evening

@delbato
Copy link
Author

delbato commented Mar 17, 2016

hm
weird. the new branch defo exists, just pushed to it.

@eranif
Copy link
Owner

eranif commented Mar 17, 2016

I agree, it must be the late hours ;)

@delbato
Copy link
Author

delbato commented Mar 17, 2016

be aware that the .codelite and .clang directories are ignored on the git repo, so i guess it will reparse when you open the workspace. Autocompletion doesn't work, even with multiple full reparses.

@eranif
Copy link
Owner

eranif commented Mar 17, 2016

I noticed that you added many files that should not be part of the repo.
All the folders that start with . (e.g. .clang, .codelite) should not be added to the repo.

Also, don't add the .txt file and generated makefiles

@delbato
Copy link
Author

delbato commented Mar 19, 2016

Did you find anything out? Code Completion is still only partially working.
btw, updated the .gitignore file a while back.

@eranif
Copy link
Owner

eranif commented Mar 19, 2016

It works for me.

You can enable the clang code completion (which works as complementary system to the in-house parser) - usually this works pretty well (i.e. if your project can compile, than the clang code completion will code complete what the in-house parser fails to complete)

To enable it:
Settings->code completion->clang->enable clang code completion
Once enabled, its recommended to run a full rebuild of your workspace

@delbato
Copy link
Author

delbato commented Mar 19, 2016

really weird. The autocompletion works for the same workspace in CodeLite
6.1.1, flawlessly.
On Mar 19, 2016 6:30 PM, "Eran Ifrah" notifications@github.com wrote:

It works for me.

You can enable the clang code completion (which works as complementary
system to the in-house parser) - usually this works pretty well (i.e. if
your project can compile, than the clang code completion will code complete
what the in-house parser fails to complete)

To enable it:
Settings->code completion->clang->enable clang code completion
Once enabled, its recommended to run a full rebuild of your workspace


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1204 (comment)

@eranif
Copy link
Owner

eranif commented Mar 19, 2016

Did you enable clang ?

@delbato
Copy link
Author

delbato commented Mar 19, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants