mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

IUIPickerViewDataSource protocol method not showing #4486

Closed LeeCenY closed 6 years ago

LeeCenY commented 6 years ago

Steps to Reproduce

  1. IUIPickerViewDataSource
  2. GetComponentCount and GetRowsInComponent

Expected Behavior

GetComponentCount GetRowsInComponent

   public nint GetComponentCount(UIPickerView pickerView){  }
   public nint GetRowsInComponent(UIPickerView pickerView, nint component){ }

Actual Behavior

IUIPickerViewDataSource protocol method not showing GetComponentCount and GetRowsInComponent. IUIPickerViewDelegate protocol method showing

Environment

=== Visual Studio Community 2017 for Mac ===

Version 7.4.2 (build 12)
Installation UUID: 891dc29f-4210-4ba9-a91b-9564b6fea41d
Runtime:
    Mono 5.8.1.0 (2017-10/6bf3922f3fd) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 508010000

=== NuGet ===

版本: 4.3.1.4445

=== .NET Core ===

运行时: /usr/local/share/dotnet/dotnet
运行时版本:
    2.0.5
    2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK 版本:
    2.1.4
    2.0.0
MSBuild SDK: /Library/Frameworks/Mono.framework/Versions/5.8.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

版本: 1.6.1
位置:/Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.3 (14154)
Build 9E145

=== Xamarin.Mac ===

Version: 4.2.1.28 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.9.1.24 (Visual Studio Community)
Hash: f62de472
Branch: xcode9.3
Build date: 2018-03-29 19:30:53-0400

=== Xamarin.Android ===

版本: 8.2.0.16 (Visual Studio Community)
Android SDK: /Users/ttlgzmac6/Library/Developer/Xamarin/android-sdk-macosx
    受支持的 Android 版本:
        2.3   (API 级别 10)
        4.0.3 (API 级别 15)
        4.4   (API 级别 19)
        5.0   (API 级别 21)
        6.0   (API 级别 23)
        7.0   (API 级别 24)
        7.1   (API 级别 25)
        8.1   (API 级别 27)

SDK 工具版本: 25.2.5
SDK 平台工具版本: 27.0.1
SDK 生成工具版本: 27.0.0

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL 代码在此处提供:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 704020012
Git revision: 0d8e3f0a4d683771f17959739956fa09c7ba21e3
Build date: 2018-03-30 10:45:17-04
Xamarin addins: 958839ea56ab1e331caf7c92b6ad50fb9e6ee9d2
Build lane: monodevelop-lion-d15-6

=== Operating System ===

Mac OS X 10.13.4
Darwin 17.5.0 Darwin Kernel Version 17.5.0
    Mon Mar  5 22:24:32 PST 2018
    root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1

VS bug #612548

Therzok commented 6 years ago

Fixed via https://github.com/mono/monodevelop/pull/4387

LeeCenY commented 6 years ago

@Therzok Google translate : I think different issue. #4387 it's my feedback. Thanks

LeeCenY commented 6 years ago

Via #4387 fixed https://github.com/mono/monodevelop/issues/4216 Did not fixed IUIPickerViewDataSource

=== Visual Studio Community 2017 for Mac ===

Version 7.5 (build 1254)
Installation UUID: 891dc29f-4210-4ba9-a91b-9564b6fea41d
Runtime:
    Mono 5.10.1.47 (2017-12/8eb8f7d5e74) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 4.4.0.36 (master / 0c7c49a6)

    Package version: 510010047

=== NuGet ===

版本: 4.3.1.4445

=== .NET Core ===

运行时: /usr/local/share/dotnet/dotnet
运行时版本:
    2.0.5
    2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK 版本:
    2.1.4
    2.0.0
MSBuild SDK: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

版本: 1.6.2
位置:/Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.3 (14154)
Build 9E145

=== Xamarin.Mac ===

Version: 4.4.1.176 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.10.1.177 (Visual Studio Community)
Hash: 7e782c1e
Branch: d15-7
Build date: 2018-04-25 15:27:13-0400

=== Xamarin.Android ===

版本: 8.3.0.19 (Visual Studio Community)
Android SDK: /Users/ttlgzmac6/Library/Developer/Xamarin/android-sdk-macosx
    受支持的 Android 版本:
        2.3   (API 级别 10)
        4.0.3 (API 级别 15)
        4.4   (API 级别 19)
        5.0   (API 级别 21)
        6.0   (API 级别 23)
        7.0   (API 级别 24)
        7.1   (API 级别 25)
        8.1   (API 级别 27)

SDK Tools 版本: 25.2.5
SDK 平台工具版本: 27.0.1
SDK 生成工具版本: 27.0.0

Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Android Designer EPL 代码在此处提供:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 705001254
Git revision: 498923ea36d2c7fe440c4e4b8cfb75bd50bbd748
Build date: 2018-05-05 10:35:24-04
Xamarin addins: 219f1c4943b4693b837b4173dd10ea982a47c852
Build lane: monodevelop-lion-d15-7

=== Operating System ===

Mac OS X 10.13.4
Darwin 17.5.0 Darwin Kernel Version 17.5.0
    Mon Mar  5 22:24:32 PST 2018
    root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1
olegoid commented 6 years ago

Hi @LeeCenY,

The interface methods you mentioned in the bug description are not optional. Neither these methods are optional category methods. Hence to implement them you could use the standard "Implement interface" refactoring function.

screen shot 2018-05-09 at 3 03 46 pm

The behavior you described is a standard Roslyn completion for interface methods (it should work the same way in Visual Studio 2017 on Windows).

If you believe that the completion should be changed please file a feature request here: https://github.com/dotnet/roslyn/issues

LeeCenY commented 6 years ago

@olegoid I don't quite understand. Stupidity asks https://github.com/mono/monodevelop/issues/4216 that the interface does not display problems, but it can also be repaired in MonoDevelop.

olegoid commented 6 years ago

Hey @LeeCenY,

I don't quite understand either ;) So, the way I see it (please correct me if I'm wrong here) you expect to see interface methods in autocompletion. Is that correct?

LeeCenY commented 6 years ago

@olegoid yes!

Native UIPickerViewDataSource Methods

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
olegoid commented 6 years ago

Alright, @LeeCenY, I get your point now. The bottom line is that Roslyn analyzer doesn't provide autocompletion for interface methods.

This, however, shouldn't slow down your productivity because you can implement interface methods using Refactor -> Implement interface feature (the one I demonstrated with the screenshot here https://github.com/mono/monodevelop/issues/4486#issuecomment-387843699)

This perhaps leaves you wondering "Why Visual Studio doesn't provide autocompletion for required methods and shows autocompletion for optional category methods at the same time?"

Well, we do that because native categories might have optional methods. In C# all interface methods are required. Hence, Refactor -> Implement interface feature will implement only required methods and will leave optional methods aside.

To make it easier for our customers to implement optional methods we provide autocompletion. For regular (required) category methods we expect developers to use Refactor -> Implement interface.

LeeCenY commented 6 years ago

@olegoid image image

sgmunn commented 6 years ago

@LeeCenY Can you share more of the code you are trying to get code completion for? Your screenshot truncates to much and I cannot quite follow the issue you are having.

LeeCenY commented 6 years ago

@sgmunn GetComponentCount and GetRowsInComponent methods in IUIPickerViewDataSource are not automatically complementing.

sgmunn commented 6 years ago

Can you give a better example for me please. I cannot tell from your screenshot the scenario in which they are not auto completing. As Oleg mentioned, if you implement the interface the methods are available in code completion.

sgmunn commented 6 years ago

Please feel free to reopen and provide some additional clarifications so that we can address the issue better.