GNOME Bugzilla – Bug 620880
Vala symbols are shown multiple times
Last modified: 2010-07-01 20:23:03 UTC
To test you can import the vala sources for example. You will see that several structs are shown multiple times in the local view and as well in the global view. Looks like a problem in the ctags parser.
I beleive the bug isn't in the ctags parser (or, if it is there, it's a very subtle one). First, note that the classes are not shown twice : the two instances are different (just click on them and you'll see that one is in another file). This shouldn't be a problem with other projects, but in vala it is since all vapi files are indexed (this may also be a problem for other libraries, but I didn't try). So I'm looking at the SQL query used to retrieve the results (in symbol-db-model-file.c) : SELECT symbol.symbol_id, symbol.name, symbol.file_position, symbol.scope_definition_id, symbol.signature, symbol.returntype, file.file_path, sym_access.access_name, sym_type.type_type, sym_type.type_name, sym_kind.is_container FROM symbol LEFT JOIN file ON symbol.file_defined_id = file.file_id LEFT JOIN sym_access ON symbol.access_kind_id = sym_access.access_kind_id LEFT JOIN sym_type ON symbol.type_id = sym_type.type_id LEFT JOIN sym_kind ON symbol.kind_id = sym_kind.sym_kind_id WHERE ... OR ( symbol.scope_id = ## /* name:'parent' type:gint */ AND symbol.kind_id NOT IN ( SELECT sym_kind_id FROM sym_kind WHERE sym_kind.kind_name = 'namespace' ) AND symbol.scope_definition_id IN ( SELECT scope_id FROM symbol JOIN file ON symbol.file_defined_id = file.file_id WHERE file.file_path = ## /* name:'filepath' type:gchararray */ GROUP BY symbol.scope_id ) ) the last part is the one that leads to selecting the other symbol in another file. I don't understand what's the difference between scope_id and scope_definition_id but it seems to me that it's looking for symbols (exluding namespaces) that are in the same scope but in other files (something like C++ methods defined out of the class?). Anyway, the problem isn't that the parser is writing duplicate symbols, but rather that the project contains duplicate symbols that are showed as being in the opened file although they aren't.
OK, thanks for the feedback! @naba, PeSc|O: You turn ;)
(In reply to comment #2) > OK, thanks for the feedback! > > @naba, PeSc|O: You turn ;) See bug 617472 and bug 615429 (point 1), and the root cause bug 615403, which both depends on. This one is also root-caused by bug 615403. I guess we will look into it once symbol-db engine re-factoring progresses to a suitable stage.
It's actually just duplicate of bug 617472 *** This bug has been marked as a duplicate of bug 617472 ***