Skip to content

Commit

Permalink
API feedback for comment reactor (#202098)
Browse files Browse the repository at this point in the history
Part of #201131
  • Loading branch information
alexr00 authored Jan 9, 2024
1 parent fb84f3b commit a6659cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/vs/editor/common/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,12 @@ export interface CommentingRanges {
fileComments: boolean;
}

export interface CommentAuthorInformation {
name: string;
iconPath?: UriComponents;

}

/**
* @internal
*/
Expand Down
5 changes: 5 additions & 0 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7726,6 +7726,11 @@ declare namespace monaco.languages {
arguments?: any[];
}

export interface CommentAuthorInformation {
name: string;
iconPath?: UriComponents;
}

export interface PendingCommentThread {
body: string;
range: IRange | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
iconPath: reaction.iconPath ? extHostTypeConverter.pathOrURIToURI(reaction.iconPath) : undefined,
count: reaction.count,
hasReacted: reaction.authorHasReacted,
reactors: reaction.reactors
reactors: ((reaction.reactors && (reaction.reactors.length > 0) && (typeof reaction.reactors[0] !== 'string')) ? (reaction.reactors as languages.CommentAuthorInformation[]).map(reactor => reactor.name) : reaction.reactors) as string[]
};
}

Expand All @@ -707,7 +707,7 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
count: reaction.count || 0,
iconPath: reaction.iconPath ? URI.revive(reaction.iconPath) : '',
authorHasReacted: reaction.hasReacted || false,
reactors: reaction.reactors
reactors: reaction.reactors?.map(reactor => ({ name: reactor }))
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/vscode-dts/vscode.proposed.commentReactor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ declare module 'vscode' {
// @alexr00 https://github.com/microsoft/vscode/issues/201131

export interface CommentReaction {
readonly reactors?: readonly string[];
readonly reactors?: readonly CommentAuthorInformation[];
}
}

0 comments on commit a6659cb

Please sign in to comment.