Skip to content

Commit 2a96e0d

Browse files
authored
Merge branch 'main' into joh/super-monkey
2 parents eb3f1d1 + 7159df6 commit 2a96e0d

File tree

105 files changed

+1207
-768
lines changed

Some content is hidden

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

105 files changed

+1207
-768
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
run: npm run test-node
8383

8484
- name: Run Unit Tests (Browser, Chromium)
85-
run: npm run test-browser-no-install --browser chromium
85+
run: npm run test-browser-no-install -- --browser chromium
8686

8787
- name: Run Integration Tests (Electron)
8888
run: .\scripts\test-integration.bat
@@ -162,7 +162,7 @@ jobs:
162162

163163
- name: Run Unit Tests (Browser, Chromium)
164164
id: browser-unit-tests
165-
run: DISPLAY=:10 npm run test-browser-no-install --browser chromium
165+
run: DISPLAY=:10 npm run test-browser-no-install -- --browser chromium
166166

167167
- name: Run Integration Tests (Electron)
168168
id: electron-integration-tests
@@ -238,7 +238,7 @@ jobs:
238238
run: npm run test-node
239239

240240
- name: Run Unit Tests (Browser, Chromium)
241-
run: DISPLAY=:10 npm run test-browser-no-install --browser chromium
241+
run: DISPLAY=:10 npm run test-browser-no-install -- --browser chromium
242242

243243
- name: Run Integration Tests (Electron)
244244
run: DISPLAY=:10 ./scripts/test-integration.sh

build/lib/tsb/transpiler.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/tsb/transpiler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export class SwcTranspiler implements ITranspiler {
403403
if (isAmd) {
404404
options = SwcTranspiler._swcrcAmd;
405405
}
406-
} else if (this._cmdLine.options.module === ts.ModuleKind.CommonJS) {
406+
} else if (this._cmdLine.options.module === ts.ModuleKind.CommonJS || this._cmdLine.options.module === ts.ModuleKind.Node16) {
407407
options = SwcTranspiler._swcrcCommonJS;
408408
}
409409

