Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeWorkspaceSymbolProvider returns SymbolKind.Class instead of SymbolKind.Interface for C# interfaces #1907

Closed
craig006 opened this issue Dec 5, 2017 · 8 comments

Comments

@craig006
Copy link
Contributor

craig006 commented Dec 5, 2017

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version: 1.18.1
C# Extension version: 1.13.0

Steps to reproduce

Execute

Run this code from an extension in a C# project in VS Code:

commands.executeCommand('vscode.executeWorkspaceSymbolProvider', "ISomeInterface").then((result:SymbolInformation[]) => {
     console.log(result)           
})

Expected behavior

The SymbolInformation returned for symbol ISomeInterface has its kind property set to SymbolKind.Interface

i.e. result[0].kind should equal SymbolKind.Interface

Actual behavior

The SymbolInformation returned for symbol ISomeInterface has its kind property set to SymbolKind.Class

i.e. result[0].kind is set to SymbolKind.Class

Definition of ISomeInterface

public interface ISomeInterface
{
    void SomeMethod();
}
@rchande
Copy link

rchande commented Dec 5, 2017

@craig006 Good find--thanks for filing this.

@rchande
Copy link

rchande commented Dec 5, 2017

@akshita31 Here's another one for you.

@craig006
Copy link
Contributor Author

craig006 commented Dec 6, 2017

@akshita31 @rchande I created a fix here:
craig006@82fd0cd#diff-08c3f24b351caf5705429053d550e08a

These are all the vscode.SymbolKinds that I could reproduce. Omnisharp never returned types like "TypeParameter", "Variable" etc.

Let me know if you would like me to create a PR somewhere

@craig006
Copy link
Contributor Author

craig006 commented Dec 6, 2017

#1911

@rchande
Copy link

rchande commented Dec 6, 2017

Thanks @craig006. We'll take a look.

@DustinCampbell
Copy link
Member

Marking this as "resolved fixed", but I think there was a desire to have Delegate return SymbolKind.Method as well.

@DustinCampbell
Copy link
Member

Actually, I don't think SymbolKind.Method is the right choice. We don't do that in the completion list either: https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/features/completionItemProvider.ts#L111. The idea is that delegates are types and probably shouldn't be confused with methods. @rchande, what do you think? If you agree, I think this can be closed.

@rchande
Copy link

rchande commented Jan 3, 2018

@DustinCampbell I concur.

@rchande rchande closed this as completed Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants