Skip to content

Commit

Permalink
Merge branch 'main' into lramos15/spotty-ermine
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 authored Oct 3, 2024
2 parents 2493dc2 + d661252 commit 32421eb
Show file tree
Hide file tree
Showing 95 changed files with 1,096 additions and 728 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: npm run test-node

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

- name: Run Integration Tests (Electron)
run: .\scripts\test-integration.bat
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:

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

- name: Run Integration Tests (Electron)
id: electron-integration-tests
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
run: npm run test-node

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

- name: Run Integration Tests (Electron)
run: DISPLAY=:10 ./scripts/test-integration.sh
Expand Down
2 changes: 1 addition & 1 deletion build/lib/tsb/transpiler.js

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

2 changes: 1 addition & 1 deletion build/lib/tsb/transpiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class SwcTranspiler implements ITranspiler {
if (isAmd) {
options = SwcTranspiler._swcrcAmd;
}
} else if (this._cmdLine.options.module === ts.ModuleKind.CommonJS) {
} else if (this._cmdLine.options.module === ts.ModuleKind.CommonJS || this._cmdLine.options.module === ts.ModuleKind.Node16) {
options = SwcTranspiler._swcrcCommonJS;
}

Expand Down
3 changes: 2 additions & 1 deletion extensions/css-language-features/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"outDir": "./out",
"lib": [
"webworker"
]
],
"module": "Node16",
},
"include": [
"src/**/*",
Expand Down
34 changes: 17 additions & 17 deletions extensions/css-language-features/package-lock.json

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

2 changes: 1 addition & 1 deletion extensions/css-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@
]
},
"dependencies": {
"vscode-languageclient": "10.0.0-next.8",
"vscode-languageclient": "^10.0.0-next.13",
"vscode-uri": "^3.0.8"
},
"devDependencies": {
Expand Down
32 changes: 16 additions & 16 deletions extensions/css-language-features/server/package-lock.json

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

2 changes: 1 addition & 1 deletion extensions/css-language-features/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@vscode/l10n": "^0.0.18",
"vscode-css-languageservice": "^6.3.1",
"vscode-languageserver": "10.0.0-next.6",
"vscode-languageserver": "^10.0.0-next.11",
"vscode-uri": "^3.0.8"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const messageHandler = async (e: any) => {
} else {
l10nLog.push(`l10n: No bundle configured.`);
}
await import('./cssServerMain');
await import('./cssServerMain.js');
if (self.onmessage !== messageHandler) {
pendingMessages.forEach(msg => self.onmessage?.(msg));
pendingMessages.length = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function setupMain() {
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}`);
}
}
await import('./cssServerMain');
await import('./cssServerMain.js');
l10nLog.forEach(console.log);
}
setupMain();
3 changes: 2 additions & 1 deletion extensions/css-language-features/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"lib": [
"ES2020",
"WebWorker"
]
],
"module": "Node16",
},
"include": [
"src/**/*"
Expand Down
52 changes: 51 additions & 1 deletion extensions/git/src/gitEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import { TabInputText, Uri, window, workspace } from 'vscode';
import { CancellationToken, DocumentLink, DocumentLinkProvider, l10n, Range, TabInputText, TextDocument, Uri, window, workspace } from 'vscode';
import { IIPCHandler, IIPCServer } from './ipc/ipcServer';
import { ITerminalEnvironmentProvider } from './terminal';
import { EmptyDisposable, IDisposable } from './util';
import { Model } from './model';
import { Repository } from './repository';

interface GitEditorRequest {
commitMessagePath?: string;
Expand Down Expand Up @@ -63,3 +65,51 @@ export class GitEditor implements IIPCHandler, ITerminalEnvironmentProvider {
this.disposable.dispose();
}
}

export class GitEditorDocumentLinkProvider implements DocumentLinkProvider {
private readonly _regex = /^#\s+(modified|new file|deleted|renamed|copied|type change):\s+(?<file1>.*?)(?:\s+->\s+(?<file2>.*))*$/gm;

constructor(private readonly _model: Model) { }

provideDocumentLinks(document: TextDocument, token: CancellationToken): DocumentLink[] {
if (token.isCancellationRequested) {
return [];
}

const repository = this._model.getRepository(document.uri);
if (!repository) {
return [];
}

const links: DocumentLink[] = [];
for (const match of document.getText().matchAll(this._regex)) {
if (!match.groups) {
continue;
}

const { file1, file2 } = match.groups;

if (file1) {
links.push(this._createDocumentLink(repository, document, match, file1));
}
if (file2) {
links.push(this._createDocumentLink(repository, document, match, file2));
}
}

return links;
}

private _createDocumentLink(repository: Repository, document: TextDocument, match: RegExpExecArray, file: string): DocumentLink {
const startIndex = match[0].indexOf(file);
const startPosition = document.positionAt(match.index + startIndex);
const endPosition = document.positionAt(match.index + startIndex + file.length);

const documentLink = new DocumentLink(
new Range(startPosition, endPosition),
Uri.file(path.join(repository.root, file)));
documentLink.tooltip = l10n.t('Open File');

return documentLink;
}
}
7 changes: 5 additions & 2 deletions extensions/git/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { env, ExtensionContext, workspace, window, Disposable, commands, Uri, version as vscodeVersion, WorkspaceFolder, LogOutputChannel, l10n, LogLevel } from 'vscode';
import { env, ExtensionContext, workspace, window, Disposable, commands, Uri, version as vscodeVersion, WorkspaceFolder, LogOutputChannel, l10n, LogLevel, languages } from 'vscode';
import { findGit, Git, IGit } from './git';
import { Model } from './model';
import { CommandCenter } from './commands';
Expand All @@ -22,7 +22,7 @@ import { GitTimelineProvider } from './timelineProvider';
import { registerAPICommands } from './api/api1';
import { TerminalEnvironmentManager, TerminalShellExecutionManager } from './terminal';
import { createIPCServer, IPCServer } from './ipc/ipcServer';
import { GitEditor } from './gitEditor';
import { GitEditor, GitEditorDocumentLinkProvider } from './gitEditor';
import { GitPostCommitCommandsProvider } from './postCommitCommands';
import { GitEditSessionIdentityProvider } from './editSessionIdentityProvider';
import { GitCommitInputBoxCodeActionsProvider, GitCommitInputBoxDiagnosticsManager } from './diagnostics';
Expand Down Expand Up @@ -126,6 +126,9 @@ async function createModel(context: ExtensionContext, logger: LogOutputChannel,
const codeActionsProvider = new GitCommitInputBoxCodeActionsProvider(diagnosticsManager);
disposables.push(codeActionsProvider);

const gitEditorDocumentLinkProvider = languages.registerDocumentLinkProvider('git-commit', new GitEditorDocumentLinkProvider(model));
disposables.push(gitEditorDocumentLinkProvider);

checkGitVersion(info);
commands.executeCommand('setContext', 'gitVersion2.35', git.compareGitVersionTo('2.35') >= 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { DocumentSelector } from 'vscode-languageclient';
import { Event, EventEmitter, extensions } from 'vscode';

/**
Expand All @@ -22,7 +21,7 @@ interface LanguageParticipantContribution {

export interface LanguageParticipants {
readonly onDidChange: Event<void>;
readonly documentSelector: DocumentSelector;
readonly documentSelector: string[];
hasLanguage(languageId: string): boolean;
useAutoInsert(languageId: string): boolean;
dispose(): void;
Expand Down
3 changes: 2 additions & 1 deletion extensions/html-language-features/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"outDir": "./out",
"lib": [
"webworker"
]
],
"module": "Node16",
},
"include": [
"src/**/*",
Expand Down
Loading

0 comments on commit 32421eb

Please sign in to comment.