Skip to content

Commit

Permalink
Merge branch 'main' into tyriar/221211
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar authored Sep 17, 2024
2 parents 61f3f97 + 1d39939 commit c6c2868
Show file tree
Hide file tree
Showing 125 changed files with 2,670 additions and 1,260 deletions.
13 changes: 8 additions & 5 deletions extensions/git/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ export class Repository {
}

async log(options?: LogOptions): Promise<Commit[]> {
const spawnOptions: SpawnOptions = {};
const args = ['log', `--format=${COMMIT_FORMAT}`, '-z'];

if (options?.shortStats) {
Expand Down Expand Up @@ -1174,19 +1175,21 @@ export class Repository {
}

if (options?.refNames) {
if (options.refNames.length === 0) {
args.push('--all');
}
args.push('--topo-order');
args.push('--decorate=full');
args.push(...options.refNames);

// In order to avoid hitting the command line limit due to large number of reference
// names (can happen when the `all` filter is used in the Source Control Graph view),
// we are passing the reference names via stdin.
spawnOptions.input = options.refNames.join('\n');
args.push('--stdin');
}

if (options?.path) {
args.push('--', options.path);
}

const result = await this.exec(args);
const result = await this.exec(args, spawnOptions);
if (result.exitCode) {
// An empty repo
return [];
Expand Down
2 changes: 1 addition & 1 deletion extensions/git/src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class TerminalShellExecutionManager {
const [executable, subcommand] = execution.commandLine.value.split(/\s+/);
const cwd = execution.cwd ?? shellIntegration.cwd;

if (executable.toLowerCase() !== 'git' || !this.subcommands.has(subcommand.toLowerCase()) || !cwd || exitCode !== 0) {
if (executable.toLowerCase() !== 'git' || !this.subcommands.has(subcommand?.toLowerCase()) || !cwd || exitCode !== 0) {
return;
}

Expand Down
16 changes: 11 additions & 5 deletions extensions/html-language-features/client/src/autoInsertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@ export function activateAutoInsertion(provider: (kind: 'autoQuote' | 'autoClose'
}

const lastChange = contentChanges[contentChanges.length - 1];
const lastCharacter = lastChange.text[lastChange.text.length - 1];
if (isEnabled['autoQuote'] && lastChange.rangeLength === 0 && lastCharacter === '=') {
doAutoInsert('autoQuote', document, lastChange);
} else if (isEnabled['autoClose'] && lastChange.rangeLength === 0 && (lastCharacter === '>' || lastCharacter === '/')) {
doAutoInsert('autoClose', document, lastChange);
if (lastChange.rangeLength === 0 && isSingleLine(lastChange.text)) {
const lastCharacter = lastChange.text[lastChange.text.length - 1];
if (isEnabled['autoQuote'] && lastCharacter === '=') {
doAutoInsert('autoQuote', document, lastChange);
} else if (isEnabled['autoClose'] && (lastCharacter === '>' || lastCharacter === '/')) {
doAutoInsert('autoClose', document, lastChange);
}
}
}

function isSingleLine(text: string): boolean {
return !/\n/.test(text);
}

function doAutoInsert(kind: 'autoQuote' | 'autoClose', document: TextDocument, lastChange: TextDocumentContentChangeEvent) {
const rangeStart = lastChange.range.start;
const version = document.version;
Expand Down
5 changes: 3 additions & 2 deletions extensions/typescript-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"enabledApiProposals": [
"workspaceTrust",
"createFileSystemWatcher",
"multiDocumentHighlightProvider",
"mappedEditsProvider",
"codeActionAI",
Expand Down Expand Up @@ -678,7 +677,7 @@
},
"js/ts.implicitProjectConfig.target": {
"type": "string",
"default": "ES2020",
"default": "ES2022",
"markdownDescription": "%configuration.implicitProjectConfig.target%",
"enum": [
"ES3",
Expand All @@ -692,6 +691,8 @@
"ES2020",
"ES2021",
"ES2022",
"ES2023",
"ES2024",
"ESNext"
],
"scope": "window"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export interface TypeScriptServiceConfiguration {
readonly enableProjectDiagnostics: boolean;
readonly maxTsServerMemory: number;
readonly enablePromptUseWorkspaceTsdk: boolean;
readonly useVsCodeWatcher: boolean; // TODO@bpasero remove this setting eventually
readonly useVsCodeWatcher: boolean;
readonly watchOptions: Proto.WatchOptions | undefined;
readonly includePackageJsonAutoImports: 'auto' | 'on' | 'off' | undefined;
readonly enableTsServerTracing: boolean;
Expand Down Expand Up @@ -223,7 +223,12 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
}

private readUseVsCodeWatcher(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.experimental.useVsCodeWatcher', false);
const watcherExcludes = configuration.get<Record<string, boolean>>('files.watcherExclude') ?? {};
if (watcherExcludes['**/node_modules/*/**'] /* VS Code default prior to 1.94.x */ === true) {
return false; // we cannot use the VS Code watcher if node_modules are excluded
}

return configuration.get<boolean>('typescript.tsserver.experimental.useVsCodeWatcher', true);
}

private readWatchOptions(configuration: vscode.WorkspaceConfiguration): Proto.WatchOptions | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
ignoreChangeEvents?: boolean,
) {
const disposable = new DisposableStore();
const watcher = disposable.add(vscode.workspace.createFileSystemWatcher(pattern, { excludes: [] /* TODO:: need to fill in excludes list */, ignoreChangeEvents }));
const watcher = disposable.add(vscode.workspace.createFileSystemWatcher(pattern, undefined, ignoreChangeEvents));
disposable.add(watcher.onDidChange(changeFile =>
this.addWatchEvent(id, 'updated', changeFile.fsPath)
));
Expand Down
1 change: 0 additions & 1 deletion extensions/typescript-language-features/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"include": [
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts",
"../../src/vscode-dts/vscode.proposed.codeActionAI.d.ts",
"../../src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",
"../../src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions remote/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6c2868

Please sign in to comment.