Skip to content

Commit

Permalink
Convert TerminalLink.length to endIndex
Browse files Browse the repository at this point in the history
Aligns more with other APIs

Part of #91290
  • Loading branch information
Tyriar committed Jun 24, 2020
1 parent 756aebf commit 48ce8ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/api/common/extHostTerminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 48ce8ec

Please sign in to comment.