Bug 10053 - Completion is wrong under #if FOO
Summary: Completion is wrong under #if FOO
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 3.0.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-02-05 12:53 UTC by Andrey Rahmatullin
Modified: 2013-02-05 17:23 UTC (History)
1 user (show)

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:

Description Andrey Rahmatullin 2013-02-05 12:53:05 UTC
Description of Problem:
Looks like the parser takes into account conditiona compilation d

Steps to reproduce the problem:
In a new file in an empty method add #if FOO\n#endif directives and try to write code using completion between the directives.
Completion is completely broken, for example writing "int foo" will cause the completion to offer options for "foo", when in a normal situation it won't touch variable names in a declaration. Now switch the directive to "#if !FOO" and the completion will work. Note that adding a conditional symbol sto the project settings won't help: code in the the "commented out" branch will be completed properly while the code in the other branch will not, even though the highlighting is right (i.e. dependent on the project settings).
Comment 1 Andrey Rahmatullin 2013-02-05 12:54:53 UTC
The first statement should read "Looks like the parser takes into account conditional compilation directives but ignores symbols declared in the project settings, making it impossible to use completion in non-default compilation branches".
Comment 2 Mike Krüger 2013-02-05 17:21:03 UTC
y, it's by design - in #if branches that are not taken completion won't  work and in the general case it's not possible to provide it.

The other things are bugs that are fixed in the next release.
Comment 3 Andrey Rahmatullin 2013-02-05 17:23:50 UTC
Is completion not working in branches selected by the project configuration "by design" or "fixed"?