mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
Pick up TS 4.1-rc for insiders
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user