Typescript: Support options in quick fixes/refactoring

Created on 11 Dec 2017  路  10Comments  路  Source: microsoft/TypeScript

We should support editor configuration of services behavior like we do for formatting.

Would fix:

  • #18169
  • #19019 (if there's no existing import to infer from)
  • #19997
  • We could prefer to create a namespace import instead of a named import for import completions and import fixes
API Quick Fixes Refactorings Fixed Suggestion

Most helpful comment

please add an option to always use absolute paths (relative to baseUri) for imports at completions, per: https://github.com/Microsoft/TypeScript/issues/21860

All 10 comments

As covered in #21768, I see a lot of requests against VS Code for configuring quotes specifically. Cases where quotes should be configurable include:

  • Imports
  • Bracket accessors
  • Implement interface / implement abstract class or method
  • Others?

please add an option to always use absolute paths (relative to baseUri) for imports at completions, per: https://github.com/Microsoft/TypeScript/issues/21860

+1

If possible I would like an option to NEVER even see the relative path suggestions; or spaghetti imports as I like to think of them.

Any explanation on why it suddenly doesn't work at all? I've reverted to the 1.19.3 just because it's unusable. In 1.19.3 spaghetti paths aren't even suggested, only the correct absolute paths (as per the tsconfig)

@mjbvz please add an option to omit the semicolon on import statements

Thanks - please consider https://github.com/Microsoft/TypeScript/issues/22249 to allow the old behaviour of full import paths (rather than ../../...), which I gather may be the same as https://github.com/Microsoft/TypeScript/issues/21860

how did it even come to mind to make relatives paths a default choice? what makes the design team think they are more convenient?

Relative vs Absolute

@andy-ms why did you label this "Fixed"? What's the fix?

I've looked though 2.8.1, 2.8.2 and the roadmap for 2.9 not sure what you're implying fixes it.

The fix went in https://github.com/Microsoft/TypeScript/pull/22236. It is scheduled to release in Typescript 2.8 (added to the road-map).

VSCode /VS still need to expose these settings in a way you can interact with. https://github.com/Microsoft/vscode/issues/45948 is a good issue to watch for VSCode.

For posterity,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wmaurer picture wmaurer  路  3Comments

zhuravlikjb picture zhuravlikjb  路  3Comments

jbondc picture jbondc  路  3Comments

siddjain picture siddjain  路  3Comments

Roam-Cooper picture Roam-Cooper  路  3Comments