Skip to content

Commit cf1cd0e

Browse files
authored
Merge branch 'main' into main
2 parents 6e160fc + 1debf21 commit cf1cd0e

File tree

84 files changed

+1684
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1684
-722
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,5 +213,5 @@
213213
"azureMcp.serverMode": "all",
214214
"azureMcp.readOnly": true,
215215
"chat.tools.terminal.outputLocation": "none",
216-
"debug.breakpointsView.presentation": "tree"
216+
"debug.breakpointsView.presentation": "tree"
217217
}

eslint.config.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,10 @@ export default tseslint.config(
274274
'src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.ts',
275275
'src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts',
276276
'src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.ts',
277-
'src/vs/workbench/contrib/chat/common/annotations.ts',
278-
'src/vs/workbench/contrib/chat/common/chat.ts',
279-
'src/vs/workbench/contrib/chat/common/chatAgents.ts',
280277
'src/vs/workbench/contrib/chat/common/chatModel.ts',
281-
'src/vs/workbench/contrib/chat/common/chatService.ts',
282-
'src/vs/workbench/contrib/chat/common/chatServiceImpl.ts',
283-
'src/vs/workbench/contrib/chat/common/codeBlockModelCollection.ts',
284-
'src/vs/workbench/contrib/chat/test/common/chatModel.test.ts',
285278
'src/vs/workbench/contrib/chat/test/common/promptSyntax/testUtils/mockFilesystem.test.ts',
286279
'src/vs/workbench/contrib/chat/test/common/promptSyntax/testUtils/mockFilesystem.ts',
287280
'src/vs/workbench/contrib/chat/test/common/tools/manageTodoListTool.test.ts',
288-
'src/vs/workbench/contrib/debug/browser/breakpointsView.ts',
289281
'src/vs/workbench/contrib/debug/browser/debugAdapterManager.ts',
290282
'src/vs/workbench/contrib/debug/browser/variablesView.ts',
291283
'src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts',

extensions/cpp/language-configuration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
9494
"folding": {
9595
"markers": {
96-
"start": "^\\s*#pragma\\s+region\\b",
97-
"end": "^\\s*#pragma\\s+endregion\\b"
96+
"start": "^\\s*#\\s*pragma\\s+region\\b",
97+
"end": "^\\s*#\\s*pragma\\s+endregion\\b"
9898
}
9999
},
100100
"indentationRules": {

extensions/git/src/api/api1.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { Model } from '../model';
99
import { Repository as BaseRepository, Resource } from '../repository';
10-
import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, ForcePushMode, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState, CommitOptions, RefType, CredentialsProvider, BranchQuery, PushErrorHandler, PublishEvent, FetchOptions, RemoteSourceProvider, RemoteSourcePublisher, PostCommitCommandsProvider, RefQuery, BranchProtectionProvider, InitOptions, SourceControlHistoryItemDetailsProvider, GitErrorCodes, CloneOptions, CommitShortStat, DiffChange } from './git';
10+
import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, ForcePushMode, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions, APIState, CommitOptions, RefType, CredentialsProvider, BranchQuery, PushErrorHandler, PublishEvent, FetchOptions, RemoteSourceProvider, RemoteSourcePublisher, PostCommitCommandsProvider, RefQuery, BranchProtectionProvider, InitOptions, SourceControlHistoryItemDetailsProvider, GitErrorCodes, CloneOptions, CommitShortStat, DiffChange, Worktree } from './git';
1111
import { Event, SourceControlInputBox, Uri, SourceControl, Disposable, commands, CancellationToken } from 'vscode';
1212
import { combinedDisposable, filterEvent, mapEvent } from '../util';
1313
import { toGitUri } from '../uri';
@@ -52,6 +52,7 @@ export class ApiRepositoryState implements RepositoryState {
5252
get refs(): Ref[] { console.warn('Deprecated. Use ApiRepository.getRefs() instead.'); return []; }
5353
get remotes(): Remote[] { return [...this.#repository.remotes]; }
5454
get submodules(): Submodule[] { return [...this.#repository.submodules]; }
55+
get worktrees(): Worktree[] { return this.#repository.worktrees; }
5556
get rebaseCommit(): Commit | undefined { return this.#repository.rebaseCommit; }
5657

5758
get mergeChanges(): Change[] { return this.#repository.mergeGroup.resourceStates.map(r => new ApiChange(r)); }
@@ -553,6 +554,7 @@ export function registerAPICommands(extension: GitExtensionImpl): Disposable {
553554
refs: state.refs.map(ref),
554555
remotes: state.remotes,
555556
submodules: state.submodules,
557+
worktrees: state.worktrees,
556558
rebaseCommit: state.rebaseCommit,
557559
mergeChanges: state.mergeChanges.map(change),
558560
indexChanges: state.indexChanges.map(change),

extensions/git/src/api/git.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export interface Worktree {
8181
readonly path: string;
8282
readonly ref: string;
8383
readonly detached: boolean;
84-
readonly commitDetails?: Commit;
8584
}
8685

8786
export const enum Status {
@@ -131,6 +130,7 @@ export interface RepositoryState {
131130
readonly refs: Ref[];
132131
readonly remotes: Remote[];
133132
readonly submodules: Submodule[];
133+
readonly worktrees: Worktree[];
134134
readonly rebaseCommit: Commit | undefined;
135135

136136
readonly mergeChanges: Change[];
@@ -262,7 +262,7 @@ export interface Repository {
262262
diffBetween(ref1: string, ref2: string): Promise<Change[]>;
263263
diffBetween(ref1: string, ref2: string, path: string): Promise<string>;
264264
diffBetweenWithStats(ref1: string, ref2: string, path?: string): Promise<DiffChange[]>;
265-
265+
266266
hashObject(data: string): Promise<string>;
267267

268268
createBranch(name: string, checkout: boolean, ref?: string): Promise<void>;

extensions/git/src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import * as path from 'path';
88
import { Command, commands, Disposable, MessageOptions, Position, QuickPickItem, Range, SourceControlResourceState, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window, workspace, WorkspaceEdit, WorkspaceFolder, TimelineItem, env, Selection, TextDocumentContentProvider, InputBoxValidationSeverity, TabInputText, TabInputTextMerge, QuickPickItemKind, TextDocument, LogOutputChannel, l10n, Memento, UIKind, QuickInputButton, ThemeIcon, SourceControlHistoryItem, SourceControl, InputBoxValidationMessage, Tab, TabInputNotebook, QuickInputButtonLocation, languages, SourceControlArtifact } from 'vscode';
99
import TelemetryReporter from '@vscode/extension-telemetry';
1010
import { uniqueNamesGenerator, adjectives, animals, colors, NumberDictionary } from '@joaomoreno/unique-names-generator';
11-
import { ForcePushMode, GitErrorCodes, RefType, Status, CommitOptions, RemoteSourcePublisher, Remote, Branch, Ref, Worktree } from './api/git';
12-
import { Git, GitError, Stash } from './git';
11+
import { ForcePushMode, GitErrorCodes, RefType, Status, CommitOptions, RemoteSourcePublisher, Remote, Branch, Ref } from './api/git';
12+
import { Git, GitError, Stash, Worktree } from './git';
1313
import { Model } from './model';
1414
import { GitResourceGroup, Repository, Resource, ResourceGroupType } from './repository';
1515
import { DiffEditorSelectionHunkToolbarContext, LineChange, applyLineChanges, getIndexDiffInformation, getModifiedRange, getWorkingTreeDiffInformation, intersectDiffWithRange, invertLineChange, toLineChanges, toLineRanges, compareLineChanges } from './staging';

extensions/git/src/git.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EventEmitter } from 'events';
1313
import * as filetype from 'file-type';
1414
import { assign, groupBy, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent, splitInChunks, Limiter, Versions, isWindows, pathEquals, isMacintosh, isDescendant, relativePathWithNoFallback, Mutable } from './util';
1515
import { CancellationError, CancellationToken, ConfigurationChangeEvent, LogOutputChannel, Progress, Uri, workspace } from 'vscode';
16-
import { Commit as ApiCommit, Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery as ApiRefQuery, InitOptions, Worktree, DiffChange } from './api/git';
16+
import { Commit as ApiCommit, Ref, RefType, Branch, Remote, ForcePushMode, GitErrorCodes, LogOptions, Change, Status, CommitOptions, RefQuery as ApiRefQuery, InitOptions, DiffChange, Worktree as ApiWorktree } from './api/git';
1717
import * as byline from 'byline';
1818
import { StringDecoder } from 'string_decoder';
1919

@@ -1303,6 +1303,10 @@ export interface PullOptions {
13031303
readonly cancellationToken?: CancellationToken;
13041304
}
13051305

1306+
export interface Worktree extends ApiWorktree {
1307+
readonly commitDetails?: ApiCommit;
1308+
}
1309+
13061310
export class Repository {
13071311
private _isUsingRefTable = false;
13081312

extensions/git/src/model.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
457457
@debounce(500)
458458
private eventuallyScanPossibleGitRepositories(): void {
459459
for (const path of this.possibleGitRepositoryPaths) {
460-
this.openRepository(path, false, true);
460+
this.openRepository(path);
461461
}
462462

463463
this.possibleGitRepositoryPaths.clear();
@@ -572,7 +572,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
572572
}
573573

574574
@sequentialize
575-
async openRepository(repoPath: string, openIfClosed = false, openIfParent = false): Promise<void> {
575+
async openRepository(repoPath: string, openIfClosed = false): Promise<void> {
576576
this.logger.trace(`[Model][openRepository] Repository: ${repoPath}`);
577577
const existingRepository = await this.getRepositoryExact(repoPath);
578578
if (existingRepository) {
@@ -621,7 +621,7 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
621621
const parentRepositoryConfig = config.get<'always' | 'never' | 'prompt'>('openRepositoryInParentFolders', 'prompt');
622622
if (parentRepositoryConfig !== 'always' && this.globalState.get<boolean>(`parentRepository:${repositoryRoot}`) !== true) {
623623
const isRepositoryOutsideWorkspace = await this.isRepositoryOutsideWorkspace(repositoryRoot);
624-
if (!openIfParent && isRepositoryOutsideWorkspace) {
624+
if (isRepositoryOutsideWorkspace) {
625625
this.logger.trace(`[Model][openRepository] Repository in parent folder: ${repositoryRoot}`);
626626

627627
if (!this._parentRepositoriesManager.hasRepository(repositoryRoot)) {
@@ -1094,6 +1094,14 @@ export class Model implements IRepositoryResolver, IBranchProtectionProviderRegi
10941094
return true;
10951095
}
10961096

1097+
// The repository path may be a worktree (usually stored outside the workspace) so we have
1098+
// to check the repository path against all the worktree paths of the repositories that have
1099+
// already been opened.
1100+
const worktreePaths = this.repositories.map(r => r.worktrees.map(w => w.path)).flat();
1101+
if (worktreePaths.some(p => pathEquals(p, repositoryPath))) {
1102+
return false;
1103+
}
1104+
10971105
// The repository path may be a canonical path or it may contain a symbolic link so we have
10981106
// to match it against the workspace folders and the canonical paths of the workspace folders
10991107
const workspaceFolderPaths = new Set<string | undefined>([

extensions/git/src/repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import picomatch from 'picomatch';
1010
import { CancellationError, CancellationToken, CancellationTokenSource, Command, commands, Disposable, Event, EventEmitter, FileDecoration, FileType, l10n, LogLevel, LogOutputChannel, Memento, ProgressLocation, ProgressOptions, QuickDiffProvider, RelativePattern, scm, SourceControl, SourceControlInputBox, SourceControlInputBoxValidation, SourceControlInputBoxValidationType, SourceControlResourceDecorations, SourceControlResourceGroup, SourceControlResourceState, TabInputNotebookDiff, TabInputTextDiff, TabInputTextMultiDiff, ThemeColor, ThemeIcon, Uri, window, workspace, WorkspaceEdit } from 'vscode';
1111
import { ActionButton } from './actionButton';
1212
import { ApiRepository } from './api/api1';
13-
import { Branch, BranchQuery, Change, CommitOptions, DiffChange, FetchOptions, ForcePushMode, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status, Worktree } from './api/git';
13+
import { Branch, BranchQuery, Change, CommitOptions, DiffChange, FetchOptions, ForcePushMode, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status } from './api/git';
1414
import { AutoFetcher } from './autofetch';
1515
import { GitBranchProtectionProvider, IBranchProtectionProviderRegistry } from './branchProtection';
1616
import { debounce, memoize, sequentialize, throttle } from './decorators';
17-
import { Repository as BaseRepository, BlameInformation, Commit, CommitShortStat, GitError, LogFileOptions, LsTreeElement, PullOptions, RefQuery, Stash, Submodule } from './git';
17+
import { Repository as BaseRepository, BlameInformation, Commit, CommitShortStat, GitError, LogFileOptions, LsTreeElement, PullOptions, RefQuery, Stash, Submodule, Worktree } from './git';
1818
import { GitHistoryProvider } from './historyProvider';
1919
import { Operation, OperationKind, OperationManager, OperationResult } from './operation';
2020
import { CommitCommandsCenter, IPostCommitCommandsProviderRegistry } from './postCommitCommands';

extensions/terminal-suggest/src/completions/npm.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,18 @@ const completionSpec: Fig.Spec = {
789789
},
790790
],
791791
},
792+
{
793+
name: ['explain', 'why'],
794+
description: 'Explain installed packages',
795+
args: {
796+
name: 'package-spec',
797+
description: 'Package name or path to folder within node_modules',
798+
isVariadic: true,
799+
filterStrategy: 'fuzzy',
800+
generators: dependenciesGenerator,
801+
},
802+
options: [jsonOption, ...workSpaceOptions],
803+
},
792804
{
793805
name: 'explore',
794806
description: 'Browse an installed package',

0 commit comments

Comments
 (0)