Recent Changes - Search:

Home Page


Main

Downloads
Windows
macOS
Linux (via apt / rpm )
Linux wxWidgets
Release Notes

Wiki
Documentation
FAQ

Build CodeLite
Linux
Windows
macOS

Devs
Debug CodeLite Linux
Building Clang
Build wxWidgets (MSW)
Coding Guidelines
Create a Plugin

SettingUpCodeCompletion

Changes from CodeLite 1.0.XXXX

As of CodeLite 2.0, CodeLite no longer uses an external symbols database for code completing symbols which are not part of your workspace (e.g. fprintf(), wxString etc.). It is now using a 'File Crawler' to locate all the files that need to be parsed, based on the include statements found in your source files.

As a result, the code-completion in codelite 2.0 is faster and allows the user to add as many third party libraries as he wishes, without needing to worry about the database size.

Configuring the Parser

In most cases, when starting codelite, codelite will auto-detect some basic paths and will add them to the parser include path. Note that these paths are used to locate potential include files. However CodeLite doesn't immediately scan all the include files that it finds; only the ones that are referenced by your code.

The global parser search paths can be reconfigured from the 'Settings > Tags Settings > Include Files' tab (as seen in the next picture), however, as of build 3413 codelite also offer a per-workspace paths settings, this is configurable by right clicking on the workspace icon in the file view, and selecting 'Workspace Settings'

The 'Include Files' page, has two sections:

  • The Search Paths - these paths are used to locate 'include' statements in your code. So let's say you wrote in your code the following code snippet:
 #include <string>
 int main(int argc, char **argv)
 {
     std::string str = "hello world";
     return 0;
 }

Now when the user saves the file, the parser thread kicks in and does the following:

  1. Scans the file for any 'include' statement; in our example: 'include <string>'
  2. Next, it will use the search paths to locate the file 'string' (according to the 'Include Files' picture above, the file is found under C:\MinGW-4.4.0\lib\gcc\mingw32\4.4.0\include\c++). When a file is found, the scan is stopped for that file.
  3. The file is then parsed (along with all its include statements) and the symbols are stored into the database

So from this point on, codelite knows about std::string

  • The second part of the 'Include Files' page, is the 'Exclude' section. Place here any path that you don't want codelite to locate files

Key Notes:

  • Parsing is done only after user saves the file OR user manually invoked the parser (right click in the editor -> Retag file)
  • Each workspace manages its own symbols database, so symbols available for one workspace might not be there for another workspace (unless the file containing them is also included somewhere in the workspace)

Retag Workspace is your friend

Under the 'Workspace' menu, there are 2 new options:

  • Retag Workspace ( Quick )
  • Retag Workspace ( Full )

The first option creates a list of all files which are relevant to the workspace (including any 'include' file) and then removes from that list any file which was recently tagged and is up-to-date. The files which remains in the list are then parsed.

The second option clears the symbols database and re-create it from scratch (all files are re-parsed).

Many code-completion problems can be solved by simply 'retagging the workspace'!

Tip: How to quickly add or exclude paths in the parser

For CodeLite < build 3413: You can use the 'Explorer' tab to quickly add / exclude paths by right-clicking the folder in the 'Explorer' tree and from the context menu select Tags -> Add this path to the parser search path or Tags -> Add this path to the parser exclude path This will add

For CodeLite >= build 3413: As of build 3413, the context menu of the 'Explorer' tab, has been slightly modified to support the new per-workspace parser paths settings, as seen in the picture below:

Edit - History - Print - Recent Changes - Search
Page last modified on November 27, 2009, at 11:05 AM