Webstorm links to wrong method implementation

Hello.

I have a file ...

transformManager.js that calls a method (getSchedule) in class in scheduleManager.js

Unfortunately, webstorm refers me to the wrong implementation (scheduleManager.test.js)

The reason for that is probably that I mock in the implementation in this file

 

Is there a way of manually addressing the correct implementation?  

 

thanks in advance,

Patrick

 

0
5 comments

No, there is unfortunately no way to do this. Do you mean that the actual implementation is not found at all, only the one in the spec file is found? Can you share a sample project that can be used to recreate the issue?

0

Exactly, it just find the defiinition in the test file, not in the scheduleManager.js file. It is probably mot a good idea to check *.test.js files, isn't it? The project is pretty big therefore it difficult to share the project. 

0

Please try composing a sample project the issue can be reproduced in

0

I'm having the same issue in a Vue project (using IntelliJ IDEA Ultimate 2024.3 (243.21565.193)). If I try to navigate to the implementation of store methods, like “isFlagEnabled” which is imported from currentUser store in this example:

computed: {
  ...mapGetters('currentUser', ['isFlagEnabled']),
  isFeatureEnabled() {
    return this.isFlagEnabled('FEATURE_A');
  },
},

, it goes to a .spec.js file instead of the real .js implementation. There's also no option to go to a different implementation

0

Would it be possible to narrow the problem down to a minimal repo project and share this with us?

0

Please sign in to leave a comment.