Pick up TS 4.1-rc for insiders

This commit is contained in:
Matt Bierner 2020-11-03 15:04:10 -08:00
parent a7cd9408a9
commit 0608e3f5bd
5 changed files with 9 additions and 32 deletions

View file

@ -3,7 +3,7 @@
"version": "0.0.1",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "4.0.3"
"typescript": "4.1.1-rc"
},
"scripts": {
"postinstall": "node ./postinstall"

View file

@ -13,18 +13,6 @@ import { isTypeScriptDocument } from '../utils/languageModeIds';
import { equals } from '../utils/objects';
import { ResourceMap } from '../utils/resourceMap';
namespace Experimental {
// https://github.com/microsoft/TypeScript/pull/37871/
export interface UserPreferences extends Proto.UserPreferences {
readonly provideRefactorNotApplicableReason?: boolean;
}
// https://github.com/microsoft/TypeScript/issues/41208
export interface FormatCodeSettings extends Proto.FormatCodeSettings {
readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
}
}
interface FileConfiguration {
readonly formatOptions: Proto.FormatCodeSettings;
readonly preferences: Proto.UserPreferences;
@ -141,7 +129,7 @@ export default class FileConfigurationManager extends Disposable {
private getFormatOptions(
document: vscode.TextDocument,
options: vscode.FormattingOptions
): Experimental.FormatCodeSettings {
): Proto.FormatCodeSettings {
const config = vscode.workspace.getConfiguration(
isTypeScriptDocument(document) ? 'typescript.format' : 'javascript.format',
document.uri);
@ -185,7 +173,7 @@ export default class FileConfigurationManager extends Disposable {
isTypeScriptDocument(document) ? 'typescript.preferences' : 'javascript.preferences',
document.uri);
const preferences: Experimental.UserPreferences = {
const preferences: Proto.UserPreferences = {
quotePreference: this.getQuoteStylePreference(preferencesConfig),
importModuleSpecifierPreference: getImportModuleSpecifierPreference(preferencesConfig),
importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(preferencesConfig),

View file

@ -20,11 +20,6 @@ import FormattingOptionsManager from './fileConfigurationManager';
const localize = nls.loadMessageBundle();
namespace Experimental {
export interface RefactorActionInfo extends Proto.RefactorActionInfo {
readonly notApplicableReason?: string;
}
}
interface DidApplyRefactoringCommand_Args {
readonly codeAction: InlinedCodeAction
@ -354,7 +349,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
}
private refactorActionToCodeAction(
action: Experimental.RefactorActionInfo,
action: Proto.RefactorActionInfo,
document: vscode.TextDocument,
info: Proto.ApplicableRefactorInfo,
rangeOrSelection: vscode.Range | vscode.Selection,

View file

@ -30,12 +30,6 @@ import * as typeConverters from './utils/typeConverters';
import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus';
import * as ProjectStatus from './utils/largeProjectStatus';
namespace Experimental {
export interface Diagnostic extends Proto.Diagnostic {
readonly reportsDeprecated?: {}
}
}
// Style check diagnostics that can be reported as warnings
const styleCheckDiagnostics = new Set([
...errorCodes.variableDeclaredButNeverUsed,
@ -256,7 +250,7 @@ export default class TypeScriptServiceClientHost extends Disposable {
return diagnostics.map(tsDiag => this.tsDiagnosticToVsDiagnostic(tsDiag, source));
}
private tsDiagnosticToVsDiagnostic(diagnostic: Experimental.Diagnostic, source: string): vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any } {
private tsDiagnosticToVsDiagnostic(diagnostic: Proto.Diagnostic, source: string): vscode.Diagnostic & { reportUnnecessary: any, reportDeprecated: any } {
const { start, end, text } = diagnostic;
const range = new vscode.Range(typeConverters.Position.fromLocation(start), typeConverters.Position.fromLocation(end));
const converted = new vscode.Diagnostic(range, text, this.getDiagnosticSeverity(diagnostic));

View file

@ -2,7 +2,7 @@
# yarn lockfile v1
typescript@4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5"
integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==
typescript@4.1.1-rc:
version "4.1.1-rc"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.1-rc.tgz#4a335244b9b2754995849ca4b607c74d6ee73719"
integrity sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==