angular / angular

Deliver web apps with confidence 🚀
https://angular.dev
MIT License
95.87k stars 25.32k forks source link

Language Service: Automatic Import Improvements #47737

Open dylhunn opened 1 year ago

dylhunn commented 1 year ago

I recently implemented auto-imports in the language service in https://github.com/angular/angular/pull/47088. This feature includes the scaffolding for a large number of possible improvements, tracked below. We should prioritize some of these to make the experience as excellent as possible.

✅ Complete | 🚧 In Progress | 🗓️ Planned

Collected PRs Relevant to this Hotlist Language Service: #47181, #47088, #47787, #47938, #48074, #48354 Compiler: #47180, #47166, #47561, #47631, #48090

kbrilla commented 1 year ago

Is the code behind this feature using typescript auto-import rules? [https://github.com/microsoft/TypeScript/issues/51155](Auto-import priority rules) There are some issues right now in TS when for example monorepors like nx are involved where relative paths are proposed instead of @my-lib/... even if they are properly exported in barrels.

dylhunn commented 1 year ago

@kbrilla

Is the code behind this feature using typescript auto-import rules?

Not at present. I may switch to using the TypeScript compiler to emit some import references -- I need to do more research into how this works.

In general, we can always emit a same-project relative path, but figuring out absolute specifiers is much trickier.

JeanMeche commented 1 year ago

Awesome work !

Btw you might want to consider #48689 which have been opened recently !

dylhunn commented 1 year ago

Thanks. I hadn't actually seen that issue yet.

Akxe commented 1 year ago

What do I need to do in order to enable this in my codebase? I am using Angular 15.1 with nx monorepo

kbrilla commented 1 year ago

Any progress on this one? Seems like Webstorm is once again ahead of angular language service

rezoled commented 1 year ago

What's the current status and roadmap? We are currently running with language service 16.1 and it seems like a lot of features are missing, which makes it really difficult to us to migrate to VSCode from IntelliJ. Specifically

fMoro1999 commented 10 months ago

Hi, are there any news on this?

itspers commented 1 month ago

Can't understand how people using Vscode for developing angular... Trying once in few months, it looks like some kind of GPT in 50% of functions now, but it still cant import simple button directive. Only theory i have - MS made it not to write real code, but to have something simple and fast to shoot videos of how to make hello world one-file projects to make them viral in twitter and popularize programming in general...