Skip to content

Commit

Permalink
Gate auto fix for TS to use an undocumented experimental TS setting
Browse files Browse the repository at this point in the history
We likely do not want to enable autofixes until we have proper TS support: microsoft/TypeScript#29452
  • Loading branch information
mjbvz committed Jan 22, 2019
1 parent 4e6bd4a commit ee65a24
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions extensions/typescript-language-features/src/features/autoFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as nls from 'vscode-nls';
import * as Proto from '../protocol';
import { ITypeScriptServiceClient } from '../typescriptService';
import API from '../utils/api';
import { VersionDependentRegistration } from '../utils/dependentRegistration';
import { ConfigurationDependentRegistration, VersionDependentRegistration } from '../utils/dependentRegistration';
import * as typeConverters from '../utils/typeConverters';
import { DiagnosticsManager } from './diagnostics';
import FileConfigurationManager from './fileConfigurationManager';
Expand Down Expand Up @@ -126,8 +126,9 @@ export function register(
client: ITypeScriptServiceClient,
fileConfigurationManager: FileConfigurationManager,
diagnosticsManager: DiagnosticsManager) {
return new VersionDependentRegistration(client, API.v213, () =>
vscode.languages.registerCodeActionsProvider(selector,
new TypeScriptAutoFixProvider(client, fileConfigurationManager, diagnosticsManager),
TypeScriptAutoFixProvider.metadata));
return new VersionDependentRegistration(client, API.v300, () =>
new ConfigurationDependentRegistration('typescript', 'experimental.autoFix.enabled', () =>
vscode.languages.registerCodeActionsProvider(selector,
new TypeScriptAutoFixProvider(client, fileConfigurationManager, diagnosticsManager),
TypeScriptAutoFixProvider.metadata)));
}

0 comments on commit ee65a24

Please sign in to comment.