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

More types for CompletionItemKind enum #2628

Closed
rkeithhill opened this issue Feb 2, 2016 · 40 comments
Closed

More types for CompletionItemKind enum #2628

rkeithhill opened this issue Feb 2, 2016 · 40 comments
Assignees
Labels
api feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@rkeithhill
Copy link

And then add an appropriate icon to display in completion lists. The PowerShellEditorServices extension helps the user auto-complete paths. When you have a list of folder contents it is very helpful to have an icon to distinguish between files and folders.

Compare this UI from VSCode for path completion:
vscodeintellisenseforfolders

To the UI from PowerShell ISE:
iseintellisenseforfolders
Having a nice, flat icon for a folder would be very nice to show in this list.

@daviwil
Copy link
Contributor

daviwil commented Feb 2, 2016

Agreed, this would be great to have!

@jrieken jrieken self-assigned this Feb 2, 2016
@jrieken jrieken added api feature-request Request for new features or functionality labels Feb 2, 2016
@jrieken
Copy link
Member

jrieken commented Feb 2, 2016

@bgashler1 fyi

@jrieken
Copy link
Member

jrieken commented Mar 16, 2016

related #4201

@jrieken jrieken changed the title Add Folder (or Directory) to the CompletionItemKind enum More types for CompletionItemKind enum May 25, 2016
@jrieken
Copy link
Member

jrieken commented May 25, 2016

@Jerry-Hong
Copy link

@jrieken Can I use it now?

@jrieken
Copy link
Member

jrieken commented Jul 20, 2016

@Jerry-Hong If by it you mean the currently existing ComplemtionItemKind member "yes". Otherwise you have to wait until this issue is resolved ;-)

@DustinCampbell
Copy link
Member

Looking forward to this.

@DustinCampbell
Copy link
Member

And FWIW, it'd be great to get several more of the icons from VS. We use many of these for C# in VS completion and finding analogs in VS Code is always a bit of a compromise.

Here are icons for which there is no good representation in VS Code's CompletionItemKind:

  • Event
  • Struct
  • Delegate
  • Extension method
  • Constant
  • Enum member
  • Operator
  • Type parameter
  • Versions of all icons with accessibility overlays (e.g. private, protected, internal, etc.)

Here's the basic list of what we use in completion: https://github.com/dotnet/roslyn/blob/master/src/Features/Core/Portable/Completion/CompletionTags.cs

This is the level of detail we use for Visual Studio: https://github.com/dotnet/roslyn/blob/master/src/Features/Core/Portable/Shared/Extensions/ISymbolExtensions_2.cs#L14-L169

It'd be great if I could replicate the icons in VS Code.

@jrieken
Copy link
Member

jrieken commented Jan 25, 2017

Yeah, our plan is to allow for custom icons

@DustinCampbell
Copy link
Member

cc @chrisdias

Please excuse the sarcasm in my response below @jrieken. I will buy whatever beers are needed to make up, but I need to make a point.

I suppose that would address the problem in some sense. However, it does seem a bit weird that we'd be providing "custom" icons from Visual Studio to workaround the issue that Visual Studio Code doesn't provide the appropriate Visual Studio artwork to support a Visual Studio language. It's seriously weird that Visual Studio artwork is provided for "Enum" while the Visual Studio artwork for "Enum Member" is not included. Rather than fix the oversight, the solution is to force all language extensions to provide that artwork (which would be Visual Studio's artwork if they want to stay consistent) themselves? I thought that Visual Studio Code had intended to standardize on the look and feel of Visual Studio at one point. Does that not include standardizing on important pieces of artwork that are included in the Visual Studio family of products?

Will custom icons be supported by the language server protocol if we choose to implement that at some point? If not, how will extensions that provide Visual Studio language support for Visual Studio Code via the language server protocol (e.g. C++) be able to implement completion in a way that is Visual Studio-grade?

Even TypeScript provides overlays for member accessibility in Visual Studio (using the same artwork C# and other languages in Visual Studio do).

image

However, it can't do the same in Visual Studio Code:

image

@jrieken
Copy link
Member

jrieken commented Jan 25, 2017

Sorry that I have ruined your morning ;-).

I guess my previous comment was a bit too short and didn't explain enough. Saying that we will eventually allow for custom icons doesn't exclude adding more default icons. However, the problem is unbounded and currently we are caught in a catch up game. There is no answer to what the full set of icons is, so we can either keep it simple (like an enum member is just a member), allow for custom icons, or keep adding more icons.

Talking about the language server protocol and other editors I honestly don't know what's best: Think of the icon for 'extension method' which isn't a frequently occurring feature in programming languages. Will someone draw an icon that fits into Atom and Sublime? Will someone just copy the icons we ship? Will an existing icon be overloaded/reused, say 'method'?

So far we have been guided by a somewhat fuzzy 'common denominator' approach to fit most programming languages and things like access modifiers fit nicely into that but it also means we cannot cover everything from any language.

@DustinCampbell
Copy link
Member

Oh, you didn't ruin my morning at all Joh. 😄

I'm willing to be part of any conversation about determining the 'common denominator' set of icons. I even promise to not push for making the common denominator just the set required by C#. 😄

