dotnet/roslyn

Unhandled ambiguity in doc comment completion

Aperta

#8326 aperta il 2 feb 2016

 (2 commenti) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-IDEhelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

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)

Guida contributor