TypeScript/tests/cases/fourslash/codefixEnableExperimentalDecorators_noTsconfig.ts
Josh Goldberg 8d28f9230c Added codefix to enable experimentalDecorators in the user's config file
Starts on #29035 by creating a codefix to enable the `experimentalDecorators` setting in a user's config file, if one exists. The issue's discussion also mentions giving a more precise error message if the user has a jsconfig or tsconfig or creating one if not; I'd rather tackle those in separate PRs to keep this one small.

Doesn't create the code action if no config file is present. Otherwise keeps to the precedent of returning without action when the config file contents aren't the expected JSON structure (looking at `fixCannotFindModule.ts`).  Moves a couple JSON helpers from that file into the sibling `helpers.ts` so both codefixes can use them.
2019-01-11 09:20:12 -05:00

11 lines
213 B
TypeScript

/// <reference path='fourslash.ts' />
// @Filename: /dir/a.ts
////declare const decorator: any;
////class A {
//// @decorator method() {};
////};
goTo.file("/dir/a.ts");
verify.not.codeFixAvailable();