diff --git a/src/commands.ts b/src/commands.ts index b7c698029e..3509b2e7ad 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -4,8 +4,13 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; + + + import * as pathLib from 'path'; import * as vscode from 'vscode'; + + import { GitErrorCodes } from './api/api1'; import { CommentReply, resolveCommentHandler } from './commentHandlerResolver'; import { IComment } from './common/comment'; @@ -29,6 +34,7 @@ import { ReviewManager } from './view/reviewManager'; import { CategoryTreeNode } from './view/treeNodes/categoryNode'; import { CommitNode } from './view/treeNodes/commitNode'; import { DescriptionNode } from './view/treeNodes/descriptionNode'; + import { FileChangeNode, GitFileChangeNode, diff --git a/src/commentHandlerResolver.ts b/src/commentHandlerResolver.ts index 2bb86ec219..341148e94c 100644 --- a/src/commentHandlerResolver.ts +++ b/src/commentHandlerResolver.ts @@ -4,7 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; + + + import * as vscode from 'vscode'; + + import Logger from './common/logger'; import { GHPRComment, GHPRCommentThread, TemporaryComment } from './github/prComment'; @@ -23,6 +28,7 @@ export interface CommentHandler { unresolveReviewThread(thread: GHPRCommentThread, input?: string): Promise; } + export interface CommentReply { thread: GHPRCommentThread; text: string; diff --git a/src/constants.ts b/src/constants.ts index 9a22a865f9..3e29f67cc8 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,9 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + + + export const EXTENSION_ID = 'GitHub.vscode-pull-request-github'; export const VSLS_REQUEST_NAME = 'git'; + + export const VSLS_GIT_PR_SESSION_NAME = 'ghpr'; + export const VSLS_REPOSITORY_INITIALIZATION_NAME = 'initialize'; + export const VSLS_STATE_CHANGE_NOTIFY_NAME = 'statechange'; export const FOCUS_REVIEW_MODE = 'github:focusedReview'; diff --git a/src/experimentationService.ts b/src/experimentationService.ts index 0bb018fd17..707ca46a37 100644 --- a/src/experimentationService.ts +++ b/src/experimentationService.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + + import * as vscode from 'vscode'; import TelemetryReporter from 'vscode-extension-telemetry'; import { @@ -10,14 +12,19 @@ import { IExperimentationService, IExperimentationTelemetry, TargetPopulation, + } from 'vscode-tas-client'; + + /* __GDPR__ + "query-expfeature" : { "ABExp.queriedFeature": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } } */ + export class ExperimentationTelemetry implements IExperimentationTelemetry { private sharedProperties: Record = {}; diff --git a/src/extension.ts b/src/extension.ts index 957b93215c..298350ff56 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,16 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + + 'use strict'; import * as vscode from 'vscode'; import TelemetryReporter from 'vscode-extension-telemetry'; import { LiveShare } from 'vsls/vscode.js'; import { Repository } from './api/api'; import { GitApiImpl } from './api/api1'; + import { registerCommands } from './commands'; import { commands } from './common/executeCommands'; import Logger from './common/logger'; import * as PersistentState from './common/persistentState'; + import { Resource } from './common/resources'; import { SessionState } from './common/sessionState'; import { BRANCH_PUBLISH, FILE_LIST_LAYOUT, PR_SETTINGS_NAMESPACE } from './common/settingKeys'; diff --git a/src/extensionState.ts b/src/extensionState.ts index 85c01cd61b..61d1975ca3 100644 --- a/src/extensionState.ts +++ b/src/extensionState.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { IAccount } from './github/interface'; +import +{ IAccount } from './github/interface'; + + // Synced keys export const NEVER_SHOW_PULL_NOTIFICATION = 'github.pullRequest.pullNotification.show'; @@ -13,7 +16,9 @@ export const REPO_KEYS = 'github.pullRequest.repos'; export interface RepoState { mentionableUsers?: IAccount[]; + stateModifiedTime?: number; + } export interface ReposState { @@ -22,4 +27,5 @@ export interface ReposState { export function setSyncedKeys(context: vscode.ExtensionContext) { context.globalState.setKeysForSync([NEVER_SHOW_PULL_NOTIFICATION]); -} \ No newline at end of file +} + diff --git a/src/gitExtensionIntegration.ts b/src/gitExtensionIntegration.ts index 2eadf399ce..46d66b181e 100644 --- a/src/gitExtensionIntegration.ts +++ b/src/gitExtensionIntegration.ts @@ -12,6 +12,7 @@ interface Repository { readonly description: string | null; readonly clone_url: string; readonly ssh_url: string; + } function repoResponseAsRemoteSource(raw: OctokitCommon.SearchReposResponseItem): RemoteSource { @@ -20,6 +21,7 @@ function repoResponseAsRemoteSource(raw: OctokitCommon.SearchReposResponseItem): description: raw.description || undefined, url: raw.url, }; + } function asRemoteSource(raw: Repository): RemoteSource { diff --git a/src/gitProviders/builtinGit.ts b/src/gitProviders/builtinGit.ts index 54dcecae40..143db0d145 100644 --- a/src/gitProviders/builtinGit.ts +++ b/src/gitProviders/builtinGit.ts @@ -12,10 +12,17 @@ export class BuiltinGitProvider implements IGit, vscode.Disposable { return this._gitAPI.repositories as any[]; } + + + get state(): APIState { return this._gitAPI.state; + + } + + private _onDidOpenRepository = new vscode.EventEmitter(); readonly onDidOpenRepository: vscode.Event = this._onDidOpenRepository.event; private _onDidCloseRepository = new vscode.EventEmitter(); diff --git a/src/gitProviders/vslshost.ts b/src/gitProviders/vslshost.ts index 1dc86ea9f3..f657d3c4dd 100644 --- a/src/gitProviders/vslshost.ts +++ b/src/gitProviders/vslshost.ts @@ -11,8 +11,13 @@ import { VSLS_REPOSITORY_INITIALIZATION_NAME, VSLS_REQUEST_NAME, VSLS_STATE_CHANGE_NOTIFY_NAME, + + } from '../constants'; + + + export class VSLSHost implements vscode.Disposable { private _sharedService?: SharedService; private _disposables: vscode.Disposable[]; @@ -20,6 +25,7 @@ export class VSLSHost implements vscode.Disposable { this._disposables = []; } + public async initialize() { this._sharedService = (await this._liveShareAPI!.shareService(VSLS_GIT_PR_SESSION_NAME)) || undefined;