Page 1 of 1

Tags for project only

Posted: Thu Apr 23, 2009 11:41 am
by DSP_Programmer
Hello Eran,

I have some troubles with my workspace setup and the tags database. I have a workspace with multiple projects, where the projects are very similar. Now if I work in project 1 and try to use some tag feature I get the results of the tags from project 2 if the same tag is used there. E.g. project 1 contains a structure typedef with different elements than the structure typedef of the same name in project 2. Now, the name completion will show me the elements of the project 2 typedef if I'm working within project 1.

Could the tags database be created for every project separately? Or could you add an option to have the user select whether he wants the tags database created for the workspace or the project? Or do I use this feature in a wrong way?

Btw, making separate workspaces for every project is not really an option, because I often have to search within the complete workspace (including all projects).

Do you see any option to solve this problem?

Thanks,

Re: Tags for project only

Posted: Thu Apr 23, 2009 3:01 pm
by eranif
DSP_Programmer wrote:Could the tags database be created for every project separately?
Not really.

The database structure is independent of the project/workspace concept - which is only known in the IDE level. It does not contain any knowledge of which file belongs to which project. If we leave this design choice aside, in practice you can not have the same symbol with the same name (there is a unique constraint on the 'name' column in the database) so the database only knows one symbol of that name (without getting the into details of overloading and different return types)

The fact is that codelite can not keep in the same database different symbols with the same unique signature (the symbol name, or in case of a function it is a name + function signature) so only one definition is kept.

I am afraid that the only way to support what you want is to create different workspace to each project.

Eran

Re: Tags for project only

Posted: Thu Apr 23, 2009 6:20 pm
by DSP_Programmer
Hello Eran,

I was afraid of that answer.

But couldn't this be changed by changing the database layout like this:

- the id (not the name) of the entry is unique and (auto)incrementing
- the symbol name will be one column, the project name another one
- when inserting an entry, both information will be inserted
- when reading, select only these entries where the project name matches

Thus you could have multiple entries with the same symbol name, but for different projects. The symbol name must be unique only within one project.

Thanks for your help,

Re: Tags for project only

Posted: Thu Apr 23, 2009 8:30 pm
by eranif
It is more complicated than that. adding an entry is not the issue here, the problem is allowing multiple symbols with the same name + signature - there are *many* places in the code that relies on this little fact.
Breaking this little rule, will cause a chain reaction :D I suspect that many functionalities of code completion will be broken - and this is the address a *really* non standard issue.

Can you explain to me why are you using this type of workspace configuration? and why making separate workspace per configuration type(?) is not acceptable?

Eran

Re: Tags for project only

Posted: Thu Apr 23, 2009 8:48 pm
by DSP_Programmer
Hello Eran,

just assume my task would look like this:

- I have the source code of a product x (implementing a certain functionality)
- I have the source code of a product y (implementing the same functionality, using lots of the same functions and names from project x).
- I have to write the source code for product z (implementing the same functionality, reuse some parts of product x, some parts of product y)

I tried to put 3 projects (x,y,z) into a single workspace (only project z must compile), than I can use the "Find in project" for my project, and "Find in workspace" for finding the implementatin in (x,y). It is just more convenient within one workspace than switching to a different workspace every time I have to check the implementation of a certain function (with the same name in all 3 projects) within the other projects.

But I can see your point, so I have to live with separate workspaces.

Thanks for support.