Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)

* Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d

* Fix vs unit tests and hygiene issue

* Fix strict null check issue
This commit is contained in:
Chris LaFreniere
2019-06-10 18:27:09 -07:00
committed by GitHub
parent ff38bc8143
commit d15a3fcc98
926 changed files with 19529 additions and 11383 deletions

View File

@@ -111,6 +111,23 @@ class LinkOccurrence {
}
private static _getOptions(link: Link, useMetaKey: boolean, isActive: boolean): ModelDecorationOptions {
const options = { ...this._getBaseOptions(link, useMetaKey, isActive) };
if (typeof link.tooltip === 'string') {
const message = new MarkdownString().appendText(
platform.isMacintosh
? useMetaKey
? nls.localize('links.custom.mac', "Cmd + click to {0}", link.tooltip)
: nls.localize('links.custom.mac.al', "Option + click to {0}", link.tooltip)
: useMetaKey
? nls.localize('links.custom', "Ctrl + click to {0}", link.tooltip)
: nls.localize('links.custom.al', "Alt + click to {0}", link.tooltip)
);
options.hoverMessage = message;
}
return options;
}
private static _getBaseOptions(link: Link, useMetaKey: boolean, isActive: boolean): ModelDecorationOptions {
if (link.url && /^command:/i.test(link.url.toString())) {
if (useMetaKey) {
return (isActive ? decoration.metaCommandActive : decoration.metaCommand);