提交 48ce8ecc 编写于 作者: D Daniel Imms

Convert TerminalLink.length to endIndex

Aligns more with other APIs

Part of #91290
上级 756aebf0
......@@ -1089,14 +1089,14 @@ declare module 'vscode' {
export interface TerminalLink {
/**
* The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
* The 0-based start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
startIndex: number;
/**
* The length of the link on [TerminalLinkContext.line](#TerminalLinkContext.line]
* The 0-based end index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
length: number;
endIndex: number;
/**
* The tooltip text when you hover over this link.
......
......@@ -625,10 +625,11 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
for (const provideResult of provideResults) {
if (provideResult && provideResult.links.length > 0) {
result.push(...provideResult.links.map(providerLink => {
const endIndex = Math.max(providerLink.endIndex, providerLink.startIndex + 1);
const link = {
id: nextLinkId++,
startIndex: providerLink.startIndex,
length: providerLink.length,
length: endIndex - providerLink.startIndex,
label: providerLink.tooltip
};
cacheLinkMap.set(link.id, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册