Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update packages/service/vscode digest to 9fda43d #141

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions packages/service/patches/015-disable-bufsync-tab-resource.patch
Original file line number Diff line number Diff line change
@@ -1,37 +1,15 @@
diff --git a/src/tsServer/bufferSyncSupport.ts b/src/tsServer/bufferSyncSupport.ts
index 608ec60..e766a71 100644
index 9f5d76f..806d073 100644
--- a/src/tsServer/bufferSyncSupport.ts
+++ b/src/tsServer/bufferSyncSupport.ts
@@ -379,19 +379,7 @@ class TabResourceTracker extends Disposable {
@@ -756,10 +756,6 @@ export default class BufferSyncSupport extends Disposable {
return false;
}

this._tabResources = new ResourceMap<{ readonly tabs: Set<vscode.Tab> }>(normalizePath, config);

- for (const tabGroup of vscode.window.tabGroups.all) {
- for (const tab of tabGroup.tabs) {
- this.add(tab);
- }
- }

- this._register(vscode.window.tabGroups.onDidChangeTabs(e => {
- const closed = e.closed.flatMap(tab => this.delete(tab));
- const opened = e.opened.flatMap(tab => this.add(tab));
- if (closed.length || opened.length) {
- this._onDidChange.fire({ closed, opened });
- }
- }));
}

