dotnet/roslyn

Unhandled ambiguity in doc comment completion

開放

#8,326 建立於 2016年2月2日

 (2 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-IDEhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

In the 4/3 end user preview, the IntelliSense support for <see> tags in XML documentation comments does not properly account for overloaded methods when one of the methods has an empty argument list.

Steps to reproduce

  1. Add the following methods to a class.

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }
    
    protected virtual void Dispose(bool disposing)
    {
    }
    
  2. Within the <summary> section of a documentation comment for any method in the class, type the following (the | represents the caret, and not an actual character).

    <see cref="Dis|"/>
    
  3. Press Ctrl+Space.

Expected behavior

Since the class contains two methods with the name Dispose, the completion suggestions should include a parameter list for each reference to these methods. In particular, the list should contain the following:

  1. Dispose()
  2. Dispose(bool)

Actual behavior

The reference to the Dispose method that has an empty parameter list is missing the required parameter list. In particular, the list contains the following instead of what I expected. If the first choice is added, the compiler will produce a warning that the reference to Dispose is ambiguous.

  1. Dispose
  2. Dispose(bool)

貢獻者指南