Author Topic: linux, code completion  (Read 13592 times)

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
linux, code completion
« on: October 23, 2013, 02:00:56 pm »
Hello

I like how code completion in Windows works, but in Ubuntu ppa it's not completely included.
For example, when adding SDL library and writing the beginning of the name of SDL_... function in Windows, possible functions list appears on the screen.
how do i turn this fuction on in CB?(build from source code with same flags???)

ToApolytoXaos

  • Guest
Re: linux, code completion
« Reply #1 on: October 23, 2013, 03:29:17 pm »
For example, when adding SDL library and writing the beginning of the name of SDL_... function in Windows, possible functions list appears on the screen.
Just to let you know, I have noticed the same behavior on my GNU / Debian testing machine and for some reason autocompletion does not parse properly. I'm compiling C::B myself always with the latest revision and indeed there are moments where I get really irritated by the mechanism with how it "forces" me to reparse the entire project.

Nevertheless, it's a minor issue as it parses the project on the background which eventually makes it possible to use again autocompletion. Usually I safe the project, then press Ctrl+F11 to rebuild the project, run it, and then check the autocompletion mechanism. After all this fuss, it works normally.

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #2 on: October 24, 2013, 07:10:51 pm »
Sorry my English isn't very good. I'm not sure you understood me correctly.
I meant this
Linux:

Windows:


Linux:

Windows:


Linux:

Windows:

ToApolytoXaos

  • Guest
Re: linux, code completion
« Reply #3 on: October 24, 2013, 07:25:17 pm »
The Linux version you are using, is it older than 12.11 if you use stable? Are you using nightly builds?
[NOTE]: OK, I have see that your Windows version is 12.11, but I want to know what kind of version you are using under Linux.

It would be a lot more helpful for us, if you could provide more information so I could you help a bit now that I have time.

Also, go to Settings > Editor > Code Completion and check the options over there. You might have disabled code completion by mistake.
« Last Edit: October 24, 2013, 07:28:00 pm by ToApolytoXaos »

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #4 on: October 24, 2013, 08:57:02 pm »
svn build rev 9156 (2013-06-13 14:35:53) gcc 4.6.3 Linux/unicode - 64 bit
install from pasgui/ppa
settings by default


it's working on class, struct and my header files

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: linux, code completion
« Reply #5 on: October 24, 2013, 09:57:19 pm »
What Ubuntu version?

I have no  such problems on Ubuntu 12.04 and 13.10. It may not make a difference but you can try my PPA which is updated daily.

Have you verified that your code compiles? If the standard headers are somehow messed up this might explain the problem.

Otherwise maybe locale/encoding issues?
« Last Edit: October 24, 2013, 11:39:09 pm by dmoore »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: linux, code completion
« Reply #6 on: October 24, 2013, 10:02:04 pm »
Also, try running from command line with

Code: [Select]
codeblocks --debug-log

After you open a project, the debug log should have output like

