Problems with new tags system.

CodeLite installation/troubleshooting forum
marfi
CodeLite Expert
Posts: 159
Joined: Mon Nov 03, 2008 9:17 pm
Contact:

Problems with new tags system.

Post by marfi »

Hi Eran,
please, is there any way how to determine which include paths defined in Settings->Tags Settings->Parser dialog have been really processed? And where are the tags from these paths stored now? I have problems with new tagging system and I'm not able to find out what I'm doing wrong, because some tags work and some other not. For example: if I add include path for wxWidgets to common parser paths dialog in one project, the wxWidgets tags work well only in this one project, but in other workspace even wxString class cannot be recognized... Also some of my libraries' includes which was parsed without any problem by previous tags system are not processed correctly now. Please, what should I do to make tags work fine?

Best regards
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Problems with new tags system.

Post by jfouche »

Hi Marfi

I came on the forum to open a thread about new tag system, and you started before me :D So i'll add my question also

1 - About parsing, the new system doesn't allow to select which sub directories are parsed. For me, with wxWidgets, as I use MSW, I don't want specific port (mac / gtk / univ) to be parsed. Moreover, if I go to declaration of wxDialog, it goes to univ\dialog.h, probably because it's the last (or first) parsed file containing the selected word.
2 - MinGW isn't auto detected at startup ? I added it in settings -> tags settings, and everything is fine.
3 - no more [parse file without extensions] ?
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problems with new tags system.

Post by eranif »

I waited for such questions to come up :)

And now they did.

To clarify how the new system works and why did I do those changes

