microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

New icons for completion and symbols (operators, structs/unions, enum values, template arguments, macros) #2849

Closed sean-mcmanus closed 5 years ago

sean-mcmanus commented 5 years ago

Let us know if anyone has any problems with our icon usage.

Operators (previously used the function/method icon): image Structs/Unions (previously used the Class icon): image Enum values (previously used the Enum icon): image Template arguments (previously used the Enum icon): image Typedefs and using aliases (previously used the Class icon for symbols and the Enum icon for completion). We're using the "interface" icon for typedefs/aliases because VS Code provides no other alternative that is closer to the icon Visual Studio uses (extra (typedef) and (type alias) text should alleviate the confusion): image Macros/defines (previously used the Enum icon): image Folders (or symlinks to folders) (previously only files were selectable in #include completion): image Symbolic links to files (previously used the File icon corresponding to the symlink's type, not the target's type): This is possible, but I removed it because it doesn't seem to be worth it to check if every file is a symlink or not, just to have a different icon. Symlinks that are folders will appear as folders, which is the most important thing. image.

Unchanged icons: Classes/templates: image Enum types: image Functions/methods/constructors: image Member fields/variables: image Variables: image Namespaces: image

nxyd commented 5 years ago

Can you distinguish declaration and definition using different icons for function?

sean-mcmanus commented 5 years ago

@xiaoyongdong Not currently. Visual Studio supports that icon type (arrow over the purple cube for declarations) -- I've added a feature request for VS Code at https://github.com/Microsoft/vscode/issues/63617 . You could add to that issue if you think of other icons we should add as well.

We might be able to add text like "(declaration)" to the symbol name...or we might have to switch to the new DocumentSymbol API first: https://github.com/Microsoft/vscode-cpptools/issues/2230 .

sean-mcmanus commented 5 years ago

@xiaoyongdong Adding (declaration) text to the end of the symbol seems to be a workaround for the icon deficiences: https://github.com/Microsoft/vscode-cpptools/issues/2851 .

nxyd commented 5 years ago

@sean-mcmanus Thank you! According to you it maybe the best way currently if extension can't use different icons.

rewrking commented 5 years ago

Does the #include completion use the theme's folder icon if it's present?

sean-mcmanus commented 5 years ago

@andrew-r-king Yes, the icon image is (will be) based on the theme. E.g. image

sean-mcmanus commented 5 years ago

Updated icons/symbol info is supported now with our latest Insiders release: https://github.com/Microsoft/vscode-cpptools/releases . If you're using VS Code Insiders or have http.proxySupport not set to "off", you might not get the 0.21.0-insiders2 update automatically with C_Cpp.updateChannel set to "Insiders".