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

Improve completion display by mapping more symbol kinds #1145

Merged
merged 1 commit into from
Jan 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions src/features/completionItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,27 @@ export default class OmniSharpCompletionItemProvider extends AbstractSupport imp
}

const _kinds: { [kind: string]: CompletionItemKind; } = Object.create(null);
_kinds['Variable'] = CompletionItemKind.Variable;
_kinds['Struct'] = CompletionItemKind.Interface;
_kinds['Interface'] = CompletionItemKind.Interface;
_kinds['Enum'] = CompletionItemKind.Enum;
_kinds['EnumMember'] = CompletionItemKind.Property;
_kinds['Property'] = CompletionItemKind.Property;

// types
_kinds['Class'] = CompletionItemKind.Class;
_kinds['Delegate'] = CompletionItemKind.Class; // need a better option for this.
_kinds['Enum'] = CompletionItemKind.Enum;
_kinds['Interface'] = CompletionItemKind.Interface;
_kinds['Struct'] = CompletionItemKind.Class; // need a better option for this.

// variables
_kinds['Local'] = CompletionItemKind.Variable;
_kinds['Parameter'] = CompletionItemKind.Variable;
_kinds['RangeVariable'] = CompletionItemKind.Variable;

// members
_kinds['EnumMember'] = CompletionItemKind.Property; // need a better option for this.
_kinds['Event'] = CompletionItemKind.Field; // need a better option for this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a long standing issue to add an event icon to that completion SVG in VS Code repo. Quite a shame it's still not there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I piled on microsoft/vscode#2628 a little while ago.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha - that one!

_kinds['Field'] = CompletionItemKind.Field;
_kinds['EventField'] = CompletionItemKind.File;
_kinds['Property'] = CompletionItemKind.Property;
_kinds['Method'] = CompletionItemKind.Method;
_kinds['Namespace'] = CompletionItemKind.Module;

// other stuff
_kinds['Label'] = CompletionItemKind.Unit; // need a better option for this.
_kinds['Keyword'] = CompletionItemKind.Keyword;
_kinds['Namespace'] = CompletionItemKind.Module;