apache / apache/netbeans

Go to declaration: no proposition for javascript duplicated functions inside an object

Open
#9,144 2 comments 0 reactions 0 assignees View on GitHub
Editor JavaScript kind:feature needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

Hi,
Normally, when pressing F3 on a function, a popup allow to choose among same functionson different files.
But in Javascript files it is not working well.

### Use case/motivation

I have a JS file and a minified version of it.
When pressing F3 it goes directly to the minified one, no proposition of other location. Same thing if this is called from an HTML file.
It seems not working when the function is inside an object and the function is called with the object name.

Example

```
// file code.js
var myObject = {
myFunction() {
alert('here i am');
},
myCall(){
this.myFunction(); // Pressing F3 on myFunction goes to code.min.js
}
};
myObject .myFunction(); // Pressing F3 on myFunction goes to code.min.js

// file code.min.js
var myObject={myFunction() {alert('here i am');},myCall(){this.myFunction();}};myObject .myFunction();
```

Is it possible to have the proposition of the 2 locations, or favor the function inside the same file?
Thank you

### Related issues

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in NetBeans with the provided code.js and code.min.js examples, including the call from HTML and the object-member calls. Start by tracing the JavaScript editor's F3 declaration lookup; done means the lookup offers both declarations or consistently favors the same-file function instead of jumping directly to the minified version.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.