extensions/css-language-features/client/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"outDir": "./out",
55
"lib": [
66
"webworker"
7-
]
7+
],
8+
"module": "Node16",
89
},
910
"include": [
1011
"src/**/*",

extensions/css-language-features/package-lock.json

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/css-language-features/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@
997997
]
998998
},
999999
"dependencies": {
1000-
"vscode-languageclient": "10.0.0-next.8",
1000+
"vscode-languageclient": "^10.0.0-next.13",
10011001
"vscode-uri": "^3.0.8"
10021002
},
10031003
"devDependencies": {

extensions/css-language-features/server/package-lock.json

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/css-language-features/server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"@vscode/l10n": "^0.0.18",
1414
"vscode-css-languageservice": "^6.3.1",
15-
"vscode-languageserver": "10.0.0-next.6",
15+
"vscode-languageserver": "^10.0.0-next.11",
1616
"vscode-uri": "^3.0.8"
1717
},
1818
"devDependencies": {

extensions/css-language-features/server/src/browser/cssServerWorkerMain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const messageHandler = async (e: any) => {
2222
} else {
2323
l10nLog.push(`l10n: No bundle configured.`);
2424
}
25-
await import('./cssServerMain');
25+
await import('./cssServerMain.js');
2626
if (self.onmessage !== messageHandler) {
2727
pendingMessages.forEach(msg => self.onmessage?.(msg));
2828
pendingMessages.length = 0;

extensions/css-language-features/server/src/node/cssServerNodeMain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function setupMain() {
1515
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}`);
1616
}
1717
}
18-
await import('./cssServerMain');
18+
await import('./cssServerMain.js');
1919
l10nLog.forEach(console.log);
2020
}
2121
setupMain();

extensions/css-language-features/server/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"lib": [
66
"ES2020",
77
"WebWorker"
8-
]
8+
],
9+
"module": "Node16",
910
},
1011
"include": [
1112
"src/**/*"

extensions/git/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@
630630
"category": "Git",
631631
"enablement": "!operationInProgress"
632632
},
633+
{
634+
"command": "git.cherryPickAbort",
635+
"title": "%command.cherryPickAbort%",
636+
"category": "Git",
637+
"enablement": "!operationInProgress"
638+
},
633639
{
634640
"command": "git.addRemote",
635641
"title": "%command.addRemote%",
@@ -1203,6 +1209,10 @@
12031209
"command": "git.cherryPick",
12041210
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"
12051211
},
1212+
{
1213+
"command": "git.cherryPickAbort",
1214+
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && gitCherryPickInProgress"
1215+
},
12061216
{
12071217
"command": "git.pull",
12081218
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0"

extensions/git/package.nls.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"command.renameBranch": "Rename Branch...",
7070
"command.cherryPick": "Cherry Pick...",
7171
"command.cherryPickRef": "Cherry Pick",
72+
"command.cherryPickAbort": "Abort Cherry Pick",
7273
"command.merge": "Merge...",
7374
"command.mergeAbort": "Abort Merge",
7475
"command.rebase": "Rebase Branch...",

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -410,5 +410,6 @@ export const enum GitErrorCodes {
410410
BranchFastForwardRejected = 'BranchFastForwardRejected',
411411
BranchNotYetBorn = 'BranchNotYetBorn',
412412
TagConflict = 'TagConflict',
413-
CherryPickEmpty = 'CherryPickEmpty'
413+
CherryPickEmpty = 'CherryPickEmpty',
414+
CherryPickConflict = 'CherryPickConflict'
414415
}

extensions/git/src/commands.ts

+11
Original file line numberDiff line numberDiff line change
@@ -3318,6 +3318,11 @@ export class CommandCenter {
33183318
await repository.cherryPick(historyItem.id);
33193319
}
33203320

3321+
@command('git.cherryPickAbort', { repository: true })
3322+
async cherryPickAbort(repository: Repository): Promise<void> {
3323+
await repository.cherryPickAbort();
3324+
}
3325+
33213326
@command('git.pushTo', { repository: true })
33223327
async pushTo(repository: Repository, remote?: string, refspec?: string, setUpstream?: boolean): Promise<void> {
33233328
await this._push(repository, { pushType: PushType.PushTo, pushTo: { remote: remote, refspec: refspec, setUpstream: setUpstream } });
@@ -4409,6 +4414,12 @@ export class CommandCenter {
44094414
type = 'information';
44104415
options.modal = false;
44114416
break;
4417+
case GitErrorCodes.CherryPickConflict:
4418+
message = l10n.t('There were merge conflicts while cherry picking the changes. Resolve the conflicts before committing them.');
4419+
type = 'warning';
4420+
choices.set(l10n.t('Show Changes'), () => commands.executeCommand('workbench.view.scm'));
4421+
options.modal = false;
4422+
break;
44124423
default: {
44134424
const hint = (err.stderr || err.message || String(err))
44144425
.replace(/^error: /mi, '')

extensions/git/src/git.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -2106,16 +2106,23 @@ export class Repository {
21062106
await this.exec(['cherry-pick', commitHash]);
21072107
} catch (err) {
21082108
if (/The previous cherry-pick is now empty, possibly due to conflict resolution./.test(err.stderr ?? '')) {
2109-
// Abort the cherry-pick operation
2110-
await this.exec(['cherry-pick', '--abort']);
2109+
// Abort cherry-pick
2110+
await this.cherryPickAbort();
21112111

21122112
err.gitErrorCode = GitErrorCodes.CherryPickEmpty;
2113+
} else {
2114+
// Conflict during cherry-pick
2115+
err.gitErrorCode = GitErrorCodes.CherryPickConflict;
21132116
}
21142117

21152118
throw err;
21162119
}
21172120
}
21182121

2122+
async cherryPickAbort(): Promise<void> {
2123+
await this.exec(['cherry-pick', '--abort']);
2124+
}
2125+
21192126
async blame(path: string): Promise<string> {
21202127
try {
21212128
const args = ['blame', sanitizePath(path)];

extensions/git/src/gitEditor.ts

+51-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import * as path from 'path';
6-
import { TabInputText, Uri, window, workspace } from 'vscode';
6+
import { CancellationToken, DocumentLink, DocumentLinkProvider, l10n, Range, TabInputText, TextDocument, Uri, window, workspace } from 'vscode';
77
import { IIPCHandler, IIPCServer } from './ipc/ipcServer';
88
import { ITerminalEnvironmentProvider } from './terminal';
99
import { EmptyDisposable, IDisposable } from './util';
10+
import { Model } from './model';
11+
import { Repository } from './repository';
1012

1113
interface GitEditorRequest {
1214
commitMessagePath?: string;
@@ -63,3 +65,51 @@ export class GitEditor implements IIPCHandler, ITerminalEnvironmentProvider {
6365
this.disposable.dispose();
6466
}
6567
}
68+
69+
export class GitEditorDocumentLinkProvider implements DocumentLinkProvider {
70+
private readonly _regex = /^#\s+(modified|new file|deleted|renamed|copied|type change):\s+(?<file1>.*?)(?:\s+->\s+(?<file2>.*))*$/gm;
71+
72+
constructor(private readonly _model: Model) { }
73+
74+
provideDocumentLinks(document: TextDocument, token: CancellationToken): DocumentLink[] {
75+
if (token.isCancellationRequested) {
76+
return [];
77+
}
78+
79+
const repository = this._model.getRepository(document.uri);
80+
if (!repository) {
81+
return [];
82+
}
83+
84+
const links: DocumentLink[] = [];
85+
for (const match of document.getText().matchAll(this._regex)) {
86+
if (!match.groups) {
87+
continue;
88+
}
89+
90+
const { file1, file2 } = match.groups;
91+
92+
if (file1) {
93+
links.push(this._createDocumentLink(repository, document, match, file1));
94+
}
95+
if (file2) {
96+
links.push(this._createDocumentLink(repository, document, match, file2));
97+
}
98+
}
99+
100+
return links;
101+
}
102+
103+
private _createDocumentLink(repository: Repository, document: TextDocument, match: RegExpExecArray, file: string): DocumentLink {
104+
const startIndex = match[0].indexOf(file);
105+
const startPosition = document.positionAt(match.index + startIndex);
106+
const endPosition = document.positionAt(match.index + startIndex + file.length);
107+
108+
const documentLink = new DocumentLink(
109+
new Range(startPosition, endPosition),
110+
Uri.file(path.join(repository.root, file)));
111+
documentLink.tooltip = l10n.t('Open File');
112+
113+
return documentLink;
114+
}
115+
}

0 commit comments

Comments
 (0)