Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense for Ember injected services

I am a bit frustrated that there doesn't seem any decent "Ember intellisense" available in any common IDE (like VS Code, Webstorm, Atom). By "intellisense" I mean that, as long as my Ember project is a standard Ember CLI project with all the common Service, Helper folders etc., and I inject e.g. a service using myService: service(), this would be recognized by Intellisense and, after typing this.myService, I would see all functions in the service. Also, if I Ctrl+Click on the function in this.myService.myFunction(), I would expect to navigate to the definition of myFunction.

For other frameworks, such as Angular, there are plugins which support all this.

Is it really the case that I have to use "Find in Files" to find the definition of a service function?

Does anyone know of a way or tool which I might have missed, and which would support this scenario? Note that I don't speak of bare-bones features such as switching between router/controller/template, but of real intellisense for custom objects.

like image 383
Urs Meili Avatar asked Oct 16 '22 05:10

Urs Meili


1 Answers

The situation is indeed not yet great. There are a couple things that do help quite a bit:

  • Using TypeScript via the ember-cli-typescript project will unlock a lot of these benefits for you. (Full disclosure: I'm a maintainer.)
  • There's a community-driven IntelliJ plugin which is pretty good, intellij-emberj; it has a fair number of those features and it's kept up to date by a member of the Ember CLI team.
  • There's a suite of VS Code plugins, including a language server, which gives a fair bit of it.

(There's certainly a lot more to be done here, and unfortunately none of the IDE developers seem interested in providing native support themselves, so it has fallen to the community to build it all.)

like image 66
Chris Krycho Avatar answered Oct 21 '22 01:10

Chris Krycho