Bug 37470 - Add 'nameof' operator to language keywords.
Summary: Add 'nameof' operator to language keywords.
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 5.10 (C6SR3)
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2016-01-07 04:09 UTC by Matthew Robbins
Modified: 2016-09-19 12:39 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Matthew Robbins 2016-01-07 04:09:27 UTC
Add the 'nameof' operator to the keywords list in MonoDevelop so it is available for autocompletion and syntax highlighting.

https://github.com/mono/monodevelop/blob/944d0f2ce9e3087d8a750d69efe83e5a3a45316c/main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml

The "Operator" keywords list could just be changed to:

	<Keywords color = "Keyword(Operator)">
		<Word>as</Word>
		<Word>is</Word>
		<Word>nameof</Word>
		<Word>new</Word>
		<Word>sizeof</Word>
		<Word>typeof</Word>
		<Word>stackalloc</Word>
	</Keywords>
Comment 1 Mike Krüger 2016-01-07 06:36:44 UTC
Fixed in 6.0

Unfortunately it's not so easy - the nameof operator needs semantic highlighting support :/.

int nameof = 5; is valid and shouldn't be colored.
Comment 2 Matthew Robbins 2016-01-07 06:49:09 UTC
Ah damn, that is painful.

I didn't realize it was contextual, I thought it was a reserved language keyword :/

Out of curiosity, is 6.0 the release for Roslyn Mike?
Comment 3 Mike Krüger 2016-01-07 07:42:28 UTC
yes - the 6.0 release is in internal testing and it looks good.
We're doing atm final polish.
Because of the roslyn work we didn't have full c#6 support in the 5.x line.
We underestimated the roslyn switch a bit.
Comment 4 Matthew Robbins 2016-01-07 09:08:10 UTC
Sweeet, I can't wait for Roslyn! Been building an analysis and refactoring addin for Xamarin.Android so Roslyn will enable me to make a bunch of very cool things (NRefactory is awesome as well but I can't sink time into it if its being retired).

Thanks again and keep up the good work :D