Code: [Select]
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6/i686-linux-gnu
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6/backward
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/i686-linux-gnu/4.6/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/local/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/i386-linux-gnu
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include
NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
NativeParser::DoFullParsing(): Adding three kind of files to batch-parser
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/c++/4.6/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/filesystem/config.hpp'
NativeParser::DoFullParsing(): Add 3 priority file(s) for project 'ProjectTest'...
NativeParser::DoFullParsing(): Added 1 header&source file(s) for project 'ProjectTest' to batch-parser...
ClassBrowser::UpdateClassBrowserView(): No active project available.
NativeParser::GetAllPathsByFilename(): Traversing XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
NativeParser::GetAllPathsByFilename(): Found 1 files:
- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
NativeParser::CreateParser(): Finish creating a new parser for project 'ProjectTest'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'ProjectTest'...
NativeParser::OnParserEnd(): Project 'ProjectTest' parsing stage done!
Project 'ProjectTest' parsing stage done (106 total parsed files, 3849 tokens in 0 minute(s), 0.694 seconds).
NativeParser::GetAllPathsByFilename(): Traversing 'XXXXXXXXXXXXXXXXXXXXXX' for: main.*
NativeParser::GetAllPathsByFilename(): Traversing 'XXXXXXXXXXXXXXXXXXXXXX' for: main.*
NativeParser::GetAllPathsByFilename(): Found 1 files:
- XXXXXXXXXXXXXXXXXXXXXXXXXXXX
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
SystemHeadersThread: /usr/include/c++/4.6/ , 606
SystemHeadersThread: /usr/include/c++/4.6/i686-linux-gnu/ , 46
SystemHeadersThread: /usr/include/c++/4.6/backward/ , 8
SystemHeadersThread: /usr/lib/gcc/i686-linux-gnu/4.6/include/ , 38
SystemHeadersThread: /usr/local/include/ , 0
SystemHeadersThread: /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/ , 4
SystemHeadersThread: /usr/include/i386-linux-gnu/ , 251
SystemHeadersThread: /usr/include/ , 13980
SystemHeadersThread: Total number of paths: 8

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #7 on: October 25, 2013, 06:25:48 am »
Ubuntu 12.04 + Xfce
I tried different encodings


I tried to open a project and then close and open the other, but that's all
Code: [Select]
~$ codeblocks --debug-log

(codeblocks:2577): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:2577): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:2577): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

(codeblocks:2577): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

Code: [Select]
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6/i686-linux-gnu
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.6/backward
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/i686-linux-gnu/4.6/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/local/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/i386-linux-gnu
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include

Now I think the problem is in the global search paths.

I have added search paths in project options after that it start to work fine.

How can I add these paths in global sittings?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2326
Re: linux, code completion
« Reply #8 on: October 25, 2013, 10:00:27 am »
Settings->Compiler

greetings

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: linux, code completion
« Reply #9 on: October 25, 2013, 11:05:31 am »
Ubuntu 12.04 + Xfce
I tried different encodings


I tried to open a project and then close and open the other, but that's all
Code: [Select]
~$ codeblocks --debug-log

(codeblocks:2577): GLib-GObject-WARNING **: invalid uninstantiatable type `<invalid>' in cast to `GtkRadioMenuItem'

