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

Adds codicons to hovers #85580

Merged
merged 2 commits into from Nov 26, 2019
Merged

Adds codicons to hovers #85580

merged 2 commits into from Nov 26, 2019

Conversation

eamodio
Copy link
Contributor

@eamodio eamodio commented Nov 26, 2019

This PR fixes #85579

This allows the use of codicons in markdown images (as the href), e.g. ![](codicon://$(git-commit)). I opted for the codicon:// to keep is more url-like and to make it easier (and more exact) to detect/parse

/cc @jrieken

@eamodio eamodio self-assigned this Nov 26, 2019

export interface MarkdownRenderOptions extends FormattedTextRenderOptions {
codeBlockRenderer?: (modeId: string, value: string) => Promise<string>;
codeBlockRenderCallback?: () => void;
}

const codiconsRegex = /^codicon:\/\/(.*)$/;
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I wonder if the actual codicon should be the path, not the auth part, e.g. codicon:zap or both, or more hierarchical via icon://codeicon/zap?

Copy link
Member

Choose a reason for hiding this comment

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

the icon://auth/name part would have the advantage that it's open for contributions, e.g we could expose other contributed icons like that, for instance `icon://foo.extension/bar-name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, that sounds good. I'll make that change.

Copy link
Member

@jrieken jrieken Nov 26, 2019

Choose a reason for hiding this comment

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

FYI - I will also invest some time to see what it takes to support this custom trees and (stretch) in menu items. That helps me with the call hierarchy tree view and I think it will also make this story more complete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is now using icon://vscode.codicons/git-commit url format now. Should allow for different builtin icon styles as well as can be extended to extensions using icon://foo.extension/icon-name as you suggested.

@eamodio eamodio merged commit 255766f into master Nov 26, 2019
@eamodio eamodio deleted the eamodio/hover-codicons branch November 26, 2019 19:47
@eamodio eamodio added this to the November 2019 milestone Nov 26, 2019
devrsi0n pushed a commit to devrsi0n/vscode that referenced this pull request Nov 27, 2019
* Closes microsoft#85579 - adds codicons to hovers

* Uses `icon://vscode.codicons/icon-name` url structure
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow use of codicons in hovers
2 participants