public has(resource: vscode.Uri): boolean {
@@ -745,9 +733,9 @@ export default class BufferSyncSupport extends Disposable {
}

private shouldValidate(buffer: SyncedBuffer): boolean {
- if (!this.client.configuration.enableProjectDiagnostics && !this._tabResources.has(buffer.resource)) { // Only validate resources that are showing to the user
- return false;
- }
+ // if (!this.client.configuration.enableProjectDiagnostics && !this._tabResources.has(buffer.resource)) { // Only validate resources that are showing to the user
+ // return false;
+ // }

-
switch (buffer.languageId) {
case languageModeIds.javascript:
case languageModeIds.javascriptreact:
22 changes: 22 additions & 0 deletions packages/service/patches/030-tsserver-protocol-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/src/tsServer/protocol/protocol.d.ts b/src/tsServer/protocol/protocol.d.ts
index 45e09d6..5a001ca 100644
--- a/src/tsServer/protocol/protocol.d.ts
+++ b/src/tsServer/protocol/protocol.d.ts
@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-import type ts from '../../../../node_modules/typescript/lib/typescript';
+import type ts from 'typescript/lib/tsserverlibrary';
export = ts.server.protocol;


@@ -11,7 +11,7 @@ declare enum ServerType {
Semantic = 'semantic',
}

-declare module '../../../../node_modules/typescript/lib/typescript' {
+declare module 'typescript/lib/tsserverlibrary' {
namespace server.protocol {
type TextInsertion = ts.TextInsertion;
type ScriptElementKind = ts.ScriptElementKind;
55 changes: 32 additions & 23 deletions packages/service/patches/080-convert-code-action-command.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/languageFeatures/quickFix.ts b/src/languageFeatures/quickFix.ts
index 9f82bc7..c41428f 100644
index a627670..9df5cf8 100644
--- a/src/languageFeatures/quickFix.ts
+++ b/src/languageFeatures/quickFix.ts
@@ -19,6 +19,7 @@ import FileConfigurationManager from './fileConfigurationManager';
Expand All @@ -15,8 +15,8 @@ index 9f82bc7..c41428f 100644

type ApplyFixAllCodeAction_args = {
- readonly action: VsCodeFixAllCodeAction;
+ readonly tsAction: Proto.CodeFixAction;
+ readonly combinedResponse?: Proto.GetCombinedCodeFixResponse;
+ readonly tsAction: Proto.CodeFixAction;
+ readonly combinedResponse?: Proto.GetCombinedCodeFixResponse;
};

class ApplyFixAllCodeAction implements Command {
Expand All @@ -35,29 +35,37 @@ index 9f82bc7..c41428f 100644
}
}
}
@@ -285,6 +287,11 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
if (response.type === 'response') {
@@ -289,9 +291,17 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
};

const response = await this.client.execute('getCombinedCodeFix', arg, token);
- if (response.type === 'response') {
+ if (response.type === "response") {
codeAction.combinedResponse = response;
codeAction.edit = typeConverters.WorkspaceEdit.fromFileCodeEdits(this.client, response.body.changes);
- codeAction.edit = typeConverters.WorkspaceEdit.fromFileCodeEdits(this.client, response.body.changes);
+ codeAction.edit = typeConverters.WorkspaceEdit.fromFileCodeEdits(
+ this.client,
+ response.body.changes
+ );
+ codeAction.command = {
+ command: ApplyFixAllCodeAction.ID,
+ arguments: [{ tsAction: codeAction.tsAction, combinedResponse: response } satisfies ApplyFixAllCodeAction_args],
+ title: ''
+ arguments: [{ tsAction: codeAction.tsAction,combinedResponse: response } satisfies ApplyFixAllCodeAction_args],
+ title: "",
+ };
}

return codeAction;
@@ -371,7 +378,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
codeAction.diagnostics = [diagnostic];
@@ -334,7 +344,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
codeAction.ranges = [diagnostic.range];
codeAction.command = {
command: ApplyCodeActionCommand.ID,
- arguments: [{ action: action, diagnostic, document } satisfies ApplyCodeActionCommand_args],
- arguments: [{ action, diagnostic, document } satisfies ApplyCodeActionCommand_args],
+ arguments: commandsConverter[ApplyCodeActionCommand.ID].toArgs({ action: action, diagnostic, document } satisfies ApplyCodeActionCommand_args),
title: ''
};
if (expand && message !== undefined) {
@@ -425,7 +432,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
action.diagnostics = [diagnostic];
actions.push(codeAction);
@@ -449,7 +459,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider<VsCodeCode
action.ranges = [diagnostic.range];
action.command = {
command: ApplyFixAllCodeAction.ID,
- arguments: [{ action } satisfies ApplyFixAllCodeAction_args],
Expand All @@ -66,26 +74,27 @@ index 9f82bc7..c41428f 100644
};
results.addFixAllAction(tsAction.fixId, action);
diff --git a/src/languageFeatures/refactor.ts b/src/languageFeatures/refactor.ts
index 6e2be78..b16a9e1 100644
index a61758c..17250d7 100644
--- a/src/languageFeatures/refactor.ts
+++ b/src/languageFeatures/refactor.ts
@@ -23,6 +23,7 @@ import { nulToken } from '../utils/cancellation';
import FormattingOptionsManager from './fileConfigurationManager';
import { CompositeCommand, EditorChatFollowUp, EditorChatFollowUp_Args } from './util/copilot';
import { CompositeCommand, EditorChatFollowUp } from './util/copilot';
import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration';
+import { commandsConverter } from '../../../share';

function toWorkspaceEdit(client: ITypeScriptServiceClient, edits: readonly Proto.FileCodeEdits[]): vscode.WorkspaceEdit {
const workspaceEdit = new vscode.WorkspaceEdit();
@@ -393,18 +394,12 @@ class InlinedCodeAction extends vscode.CodeAction {
this.command.title = 'Copilot: ' + this.command.title;
}
@@ -389,18 +391,12 @@ class InlinedCodeAction extends vscode.CodeAction {
// Disable renames in interactive playground https://github.com/microsoft/vscode/issues/75137
if (this.document.uri.scheme !== fileSchemes.walkThroughSnippet) {
this.command = {
- command: CompositeCommand.ID,
title: '',
- title: '',
- arguments: coalesce([
- this.command,
- this.copilotRename ? this.copilotRename(response.body) : {
- {
+ title: '',
command: 'editor.action.rename',
- arguments: [[
+ arguments: commandsConverter['editor.action.rename'].toArgs(...[[
Expand All @@ -98,7 +107,7 @@ index 6e2be78..b16a9e1 100644
};
}
}
@@ -434,7 +429,7 @@ class MoveToFileCodeAction extends vscode.CodeAction {
@@ -430,7 +426,7 @@ class MoveToFileCodeAction extends vscode.CodeAction {
this.command = {
title: action.description,
command: MoveToFileRefactorCommand.ID,
Expand All @@ -107,7 +116,7 @@ index 6e2be78..b16a9e1 100644
};
}
}
@@ -449,7 +444,7 @@ class SelectCodeAction extends vscode.CodeAction {
@@ -445,7 +441,7 @@ class SelectCodeAction extends vscode.CodeAction {
this.command = {
title: info.description,
command: SelectRefactorCommand.ID,
Expand Down
8 changes: 6 additions & 2 deletions packages/service/src/shims/extensions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import * as vscode from "vscode";
import { Emitter } from "vscode-languageserver-protocol";

export function createExtensionsShim() {
export function createExtensionsShim(): typeof vscode.extensions {
return {
onDidChange: new Emitter().event,
onDidChange: new Emitter<void>().event,
all: [],
getExtension() {
return undefined;
},
};
}
1 change: 1 addition & 0 deletions packages/service/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"baseUrl": "./",
"resolveJsonModule": true,
"esModuleInterop": true,
"paths": {
"@vsc-ts/*": ["src/typescript-language-features/src/*"]
}
Expand Down
6 changes: 4 additions & 2 deletions packages/service/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"include": [
"src/**/*",
"vscode/src/vscode-dts/vscode.d.ts",
"vscode/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts",
"vscode/src/vscode-dts/vscode.proposed.codeActionAI.d.ts",
"vscode/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",
"vscode/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",
"vscode/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts",
"vscode/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"
"vscode/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"
]
}
2 changes: 2 additions & 0 deletions packages/service/tsconfig.lint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"src/**/*",
"tests/**/*",
"vscode/src/vscode-dts/vscode.d.ts",
"vscode/src/vscode-dts/vscode.proposed.codeActionAI.d.ts",
"vscode/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts",
"vscode/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"
]
}
2 changes: 1 addition & 1 deletion packages/service/vscode
Submodule vscode updated 1812 files
Loading