Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/issues/userCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@

import * as path from 'path';
import * as vscode from 'vscode';
import { ASSIGNEES } from './issueFile';
import { StateManager } from './stateManager';
import { getRootUriFromScmInputUri, isComment, UserCompletion } from './util';
import Logger from '../common/logger';
import { IGNORE_USER_COMPLETION_TRIGGER, ISSUES_SETTINGS_NAMESPACE } from '../common/settingKeys';
import { TimelineEvent } from '../common/timelineEvent';
import { fromNewIssueUri, fromPRUri, Schemes } from '../common/uri';
import { compareIgnoreCase, isDescendant } from '../common/utils';
import { EXTENSION_ID } from '../constants';
import { ASSIGNEES } from './issueFile';
import { StateManager } from './stateManager';
import { getRootUriFromScmInputUri, isComment, UserCompletion } from './util';
import { isDescendant } from '../common/utils';
import { FolderRepositoryManager } from '../github/folderRepositoryManager';
import { IAccount, User } from '../github/interface';
import { userMarkdown } from '../github/markdownUtils';
import { RepositoriesManager } from '../github/repositoriesManager';
import { getRelatedUsersFromTimelineEvents } from '../github/utils';
import { PullRequestCommentController } from '../view/pullRequestCommentController';
import { ReviewCommentController } from '../view/reviewCommentController';
Comment thread
alexr00 marked this conversation as resolved.

export class UserCompletionProvider implements vscode.CompletionItemProvider {
private static readonly ID: string = 'UserCompletionProvider';
Expand Down Expand Up @@ -174,8 +175,13 @@ export class UserCompletionProvider implements vscode.CompletionItemProvider {
document: vscode.TextDocument,
position: vscode.Position) {
try {
const query = JSON.parse(document.uri.query);
if ((document.uri.scheme !== Schemes.Comment) || compareIgnoreCase(query.extensionId, EXTENSION_ID) !== 0) {
if (
document.uri.scheme !== Schemes.Comment ||
(
!document.uri.authority.startsWith(`${PullRequestCommentController.PREFIX}-`) &&
!document.uri.authority.startsWith(`${ReviewCommentController.PREFIX}-`)
)
) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/view/reviewCommentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface SuggestionInformation {

export class ReviewCommentController extends CommentControllerBase implements CommentHandler, vscode.CommentingRangeProvider2, CommentReactionHandler {
private static readonly ID = 'ReviewCommentController';
private static readonly PREFIX = 'github-review';
static readonly PREFIX = 'github-review';
private _commentHandlerId: string;

// Note: marked as protected so that tests can verify caches have been updated correctly without breaking type safety
Expand Down