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

Add ability to change snippets icon #22206

Closed
BrunnerLivio opened this issue Mar 8, 2017 · 8 comments
Closed

Add ability to change snippets icon #22206

BrunnerLivio opened this issue Mar 8, 2017 · 8 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code snippets under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues

Comments

@BrunnerLivio
Copy link

I would like to colorize or optionally add a own icon for snippets.

Use Case:

I have snippets, which "converts" to hex codes. I don't want to write a whole extension, just to see the color of the outcoming hex code.

Example Image:
Example Image

A solution to add styling could be :

"Material Active Icon Light": {
	"prefix": "md-active-icon-light",
	"body": [
		"rgba(255, 255, 255, 1)"
	],
        "display": {
                 "style" : {
                         "background-color": "green" 
                 }
        }
}
@GriNAME
Copy link

GriNAME commented Mar 9, 2017

upd: I wanted to write +

@GriNAME
Copy link

GriNAME commented Mar 9, 2017

I like how it looks in Atom

image

@jrieken
Copy link
Member

jrieken commented Mar 9, 2017

You can achieve this when not using snippets but a CompletionItemProvider that returns completions of type color. Our css/less/sass tooling does exactly that.

screen shot 2017-03-09 at 11 10 56

@BrunnerLivio
Copy link
Author

@jrieken Thanks for the response!

I know that it is possible using CompletionItemProvider. But do you consider adding this option also to a snippets configuration? So it would be easy for everyone to add color preview.

@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Apr 11, 2017
@aStonedPenguin
Copy link

@jrieken That's a bit much for most use cases don't you think? Custom colors/icons would be a great way to make use of the limited text space with snippets.

@jrieken
Copy link
Member

jrieken commented Jun 2, 2017

So it would be easy for everyone to add color preview.

I'd learn more about this. It seems you think having a completion item provider isn't easy? Why is that? You shouldn't need much more than this

    vscode.languages.registerCompletionItemProvider('abc', new class implements vscode.CompletionItemProvider {
        provideCompletionItems(doc, pos) {

            return [
                this._createColorItem('$color-accent', 'rgb(0, 122, 204)'),
                this._createColorItem('$color-bg-dark', '#0000cc'),
                this._createColorItem('$color-bg-light', 'HSL(30%, 100%, 50%)'),
            ];
        }
        private _createColorItem(label: string, color: string) {
            let item = new vscode.CompletionItem(label);
            item.documentation = color;
            item.kind = vscode.CompletionItemKind.Color;
            return item;
        }
    }());

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Sep 12, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 12, 2018

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Sep 12, 2018
@BoomRaccoon
Copy link

I was wondering why this has been layed off. I would love to have the option to add the default icons VSCode uses.
Having a visual help to differentiate between methods, objects and properties is great. And an additional JSON-key to add a background-color to snippets would make it clear which snippets are user defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code snippets under-discussion Issue is under discussion for relevance, priority, approach ux User experience issues
Projects
None yet
Development

No branches or pull requests

7 participants