First, the previous system had one major drawback: if you needed a single file from /usr/include, you needed to parse the entire /usr/include with all its files. More, if a file was just a redirection to another file the actual tags were not generated - since codelite did not follow 'includes' (e.g. in QT it is often common to include <QString> but QString is just a one-line-file which does something like "include "../qtcore/qstring.h").

Trying to use more than one or two paths for the external database resulted in major performance degradation (e.g. if a user needed /usr/include + wx + boost the code-completion was almost useless since the database was huge and symbols searching was too slow).

The new parser:

The code-completion itself did not change, only the way codelite stores and generates the tags. A new 'file crawler' was added which accepts as input a single file and starts crawling into all the 'include' statements until it finishes, the result is a list of files to be parsed. Those files are then passed to codelite for processing.

Advantages: you only need to add 'include' statement to your file and codelite will find and parse this file - this is done when the file is saved(assuming the file can be found in the parser search path)

Retagging workspace - previously, retag workspace, only retagged the workspace files. Now, it will parse the workspace files AND all the include files it can find
jfouche wrote:1 - About parsing, the new system doesn't allow to select which sub directories are parsed
Indeed, I will add such mechanism - should be fairly easy
jfouche wrote:2 - MinGW isn't auto detected at startup ? I added it in settings -> tags settings, and everything is fine
CodeLite detects MinGW only if it was installed using the codelite installer (if you installed it manually it wont detect it), if you have a suggestion for how to detect such installations - please bring it up (or patch the class IncludePathLocator class)
jfouche wrote:3 - no more [parse file without extensions] ?
This is enabled from 'Settings > Tags Settings > Parse files without extension' ( i tried it by including <set> to my code and it worked)
marfi wrote:please, is there any way how to determine which include paths defined in Settings->Tags Settings->Parser dialog have been really processed?
codelite searches (similar to a compiler) from first to last. If a file can be found in the first path given, it wont search the other paths.
All of the paths are used to locate a file
marfi wrote:And where are the tags from these paths stored now?
There is a single database, the workspace database. Since *not* all the files in the paths are scanned. Only files which are included by the workspace files.
marfi wrote:if I add include path for wxWidgets to common parser paths dialog in one project, the wxWidgets tags work well only in this one project, but in other workspace even wxString class cannot be recognized
Retag your workspace and it will work for it as well
marfi wrote:Also some of my libraries' includes which was parsed without any problem by previous tags system are not processed correctly now
Add the path to your library to the parser and retag the workspace. The way files are parsed was not changed only which files should be scanned was modified.

If you got more questions, please ask them here or join channel #codelite at irc.freenode.net, where we can solve any problem and make suggestion 'live'

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problems with new tags system.

Post by eranif »

jfouche wrote:Hi Marfi

I came on the forum to open a thread about new tag system, and you started before me :D So i'll add my question also

1 - About parsing, the new system doesn't allow to select which sub directories are parsed. For me, with wxWidgets, as I use MSW, I don't want specific port (mac / gtk / univ) to be parsed. Moreover, if I go to declaration of wxDialog, it goes to univ\dialog.h, probably because it's the last (or first) parsed file containing the selected word.
2 - MinGW isn't auto detected at startup ? I added it in settings -> tags settings, and everything is fine.
3 - no more [parse file without extensions] ?
I added new option under Settings > Tags Settings > Include Files (the name was changed from Parser to Include Files) a section which allows you to set an exclude directories list. Just add there the paths you wish the crawler will skip

Eran
Make sure you have read the HOW TO POST thread
marfi
CodeLite Expert
Posts: 159
Joined: Mon Nov 03, 2008 9:17 pm
Contact:

Re: Problems with new tags system.

Post by marfi »

Hi Eran,
please, have you already applied the patch for relative inner includes we were talking about at irc? I tried the latest SVN version and it still doesn't work for me unless I add <path_to_my_lib>wx/wxsf/directory to parser's Includes dialog.

Best regards
Michal
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problems with new tags system.

Post by eranif »

marfi wrote:Hi Eran,
please, have you already applied the patch for relative inner includes we were talking about at irc? I tried the latest SVN version and it still doesn't work for me unless I add <path_to_my_lib>wx/wxsf/directory to parser's Includes dialog.

Best regards
Michal
I did, but there is still a bug in it.

For now, just specify the include paths to the parser until this issue is resolved

EDIT:

I dont think it is standard to write include file the way you do.

I had a look at 2 big libraries (wxWidgets & boost)
All are using what I thought is the standard.
They specify the 'relative' path, for example in boost, all include files inside boost libraries are writtern like this:

Code: Select all

#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
#define BOOST_SHARED_ARRAY_HPP_INCLUDED

//
//  shared_array.hpp
//
//  (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
//  Copyright (c) 2001, 2002 Peter Dimov
//
//  Distributed under the Boost Software License, Version 1.0. (See
//  accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
//  See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
//

#include <boost/smart_ptr/shared_array.hpp>

#endif  // #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
They assume only one path should be known.
Same goes for wxWidgets, all includes prefixed by 'wx/' etc.
Ofc, its just a convention and standard, but still I think it is a good coding standard.

Eran
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Problems with new tags system.

Post by jfouche »

eranif wrote:
jfouche wrote:1 - About parsing, the new system doesn't allow to select which sub directories are parsed. For me, with wxWidgets, as I use MSW, I don't want specific port (mac / gtk / univ) to be parsed. Moreover, if I go to declaration of wxDialog, it goes to univ\dialog.h, probably because it's the last (or first) parsed file containing the selected word.
I added new option under Settings > Tags Settings > Include Files (the name was changed from Parser to Include Files) a section which allows you to set an exclude directories list. Just add there the paths you wish the crawler will skip
Hi Eran, I'm currently giving a try, but it seems to not work correctly : look at the png to see which are the exclude files I use. If i go to the definition of wxDialog, it goes to ".../wx/univ/dialog.h" ! Even after a retag workspace (and a deletion of the workspace.tags file). Looking to the worksapce.tags sqlite3 database, I can see that the exclude path are parsed.

Moreover, on my laptop, with another screen, the retag workspace progress dialog isn't shown if I got CodeLite on the 2nd screen ( :shock: ).
You do not have the required permissions to view the files attached to this post.
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problems with new tags system.

Post by eranif »

Hi Jeremie!

There was indeed a bug with it, which I only fixed at revision 3238
------------------------------------------------------------------------
r3238 | eranif | 2009-10-23 12:59:39 +0200 (Fri, 23 Oct 2009) | 1 line
- in some cases the 'excluded directories' were not ignored as they should have
------------------------------------------------------------------------
Which revision are you using?
If you use anything less than 3238, please update
Eran
Make sure you have read the HOW TO POST thread
jfouche
CodeLite Guru
Posts: 351
Joined: Mon Oct 20, 2008 7:26 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Problems with new tags system.

Post by jfouche »

eranif wrote:There was indeed a bug with it, which I only fixed at revision 3238
------------------------------------------------------------------------
r3238 | eranif | 2009-10-23 12:59:39 +0200 (Fri, 23 Oct 2009) | 1 line
- in some cases the 'excluded directories' were not ignored as they should have
------------------------------------------------------------------------
Which revision are you using?
3234
eranif wrote:If you use anything less than 3238, please update
I will
See you later
Jérémie
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problems with new tags system.

Post by eranif »

Hi,

I tried it myself ( I excluded the Unix / Univ from the tags ) and now instead of jumping to the 'Universal' dualog, codelite goes to msw dialog :)
So it seems to work here at least.

One of the next changes (not sure when) will be based on macros. so you will be able to define list of macros which will be handled as #if 0 and skipped.

Eran
Make sure you have read the HOW TO POST thread
Post Reply