Skip to content

Commit

Permalink
fix(deps): update packages/service/vscode digest to 05f13ec (#207)
Browse files Browse the repository at this point in the history
* fix(deps): update packages/service/vscode digest to 05f13ec

* build: no timeout on conflict resolve

* update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: yioneko <[email protected]>
  • Loading branch information
renovate[bot] and yioneko authored Nov 9, 2024
1 parent 037c2b6 commit b67eb34
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 75 deletions.
65 changes: 22 additions & 43 deletions packages/service/patches/010-editor-format-options.patch
Original file line number Diff line number Diff line change
@@ -1,88 +1,67 @@
diff --git a/src/languageFeatures/fileConfigurationManager.ts b/src/languageFeatures/fileConfigurationManager.ts
index 0b5a4c6..6b0b762 100644
index 9b0c10a..f5578f2 100644
--- a/src/languageFeatures/fileConfigurationManager.ts
+++ b/src/languageFeatures/fileConfigurationManager.ts
@@ -46,26 +46,27 @@ export default class FileConfigurationManager extends Disposable {
@@ -52,10 +52,7 @@ export default class FileConfigurationManager extends Disposable {
document: vscode.TextDocument,
token: vscode.CancellationToken
): Promise<void> {
const formattingOptions = this.getFormattingOptions(document);
- const formattingOptions = this.getFormattingOptions(document);
- if (formattingOptions) {
+ // if (formattingOptions) {
return this.ensureConfigurationOptions(document, formattingOptions, token);
- return this.ensureConfigurationOptions(document, formattingOptions, token);
- }
+ // }
+ return this.ensureConfigurationOptions(document, undefined, token);
}

private getFormattingOptions(
document: vscode.TextDocument
- ): vscode.FormattingOptions | undefined {
- const editor = vscode.window.visibleTextEditors.find(editor => editor.document.fileName === document.fileName);
- return editor
- ? {
- tabSize: editor.options.tabSize,
- insertSpaces: editor.options.insertSpaces
- } as vscode.FormattingOptions
- : undefined;
+ ): undefined {
+ // const editor = vscode.window.visibleTextEditors.find(editor => editor.document.fileName === document.fileName);
+ // return editor
+ // ? {
+ // tabSize: editor.options.tabSize,
+ // insertSpaces: editor.options.insertSpaces
+ // } as vscode.FormattingOptions
+ // : undefined;
+ return;
}
private getFormattingOptions(document: vscode.TextDocument): FormattingOptions | undefined {
@@ -72,7 +69,7 @@ export default class FileConfigurationManager extends Disposable {

public async ensureConfigurationOptions(
document: vscode.TextDocument,
- options: vscode.FormattingOptions,
+ options: vscode.FormattingOptions | undefined,
- options: FormattingOptions,
+ options: FormattingOptions | undefined,
token: vscode.CancellationToken
): Promise<void> {
const file = this.client.toOpenTsFilePath(document);
@@ -104,14 +105,14 @@ export default class FileConfigurationManager extends Disposable {
@@ -111,14 +108,9 @@ export default class FileConfigurationManager extends Disposable {
document: vscode.TextDocument,
token: vscode.CancellationToken,
): Promise<void> {
- const formattingOptions = this.getFormattingOptions(document);
- if (!formattingOptions) {
- return;
- }
+ // const formattingOptions = this.getFormattingOptions(document);
+ // if (!formattingOptions) {
+ // return;
+ // }

-
const args: Proto.ConfigureRequestArguments = {
file: undefined /*global*/,
- ...this.getFileOptions(document, formattingOptions),
+ ...this.getFileOptions(document),
};
await this.client.execute('configure', args, token);
}
@@ -122,7 +123,7 @@ export default class FileConfigurationManager extends Disposable {
@@ -129,7 +121,7 @@ export default class FileConfigurationManager extends Disposable {

private getFileOptions(
document: vscode.TextDocument,
- options: vscode.FormattingOptions
+ options?: vscode.FormattingOptions,
- options: FormattingOptions
+ options?: FormattingOptions
): FileConfiguration {
return {
formatOptions: this.getFormatOptions(document, options),
@@ -132,18 +133,24 @@ export default class FileConfigurationManager extends Disposable {
@@ -139,18 +131,25 @@ export default class FileConfigurationManager extends Disposable {

private getFormatOptions(
document: vscode.TextDocument,
- options: vscode.FormattingOptions
+ options: vscode.FormattingOptions | undefined
- options: FormattingOptions
+ options?: FormattingOptions
): Proto.FormatCodeSettings {
const config = vscode.workspace.getConfiguration(
isTypeScriptDocument(document) ? 'typescript.format' : 'javascript.format',
document.uri);
+ const tsEditorConfig = vscode.workspace.getConfiguration(
+ isTypeScriptDocument(document) ? 'vtsls.typescript.format' : 'vtsls.javascript.format',
+ document.uri);
+ isTypeScriptDocument(document) ? "vtsls.typescript.format" : "vtsls.javascript.format",
+ document.uri
+ );

return {
- tabSize: options.tabSize,
Expand All @@ -96,7 +75,7 @@ index 0b5a4c6..6b0b762 100644
+ convertTabsToSpaces: options?.insertSpaces ?? tsEditorConfig.get("convertTabsToSpaces"),
// We can use \n here since the editor normalizes later on to its line endings.
- newLineCharacter: '\n',
+ newLineCharacter: tsEditorConfig.get("newLineCharacter") ?? '\n',
+ newLineCharacter: tsEditorConfig.get("newLineCharacter") ?? '\n',
insertSpaceAfterCommaDelimiter: config.get<boolean>('insertSpaceAfterCommaDelimiter'),
insertSpaceAfterConstructor: config.get<boolean>('insertSpaceAfterConstructor'),
insertSpaceAfterSemicolonInForStatements: config.get<boolean>('insertSpaceAfterSemicolonInForStatements'),
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/tsServer/bufferSyncSupport.ts b/src/tsServer/bufferSyncSupport.ts
index 356c170..20db569 100644
index 56d2896..73aa59f 100644
--- a/src/tsServer/bufferSyncSupport.ts
+++ b/src/tsServer/bufferSyncSupport.ts
@@ -756,10 +756,6 @@ export default class BufferSyncSupport extends Disposable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/src/languageProvider.ts b/src/languageProvider.ts
index 7b95591..eb8fe90 100644
index 09a4fe3..3c9d29b 100644
--- a/src/languageProvider.ts
+++ b/src/languageProvider.ts
@@ -92,6 +92,7 @@ export default class LanguageProvider extends Disposable {
import('./languageFeatures/tagClosing').then(provider => this._register(provider.register(selector, this.description, this.client))),
@@ -93,6 +93,7 @@ export default class LanguageProvider extends Disposable {
import('./languageFeatures/typeDefinitions').then(provider => this._register(provider.register(selector, this.client))),
import('./languageFeatures/copilotRelated').then(provider => this._register(provider.register(selector, this.client))),
]);
+ (vscode.languages as any).$triggerStaticFeaturesRegistered();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/package.json b/package.json
index 92a36e5..5278491 100644
index c6363df..634a567 100644
--- a/package.json
+++ b/package.json
@@ -67,7 +67,7 @@
@@ -68,7 +68,7 @@
"onCommand:typescript.tsserverRequest",
"onCommand:_typescript.configurePlugin",
"onCommand:_typescript.learnMoreAboutRefactorings",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/typescriptServiceClient.ts b/src/typescriptServiceClient.ts
index a1f06a3..41d3419 100644
index b5fdb18..d196d68 100644
--- a/src/typescriptServiceClient.ts
+++ b/src/typescriptServiceClient.ts
@@ -881,7 +881,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
@@ -877,7 +877,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
expectsResult: true,
...config,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/service/patches/180-auto-use-workspace-tsdk.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/configuration/configuration.ts b/src/configuration/configuration.ts
index d70b8f7..7cf087f 100644
index 693e7ad..2d969a6 100644
--- a/src/configuration/configuration.ts
+++ b/src/configuration/configuration.ts
@@ -101,6 +101,7 @@ export class ImplicitProjectConfiguration {
Expand All @@ -10,7 +10,7 @@ index d70b8f7..7cf087f 100644
readonly locale: string | null;
readonly globalTsdk: string | null;
readonly localTsdk: string | null;
@@ -140,6 +141,7 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
@@ -144,6 +145,7 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
public loadFromWorkspace(): TypeScriptServiceConfiguration {
const configuration = vscode.workspace.getConfiguration();
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/commands/tsserverRequests.ts b/src/commands/tsserverRequests.ts
index ba545df..b5c020d 100644
index 50aeedf..96ab233 100644
--- a/src/commands/tsserverRequests.ts
+++ b/src/commands/tsserverRequests.ts
@@ -33,7 +33,8 @@ export class TSServerRequestCommand implements Command {
Expand All @@ -11,7 +11,7 @@ index ba545df..b5c020d 100644
+ 'getMoveToRefactoringFileSuggestions'
];

if (!allowList.includes(requestID)) { return; }
if (allowList.includes(command) || command.startsWith('_')) {
diff --git a/src/languageFeatures/refactor.ts b/src/languageFeatures/refactor.ts
index 1317cda..3e28248 100644
--- a/src/languageFeatures/refactor.ts
Expand Down
22 changes: 11 additions & 11 deletions packages/service/patches/410-handle-yarn-zipfile.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
diff --git a/src/configuration/fileSchemes.ts b/src/configuration/fileSchemes.ts
index ca268e2..96c9f0b 100644
index 9d54f0b..c77603c 100644
--- a/src/configuration/fileSchemes.ts
+++ b/src/configuration/fileSchemes.ts
@@ -23,6 +23,7 @@ export const chatCodeBlock = 'vscode-chat-code-block';
@@ -20,6 +20,7 @@ export const officeScript = 'office-script';

/** Used for code blocks in chat by copilot. */
export const chatBackingCodeBlock = 'vscode-copilot-chat-code-block';
/** Used for code blocks in chat by vs code core */
export const chatCodeBlock = 'vscode-chat-code-block';
+export const zipfile = 'zipfile';

export function getSemanticSupportedSchemes() {
if (isWeb() && vscode.workspace.workspaceFolders) {
@@ -36,6 +37,7 @@ export function getSemanticSupportedSchemes() {
const alwaysSupportedSchemes = [
@@ -27,6 +28,7 @@ export function getSemanticSupportedSchemes() {
walkThroughSnippet,
vscodeNotebookCell,
chatCodeBlock,
chatBackingCodeBlock,
+ zipfile
];
}

if (isWeb()) {
diff --git a/src/typescriptServiceClient.ts b/src/typescriptServiceClient.ts
index 41d3419..6378806 100644
index d196d68..40a1269 100644
--- a/src/typescriptServiceClient.ts
+++ b/src/typescriptServiceClient.ts
@@ -596,7 +596,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
Expand All @@ -31,7 +31,7 @@ index 41d3419..6378806 100644
preferences: {
providePrefixAndSuffixTextForRename: true,
allowRenameOfImportPath: true,
@@ -772,6 +772,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
@@ -768,6 +768,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return resource.fsPath;
}

Expand All @@ -42,7 +42,7 @@ index 41d3419..6378806 100644
return (this.isProjectWideIntellisenseOnWebEnabled() ? '' : inMemoryResourcePrefix)
+ '/' + resource.scheme
+ '/' + (resource.authority || emptyAuthority)
@@ -820,6 +824,17 @@ export default class TypeScriptServiceClient extends Disposable implements IType
@@ -816,6 +820,17 @@ export default class TypeScriptServiceClient extends Disposable implements IType
return this.bufferSyncSupport.toVsCodeResource(resource);
}
}
Expand Down
32 changes: 32 additions & 0 deletions packages/service/patches/450-fix-tsc-err.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,35 @@ index 8fd7ce4..b1d24bc 100644
import VsCodeTelemetryReporter from '@vscode/extension-telemetry';
import * as vscode from 'vscode';
import * as tas from 'vscode-tas-client';
diff --git a/src/languageFeatures/copilotRelated.ts b/src/languageFeatures/copilotRelated.ts
index 632b047..009d112 100644
--- a/src/languageFeatures/copilotRelated.ts
+++ b/src/languageFeatures/copilotRelated.ts
@@ -70,10 +70,12 @@ export function register(
if (!file) {
return { entries: [] };
}
+ // @ts-expect-error until ts 5.7
const response = await client.execute('copilotRelated', { file, }, token) as Proto.CopilotRelatedResponse;
if (response.type !== 'response' || !response.body) {
return { entries: [] };
}
+ // @ts-expect-error until ts 5.7
return { entries: response.body.relatedFiles.map(f => client.toResource(f)), traits: [] };
}));
}
diff --git a/src/typescriptService.ts b/src/typescriptService.ts
index 306769f..d432b63 100644
--- a/src/typescriptService.ts
+++ b/src/typescriptService.ts
@@ -77,8 +77,10 @@ interface StandardTsServerRequests {
'getMoveToRefactoringFileSuggestions': [Proto.GetMoveToRefactoringFileSuggestionsRequestArgs, Proto.GetMoveToRefactoringFileSuggestions];
'linkedEditingRange': [Proto.FileLocationRequestArgs, Proto.LinkedEditingRangeResponse];
'mapCode': [Proto.MapCodeRequestArgs, Proto.MapCodeResponse];
+ // @ts-expect-error until ts 5.7
'copilotRelated': [Proto.FileRequestArgs, Proto.CopilotRelatedResponse];
'getPasteEdits': [Proto.GetPasteEditsRequestArgs, Proto.GetPasteEditsResponse];
+ // @ts-expect-error until ts 5.7
'preparePasteEdits': [Proto.PreparePasteEditsRequestArgs, Proto.PreparePasteEditsResponse];
}

5 changes: 3 additions & 2 deletions packages/service/scripts/genConfigSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ async function genSchema() {
"typescript.surveys.enabled",
"typescript.tsserver.enableRegionDiagnostics",
"typescript.tsserver.experimental.useVsCodeWatcher",
"javascript.experimental.updateImportsOnPaste",
"typescript.experimental.updateImportsOnPaste",
"javascript.updateImportsOnPaste.enabled",
"typescript.updateImportsOnPaste.enabled",
"typescript.experimental.expandableHover",
];

for (const p of unavailableOptions) {
Expand Down
17 changes: 13 additions & 4 deletions packages/service/scripts/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,25 @@ async function copyTsExtTo(targetDir) {
await writePatchMark(targetDir, { sha, patched: false });
}

async function pressAnyKey() {
/**
* @param {number} timeout
*/
async function pressAnyKey(timeout) {
stdin.setRawMode(true);
/**
* @type {Buffer}
*/
const buffer = await new Promise((resolve) => {
const timeout = setTimeout(() => resolve, 60 * 1000); // 60s
let timer;
if (timeout != 0) {
timer = setTimeout(() => resolve, timeout ?? 60 * 1000); // 60s
}
stdin.resume();
stdin.once("data", (buffer) =>
process.nextTick(() => {
clearTimeout(timeout);
if (timer) {
clearTimeout(timer);
}
return resolve(buffer);
})
);
Expand Down Expand Up @@ -215,7 +224,7 @@ async function applyPatches(refresh) {
stdout.write(
`Patch file ${p} failed, press any key when the conflict has been resolved...`
);
await pressAnyKey();
await pressAnyKey(0);
}
const { stdout: newPatchContent } = await exec("git", ["diff", "-U"], {
cwd: tsExtPath,
Expand Down
3 changes: 2 additions & 1 deletion packages/service/src/service/pkgJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function getDefaultConfig() {
const overrideDefaults = {
"typescript.tsserver.enableRegionDiagnostics": false,
"typescript.tsserver.experimental.useVsCodeWatcher": false,
"typescript.tsserver.watchOptions": {},
};

const res: TSLanguageServiceConfig = {};
Expand All @@ -42,7 +43,7 @@ function getDefaultConfig() {

for (const [key, val] of Object.entries(contributed)) {
let defaultVal = "default" in val ? val.default : undefined;
if (!defaultVal) {
if (!defaultVal && "type" in val) {
if (val.type === "string") {
defaultVal = "";
} else if (val.type === "array") {
Expand Down
17 changes: 17 additions & 0 deletions packages/service/src/shims/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,23 @@ export class Hover {
}
}

export class VerboseHover extends Hover {

public canIncreaseVerbosity: boolean | undefined;
public canDecreaseVerbosity: boolean | undefined;

constructor(
contents: vscode.MarkdownString | vscode.MarkedString | (vscode.MarkdownString | vscode.MarkedString)[],
range?: Range,
canIncreaseVerbosity?: boolean,
canDecreaseVerbosity?: boolean,
) {
super(contents, range);
this.canIncreaseVerbosity = canIncreaseVerbosity;
this.canDecreaseVerbosity = canDecreaseVerbosity;
}
}

export enum DocumentHighlightKind {
Text = 0,
Read = 1,
Expand Down
1 change: 1 addition & 0 deletions packages/service/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"vscode/src/vscode-dts/vscode.proposed.createFileSystemWatcher.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.editorHoverVerbosityLevel.d.ts",
"vscode/src/vscode-dts/vscode.proposed.documentPaste.d.ts",
"vscode/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts",
"vscode/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/service/vscode
Submodule vscode updated 1707 files
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"lib": ["ES2020"],
"lib": ["ES2020", "ES2021.Promise"],
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitAny": true,
Expand Down

0 comments on commit b67eb34

Please sign in to comment.