(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed
(codeblocks:2577): Gtk-CRITICAL **: IA__gtk_radio_menu_item_get_group: assertion `GTK_IS_RADIO_MENU_ITEM (radio_menu_item)' failed

Wrong output - that is the console. The debug log is in a Tab on the main app window in a panel at the bottom of the screen - same panel as compiler output just different tab.


Quote
Now I think the problem is in the global search paths.

I have added search paths in project options after that it start to work fine.

These are standard headers so you shouldn't have to add them unless they are in an unusual place. Are you using a custom compiler install?

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #10 on: October 25, 2013, 01:43:58 pm »
Wrong output - that is the console. The debug log is in a Tab on the main app window in a panel at the bottom of the screen - same panel as compiler output just different tab.
Code: Text
  1. Initialize EditColourSet .....
  2. Initialize EditColourSet: done.
  3. Loading menubar...
  4. ScriptedWizard: loaded
  5. ProjectsImporter: loaded
  6. Compiler: loaded
  7. AStylePlugin: loaded
  8. Abbreviations: loaded
  9. CodeCompletion: loaded
  10. Debugger: loaded
  11. ToDoList: loaded
  12. Autosave: loaded
  13. FilesExtensionHandler: loaded
  14. ClassWizard: loaded
  15. OpenFilesList: loaded
  16. Project wizard added for 'Empty project'
  17. Project wizard added for 'Fortran application'
  18. Project wizard added for 'Fortran library'
  19. Project wizard added for 'Fortran DLL'
  20. Project wizard added for 'Console application'
  21. Project wizard added for 'D application'
  22. Project wizard added for 'FLTK project'
  23. Project wizard added for 'GLFW project'
  24. Project wizard added for 'GLUT project'
  25. Project wizard added for 'GTK+ project'
  26. Project wizard added for 'Irrlicht project'
  27. Project wizard added for 'Lightfeather project'
  28. Project wizard added for 'Matlab project'
  29. Project wizard added for 'OpenCV project'
  30. Project wizard added for 'OpenGL project'
  31. Project wizard added for 'Ogre project'
  32. Project wizard added for 'Code::Blocks plugin'
  33. Project wizard added for 'QT4 project'
  34. Project wizard added for 'SDL project'
  35. Project wizard added for 'SFML project'
  36. Project wizard added for 'Static library'
  37. Project wizard added for 'Shared library'
  38. Project wizard added for 'wxWidgets project'
  39. Build-target wizard added for 'Console'
  40. Build-target wizard added for 'Static library'
  41. Build-target wizard added for 'wxWidgets'
  42. Project wizard added for 'ARM Project'
  43. Project wizard added for 'AVR Project'
  44. Project wizard added for 'TriCore Project'
  45. Project wizard added for 'PowerPC Project'
  46. Project wizard added for 'MCS51 Project'
  47. File(s) wizard added for 'Empty file'
  48. File(s) wizard added for 'C/C++ source'
  49. File(s) wizard added for 'C/C++ header'
  50. File(s) wizard added for 'Fortran source'
  51. Scripted wizard plugin activated
  52. Foreign projects importer plugin activated
  53. Added compiler "GNU GCC Compiler"
  54. Added compiler "Intel C/C++ Compiler"
  55. Added compiler "GDC D Compiler"
  56. Added compiler "GNU Fortran Compiler"
  57. Added compiler "G95 Fortran Compiler"
  58. Added compiler "GNU GCC Compiler for ARM"
  59. Added compiler "GNU GCC Compiler for MSP430"
  60. Added compiler "PGI Fortran Compiler"
  61. Added compiler "LLVM D Compiler"
  62. Added compiler "GNU GCC Compiler for PowerPC"
  63. Added compiler "LLVM Clang Compiler"
  64. Added compiler "*No Compiler*"
  65. Added compiler "Digital Mars D Compiler"
  66. Added compiler "GNU GCC Compiler for TriCore"
  67. Added compiler "Tiny C Compiler"
  68. Added compiler "Small Device C Compiler"
  69. Added compiler "GNU GCC Compiler for AVR"
  70. Compiler plugin activated
  71. Source code formatter (AStyle) plugin activated
  72. Abbreviations plugin activated
  73. Code completion plugin activated
  74. Debugger plugin activated
  75. Todo List plugin activated
  76. Autosave plugin activated
  77. Files extension handler plugin activated
  78. Class wizard plugin activated
  79. Open files list plugin activated
  80. Loading toolbar...
  81. ClassBrowser::UpdateClassBrowserView(): No active project available.
  82. Initializing plugins...
  83. ClassBrowser::OnThreadEvent(): Updating class browser...
  84. ClassBrowser::OnThreadEvent(): Class browser updated.
  85. Loading project file...
  86. Parsing project file...
  87. Loading target Debug
  88. Loading target Release
  89. Loading project files...
  90. 1 files loaded
  91. Done loading project in 23ms
  92. Project's base path: /home/sergey/.programming/project/codeblocks/test/
  93. Project's common toplevel path: /home/sergey/.programming/project/codeblocks/test/
  94. Mozilla universal detection engine detected 'Pure *ASCII*'.
  95. Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
  96. Project data set for /home/sergey/.programming/project/codeblocks/test/main.c
  97. Top Editor: /home/sergey/.programming/project/codeblocks/test/main.c
  98. NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
  99. NativeParser::DoFullParsing(): Adding three kind of files to batch-parser
  100. NativeParser::DoFullParsing(): Added 1 header&source file(s) for project 'test' to batch-parser...
  101. ClassBrowser::UpdateClassBrowserView(): No active project available.
  102. NativeParser::GetAllPathsByFilename(): Traversing '/home/sergey/.programming/project/codeblocks/test' for: main.*
  103. NativeParser::GetAllPathsByFilename(): Found 1 files:
  104. - /home/sergey/.programming/project/codeblocks/test/main.c
  105. NativeParser::CreateParser(): Finish creating a new parser for project 'test'
  106. ClassBrowser::OnThreadEvent(): Updating class browser...
  107. ClassBrowser::OnThreadEvent(): Class browser updated.
  108. NativeParser::OnParserStart(): Starting batch parsing for project 'test'...
  109. NativeParser::OnParserEnd(): Project 'test' parsing stage done!
  110. Project 'test' parsing stage done (1 total parsed files, 1 tokens in 0 minute(s), 0.012 seconds).
  111. NativeParser::GetAllPathsByFilename(): Traversing '/home/sergey/.programming/project/codeblocks/test' for: main.*
  112. NativeParser::GetAllPathsByFilename(): Traversing ' - /home/sergey/.programming/project/codeblocks/test/' for: main.*
  113. NativeParser::GetAllPathsByFilename(): Found 1 files:
  114. - /home/sergey/.programming/project/codeblocks/test/main.c
  115. ClassBrowser::OnThreadEvent(): Updating class browser...
  116. ClassBrowser::OnThreadEvent(): Class browser updated.
  117. Re-parsed 1 files.
  118. NativeParser::OnParserStart(): Starting re-parsing for project 'test'...
  119. Project 'test' parsing stage done (1 total parsed files, 1 tokens in 0 minute(s), 0.011 seconds).
  120. NativeParser::GetAllPathsByFilename(): Traversing '/home/sergey/.programming/project/codeblocks/test' for: main.*
  121. NativeParser::GetAllPathsByFilename(): Traversing ' - /home/sergey/.programming/project/codeblocks/test/' for: main.*
  122. NativeParser::GetAllPathsByFilename(): Found 1 files:
  123. - /home/sergey/.programming/project/codeblocks/test/main.c
  124. ClassBrowser::OnThreadEvent(): Updating class browser...
  125. ClassBrowser::OnThreadEvent(): Class browser updated.
  126. Reparsing when typing for editor /home/sergey/.programming/project/codeblocks/test/main.c
  127. NativeParser::OnParserStart(): Starting re-parsing for project 'test'...
  128. Project 'test' parsing stage done (1 total parsed files, 1 tokens in 0 minute(s), 0.012 seconds).
  129. NativeParser::GetAllPathsByFilename(): Traversing '/home/sergey/.programming/project/codeblocks/test' for: main.*
  130. NativeParser::GetAllPathsByFilename(): Traversing ' - /home/sergey/.programming/project/codeblocks/test/' for: main.*
  131. NativeParser::GetAllPathsByFilename(): Found 1 files:
  132. - /home/sergey/.programming/project/codeblocks/test/main.c
  133. ClassBrowser::OnThreadEvent(): Updating class browser...
  134. ClassBrowser::OnThreadEvent(): Class browser updated.
  135.  

Quote
Are you using a custom compiler install?
No

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #11 on: October 25, 2013, 06:44:11 pm »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2326
Re: linux, code completion
« Reply #12 on: October 25, 2013, 08:33:26 pm »
everything you set here is a global compiler option... so if you set here a search path, this is a search path for every project...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: linux, code completion
« Reply #13 on: October 25, 2013, 09:52:49 pm »
I am confused why you don't have the "Caching GCC default include dir ..." messages in your log. You can probably workaround by adding those paths to compiler settings -> search directories tab but you should not have to, it should just work.

Offline D101101

  • Single posting newcomer
  • *
  • Posts: 7
Re: linux, code completion
« Reply #14 on: October 27, 2013, 05:46:26 pm »
I have added this paths to search directories for compiler and linker, it works.
Thank you.
P.S. I didn't try to do this because I thought if the code compiles without errors, then it is set up correctly..