提交 1cc1f166 编写于 作者: R Rachel Macfarlane

Use uriIdentityService to compare uris, fixes #107779

上级 9ee7e1e8
......@@ -6,7 +6,7 @@
import 'vs/css!./media/panel';
import * as nls from 'vs/nls';
import * as dom from 'vs/base/browser/dom';
import { basename, isEqual } from 'vs/base/common/resources';
import { basename } from 'vs/base/common/resources';
import { IAction, Action } from 'vs/base/common/actions';
import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
......@@ -28,6 +28,8 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
import { UriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentityService';
export class CommentsPanel extends ViewPane {
private treeLabels!: ResourceLabels;
......@@ -52,6 +54,7 @@ export class CommentsPanel extends ViewPane {
@IThemeService themeService: IThemeService,
@ICommentService private readonly commentService: ICommentService,
@ITelemetryService telemetryService: ITelemetryService,
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
) {
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
}
......@@ -206,7 +209,7 @@ export class CommentsPanel extends ViewPane {
const activeEditor = this.editorService.activeEditor;
let currentActiveResource = activeEditor ? activeEditor.resource : undefined;
if (currentActiveResource && isEqual(currentActiveResource, element.resource)) {
if (this.uriIdentityService.extUri.isEqual(element.resource, currentActiveResource)) {
const threadToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].threadId : element.threadId;
const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment.uniqueIdInThread : element.comment.uniqueIdInThread;
const control = this.editorService.activeTextEditorControl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册