Bug 15753 - Alias not resolved in editor
Summary: Alias not resolved in editor
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 4.1.12
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2013-10-28 14:40 UTC by josea
Modified: 2013-10-30 14:07 UTC (History)
1 user (show)

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


Attachments
project with issue (1.43 MB, application/octet-stream)
2013-10-29 07:40 UTC, josea
Details


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 FIXED

Description josea 2013-10-28 14:40:08 UTC
In the code below the editor does not recognizes NativeImage. The compiler works fine, but all the editor suggestions/autocomplete go away.

It does not seem that Xamarin Studio supports precompiler directives in combination to aliases. 

This would be handful in the case of libraries that work with native objects.


using System;
#if __IOS__
using NativeImage = MonoTouch.UIKit.UIImage;
#endif

namespace iCatalogXn.iOS
{
	public class Myclass
	{

         public void MyMethod(){
             NativeImage i; /// the editor does not recognize the properties of i
         }
        }
}
Comment 1 Mike Krüger 2013-10-29 01:46:41 UTC
Works for me in the master version (4.0.13 should be fine).

Is NativeImage marked as red in the editor ?
Comment 2 josea 2013-10-29 07:39:07 UTC
Yes. It is marked as red. Please note that we are in the alpha channel (other recently resolved bugs forced us to move to alpha to keep going).

I attached sample project with the issue in the delegate class.

My versions: 

=== Xamarin Studio ===

Version 4.1.12 (build 6)
Installation UUID: 9e1bceeb-67ea-4691-93f9-0fea4ee4bb0c
Runtime:
	Mono 3.2.3 ((no/8d3b4b7)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302030000

=== Apple Developer Tools ===

Xcode 5.0 (3332.25)
Build 5A1413

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: 7.0.3.213 (Business Edition)
Hash: cea17d0
Branch: 
Build date: 2013-18-10 17:54:48-0400

=== Xamarin.Android ===

Version: 4.10.0 (Business Edition)
Android SDK: /Users/josea2/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Build Information ===

Release ID: 401120006
Git revision: a9ae69a4bf37955e4ab4df0cec7804f574c51f72
Build date: 2013-09-25 16:59:37+0000
Xamarin addins: 761ae26f220068dda0b62f0dd2253f617589a8c6

=== Operating System ===

Mac OS X 10.8.5
Darwin Mac-Josea1.local 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
Comment 3 josea 2013-10-29 07:40:52 UTC
Created attachment 5260 [details]
project with issue
Comment 6 Mike Krüger 2013-10-29 07:47:12 UTC
__IOS__ isn't defined - that's why it's not working
Comment 7 Mike Krüger 2013-10-29 07:54:18 UTC
It needs maybe solved in the project system.

config.DefineSymbols should contain __IOS__ - that needs to be added to the project configuration somehow.

(I assume that __ANDROID__ is defined for android projects and would need similiar treatment)


Maybe as config.CompilerGeneratedSymbols (mcs defines __MonoCS__ - could be part of that as well - would make a difference when compiling with csc on windows).


workaround: Add __IOS__ to the defined symbols of your project.
Comment 8 josea 2013-10-29 12:29:57 UTC
The workaround works for me... thanks.
Comment 9 Jeffrey Stedfast 2013-10-30 14:07:42 UTC
fixed in git