Bug 39102 - Intellisense evaluator does not consider build action of source code files
Summary: Intellisense evaluator does not consider build action of source code files
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 5.10 (C6SR3)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2016-02-24 20:16 UTC by Adam
Modified: 2016-02-25 11:05 UTC (History)
1 user (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:
RESOLVED ANSWERED

Description Adam 2016-02-24 20:16:18 UTC
Classes contained in .cs files are still traversed, and used to populate the intellisense/highlighting/go-to-definition databases.
This results in a conflict between the on-screen syntax highlighting etc, and the actual compiler.

Add a source code file to your project, and populate it with a C# class with public members. Set it's build action to compile.
In another file, type some code, and use the class - it will be resolved, highlighted as a known class etc.
Then, in the solution explorer, set the build action of the class to ANYTHING but "compile".
Go back to the other file - note that the class is still highlighted as valid.
Clean/recompile your project, you will get build errors, but the item remains highlighted.
Restart XS - class remains highlighted.
Comment 1 Adam 2016-02-24 20:17:42 UTC
Sorry, that first line should read

"Classes contained in .cs files are still traversed, and used to populate the intellisense/highlighting/go-to-definition databases, irrespective of the file's build action."
Comment 2 Adam 2016-02-24 20:29:52 UTC
Additional problem caused by this issue:

Because the editor thinks you have a valid class definition already, you don't get the context menu "Resolve > using import.some.resolvable.namespace".
Can be a bit of a pain.
Comment 3 Mike Krüger 2016-02-25 11:05:02 UTC
should work in 6.0/alpha channel