Visual Studio代码:如何在IntelliSense中显示过载?

时间:2016-11-06 19:31:54

标签: c# visual-studio-code

我正在使用Visual Studio Code上的新asp.net核心1.0框架。

我的问题是,如何遍历方法可能包含的所有重载?

VS Code method overloads

2 个答案:

答案 0 :(得分:6)

在那个阶段你可以按(,它会提示你过载。

举个例子:

enter image description here

我按this.M1(,我得到:

enter image description here

如果我碰巧改变焦点,我可以回到#============= Importations ===================== from datetime import date #============= Classe =========================== class Pret : #----------- Constructeur ----------------------------- def __init__(self,p_date:str,p_duree_max:int,p_nbr_renouv): #.... Déclaration des données membres .... self.__date_debut = None # date self.__duree_max = 0 # int self.__nbr_renouv = 0 # int #.... Code .... self.__date_debut = p_date self.__duree_max = p_duree_max self.__nbr_renouv = p_nbr_renouv #----------- Autres méthodes ------------------------- def calculer_date_retour(): debut=self.__date_debut debut_a_auj= debut.toordinal() date_retour=fromordinal(debut_a_auj+self.__duree_max) return date_retour 的电话并按 Ctrl + Shift + Space 再次获得过载提示:

enter image description here

与Visual Studio几乎相同。

这是在VS Code 1.7.1,C#1.4.1扩展中。

答案 1 :(得分:2)

我无法评论接受的答案,但是如果有人遇到Dawson B提到的问题,在启用了vim扩展的情况下您无法浏览超载的小窗口,我找到了一个解决方案。很难确定该窗口的名称,因为它不易用Google搜索,但显然是ParameterHint

使用Ctrl+K Ctrl+S打开键盘快捷键,搜索“提示”,单击showNextParameterHint左侧的铅笔,更改为Alt+N,然后将showPrevParameterHint更改为{{ 1}},以免干扰Alt+P与Intellisense建议导航的绑定。当然,如果这些与您拥有的其他扩展/自定义绑定冲突,请选择最合适的方法。