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
Adds codicons to hovers #85580
Conversation
|
||
export interface MarkdownRenderOptions extends FormattedTextRenderOptions { | ||
codeBlockRenderer?: (modeId: string, value: string) => Promise<string>; | ||
codeBlockRenderCallback?: () => void; | ||
} | ||
|
||
const codiconsRegex = /^codicon:\/\/(.*)$/; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
* Closes microsoft#85579 - adds codicons to hovers * Uses `icon://vscode.codicons/icon-name` url structure
This PR fixes #85579
This allows the use of codicons in markdown images (as the href), e.g.
![](codicon://$(git-commit))
. I opted for thecodicon://
to keep is more url-like and to make it easier (and more exact) to detect/parse/cc @jrieken