Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure implement interface quick fix quote type #18169

Closed
mjbvz opened this issue Aug 30, 2017 · 3 comments
Closed

Configure implement interface quick fix quote type #18169

mjbvz opened this issue Aug 30, 2017 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Aug 30, 2017

From microsoft/vscode#33476

TypeScript Version: 2.5.1

Code

interface IFoo {
    bar(): number;
}

class Foo implements IFoo {
    
}

Trigger the implement interface quick fix on class Foo

Expected behavior:
Users can configure if single or double quotes are used for the Method not implemented error

Actual behavior:
Double quotes are always used for the Method not implemented error

interface IFoo {
    bar(): number;
}

class Foo implements IFoo {
    bar(): number {
        throw new Error("Method not implemented.");
    }

}

Related to #13270

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Aug 30, 2017
@mhegazy mhegazy added the Bug A bug in TypeScript label Aug 31, 2017
@mhegazy mhegazy assigned ghost Aug 31, 2017
@ghost
Copy link

ghost commented Aug 31, 2017

@rbuckton did something similar in #17750 -- should we generalize this to looking at all StringLiteral nodes in a file to determine what quote style is preferred?

@mhegazy
Copy link
Contributor

mhegazy commented Aug 31, 2017

I would say add a config option for users to choose quote type. in absence of that we can use @rbuckton's inference for imports still.

@mjbvz
Copy link
Contributor Author

mjbvz commented Aug 31, 2017

Yes I think it makes more sense to have an option in this case. VSCode uses both styles of quotes in its source for example, but only uses double quotes for UI strings

@ghost ghost mentioned this issue Mar 12, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Mar 12, 2018
@ghost ghost closed this as completed in #22236 Mar 20, 2018
ghost pushed a commit that referenced this issue Mar 20, 2018
* Support services settings

* Code review

* More review

* Use different names for Options and GetCompletionsAtPositionOptions (todo: come up with better names)

* More renames

* More renaming

* Support quote style in importFixes

* Add `importModuleSpecifierPreference` option

* Support quote style for `throw new Error('Method not implemented.')` (#18169)

* options -> preferences
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants