Bug 372875 - problem with semantic highlighting: operator[ std::string ]
Summary: problem with semantic highlighting: operator[ std::string ]
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-24 08:54 UTC by OlafLostViking
Modified: 2020-03-30 21:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OlafLostViking 2016-11-24 08:54:20 UTC
The most awesome semantic highlighting (one if the main selling points for KDevelop ;-) ) seems to have a problem when using the operator[] with strings. I saw it first when using libconfig++, but I built a minimal example with unordered_map:

	std::unordered_map< std::string, std::string > kde_map;
	std::cout << "KDevelop is " << kde_map[ "kdevelop" ] << "!" << std::endl;

Here you can see that the squared brackets are coloured differently.
Comment 1 Sven Brauch 2016-11-24 18:52:03 UTC
Not a bug; the [ is a use of std::unordered_map<std::string,std::string>::operator[std::string]. Move your mouse or cursor over it to see uses of the same operator or get further information.

Closing as invalid.
Comment 2 OlafLostViking 2016-11-24 20:41:06 UTC
Thanks for having a look!

While I agree that [ is the u_map::op[str], I am wondering why the second bracket is coloured differently (like a normal array ]) and not in the special colour of the first bracket [.

Just to clarify what I meant (I simply don't understand the different colours) - not to insist that I'm right or whatever ;)
Comment 3 Sven Brauch 2016-11-26 15:24:17 UTC
Certainly a debatable choice, I guess the simple answer is that a single use always has a single range in KDevelop, and for this you'd need to associate two ranges to one use, i.e. technical reasons.
Comment 4 Francis Herne 2020-03-30 21:49:40 UTC
*** Bug 419423 has been marked as a duplicate of this bug. ***