Closed LeeCenY closed 6 years ago
@Therzok Google translate : I think different issue. #4387 it's my feedback. Thanks
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
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.
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
@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.
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?
@olegoid yes!
Native UIPickerViewDataSource Methods
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
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.
@olegoid
@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.
@sgmunn GetComponentCount and GetRowsInComponent methods in IUIPickerViewDataSource are not automatically complementing.
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.
Please feel free to reopen and provide some additional clarifications so that we can address the issue better.
Steps to Reproduce
Expected Behavior
GetComponentCount GetRowsInComponent
Actual Behavior
IUIPickerViewDataSource protocol method not showing GetComponentCount and GetRowsInComponent. IUIPickerViewDelegate protocol method showing
Environment