After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620880 - Vala symbols are shown multiple times
Vala symbols are shown multiple times
Status: RESOLVED DUPLICATE of bug 617472
Product: anjuta
Classification: Applications
Component: plugins: symbol-db
2.31.x
Other Linux
: Normal normal
: Anjuta 2.32
Assigned To: Massimo Cora'
Anjuta maintainers
Depends on: 615403
Blocks:
 
 
Reported: 2010-06-07 18:39 UTC by Johannes Schmid
Modified: 2010-07-01 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Johannes Schmid 2010-06-07 18:39:08 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.
Comment 1 Abderrahim Kitouni 2010-06-29 09:24:21 UTC
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.
Comment 2 Johannes Schmid 2010-06-29 09:52:35 UTC
OK, thanks for the feedback!

@naba, PeSc|O: You turn ;)
Comment 3 Naba Kumar 2010-06-29 21:19:18 UTC
(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.
Comment 4 Naba Kumar 2010-07-01 20:23:03 UTC
It's actually just duplicate of bug 617472

*** This bug has been marked as a duplicate of bug 617472 ***