@jrieken jrieken added this to the February 2017 milestone Jan 25, 2017
@jrieken
Copy link
Member

jrieken commented Jan 25, 2017

Perfect. We are now in the Jan endgame. I'll schedule this for Feb and get in touch with you when it's time.

@DustinCampbell
Copy link
Member

Sounds good. You might want to include @markw-t from the VS editor team as well.

@markw-t
Copy link

markw-t commented Jan 25, 2017

Thanks for the add guys. It makes perfect sense to me that Visual Studio Code extenders would be able to create parity experiences to Visual Studio without creating custom art - a single "Visual Studio Family" experience should be possible in completion lists like this as @DustinCampbell suggests above; so the Visual Studio Code default set should include all the values found in the Visual Studio enum if possible.

@kieferrm kieferrm mentioned this issue Feb 6, 2017
38 tasks
@jrieken
Copy link
Member

jrieken commented Feb 20, 2017

Sorry, this has slipped. Blame me for being on vacations 🌴. Moving to March

@jrieken jrieken modified the milestones: March 2017, February 2017 Feb 20, 2017
@kieferrm kieferrm mentioned this issue Mar 3, 2017
58 tasks
@jrieken
Copy link
Member

jrieken commented Mar 21, 2017

Let's start to tackle this by adding some more common-denominator icons. I'd like to propose that we for now leave the modifier icons out of the equation. It's a little unlucky that we have called it CompletionItemKind and SymbolKind and I have the feeling we shouldn't add all variants in there but add the concept of a KindModifier such that both can determine the visual representation of something.

For the set of common icons we have things like Snippet, Color or File that describe more or less literals and things that occur in programming languages, like Function or Interface. In #2628 (comment) @DustinCampbell suggests to add more icons to the latter bucket which is OK with me as long as we don't make it too specific for a single language.

Can we come with a N-programming-languages-have-this-rule? For instance, more than N programming languages support interfaces so we have CompletionItemKind.Interface. Unsure what N should be, for sure N > 1 maybe something around 3-5 of the most commonly used languages.

jrieken added a commit that referenced this issue Mar 22, 2017
@jrieken
Copy link
Member

jrieken commented Mar 22, 2017

  • added enumeration member as vscode.CompletionItemKind.EnumMember. Should go together with CompletionKindKind.Enum. N-languages-have-this-rule justification: C, C++, C#, Swift, TypeScript, Java etc...

@DustinCampbell
Copy link
Member

Extension Method makes sense to leave off. Event is the one I'm probably most interested in. I figure that's probably used a ton since it appears in all the .NET languages (i.e. C#, F#, VB, PowerShell, etc.) plus other languages like HTML:

image

@jrieken
Copy link
Member

jrieken commented Apr 5, 2017

True - I have forget that one.

@jrieken
Copy link
Member

jrieken commented Apr 18, 2017

Added 'Event' and 'Operator', unsure what icon to use for TypeParam. fyi @aeschli about the Event completion kind and above sample

@DustinCampbell
Copy link
Member

The one we use for C# and Visual Basic in VS looks like this:

image

I think C++ uses something different.

@jrieken
Copy link
Member

jrieken commented Apr 19, 2017

I have found this one which fits Foo<T> but also reminds me of a word processor...

screen shot 2017-04-19 at 10 05 49

@DustinCampbell
Copy link
Member

DustinCampbell commented Apr 19, 2017

I might be wrong, but I think that's what C++ uses for templates. For us, that always felt a little "on the nose", if you get my meaning. A little too precise. That said, I'm comfortable with what you decide to pick.

@jrieken
Copy link
Member

jrieken commented Apr 19, 2017

I understand, and the icon is labeled as template but I couldn't find the T-icon. Nothing we cannot change later, what matters is that the kinds are exposed in the api

@DustinCampbell
Copy link
Member

I haven't looked in the image library in awhile, but if it helps, C# uses the image indexed by GlyphGroupType in Microsoft.VisualStudio.Language.IntelliSense.StandardGlyphGroup.

@jrieken
Copy link
Member

jrieken commented Apr 21, 2017

Closing this since we now have these completion item kinds. We can still change icons via separate issues. Happy Coding!

@jrieken jrieken closed this as completed Apr 21, 2017
@DustinCampbell
Copy link
Member

Thanks for your work here @jrieken! I'm really looking forward to using these.

@jrieken jrieken added the verification-needed Verification of issue is requested label Apr 25, 2017
@chrmarti chrmarti added the verified Verification succeeded label Apr 26, 2017
@chrmarti
Copy link
Contributor

screen shot 2017-04-26 at 4 00 02 pm
screen shot 2017-04-26 at 4 00 16 pm
screen shot 2017-04-26 at 4 00 23 pm
screen shot 2017-04-26 at 4 00 55 pm
screen shot 2017-04-26 at 4 01 11 pm
screen shot 2017-04-26 at 4 01 33 pm

LGTM, verified. (Note that the lists are not identical, I assume that's by design.)

@DustinCampbell
Copy link
Member

@jrieken: Any idea when these icons will make their way into the LSP?

@jrieken
Copy link
Member

jrieken commented Oct 25, 2017

@dbaeumer will know

@dbaeumer
Copy link
Member

@DustinCampbell
Copy link
Member

Thank you sir!

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants