-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(participant): move state to history VSCODE-583
- Loading branch information
1 parent
3f720ab
commit a8a0405
Showing
2 changed files
with
244 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
export function createMarkdownLink({ | ||
commandId, | ||
data, | ||
name, | ||
}: { | ||
commandId: string; | ||
data?: | ||
| { | ||
[field: string]: any; | ||
} | ||
| string; | ||
name: string; | ||
}): vscode.MarkdownString { | ||
const encodedData = data | ||
? encodeURIComponent( | ||
`["${ | ||
typeof data === 'string' | ||
? data | ||
: encodeURIComponent(JSON.stringify(data)) | ||
}"]` | ||
) | ||
: undefined; | ||
const commandQueryString = data ? `?${encodedData}` : ''; | ||
const connName = new vscode.MarkdownString( | ||
`- <a href="command:${commandId}${commandQueryString}">${name}</a>\n` | ||
); | ||
connName.supportHtml = true; | ||
connName.isTrusted = { enabledCommands: [commandId] }; | ||
return connName; | ||
} |
Oops, something went wrong.