Skip to content

python like imports for better suggestions for better auto complete #27390

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

Closed
4 tasks done
aaayushsingh opened this issue Sep 27, 2018 · 5 comments
Closed
4 tasks done
Labels
Duplicate An existing issue was already created

Comments

@aaayushsingh
Copy link

Search Terms

  1. import
  2. python import
  3. import python

Suggestion

python like imports so that we have better suggestions for autocomplete in editors
eg: from lib import module

current implementation

import { OnInit } from "@angular/core";

this way has poor autocomplete support in editors. Editors can only show suggestions after it knows that I'm importing from "@angular/code"

suggested implementation

from "@angular/core" import { OnInit }

when this compiles to js, it stays the same

Use Cases

better autocomplete suggestions in most editors. Currently to use better autocomplete, I have to first write the name of the library and then come back to the name of the module I want to import to get autocomplete suggestions which I can select by pressing just tab

Examples

from "@angular/core" import { OnInit }
from "../myCustomLib" import { SomeItem}

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Also, if you guys decide to implement this, can I get to work on this?

@ghost
Copy link

ghost commented Sep 27, 2018

This is out of scope of the design goals since it would add new expression-level syntax.

@ghost ghost added the Out of Scope This idea sits outside of the TypeScript language design constraints label Sep 27, 2018
@AlCalzone
Copy link
Contributor

If you use the VSCode snippet for import, the module is filled out first and then the imports so you get autocomplete.

@DanielRosenwasser DanielRosenwasser added Duplicate An existing issue was already created and removed Out of Scope This idea sits outside of the TypeScript language design constraints labels Sep 28, 2018
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@Alireza-Ghavabesh
Copy link

please add python like import for better suggestion

@microsoft microsoft locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants