Jump-to-definition jumps to top of file before jumping to definition of exported function #4296
Comments
Per the comments on #3863, this is because we need a CodeMirror instance in order to find the actual definition of the exported function, so either we would need to create one separately before opening the file, or we'd need some other way to tokenize the file before opening it. |
Low priority to @eztierney |
We could tokenize the file ahead of time with acorn, but that seems like a waste of work since we will then be tokenizing it twice when we actually open the file. |
Maybe there's a way we could just prevent the editor from showing itself before we're ready to tell it what position to scroll to. Would need a little thought as to the best way to do this. |
Bumping to medium priority. This feels really bad--there's often a long pause between the time it switches to the new file and the time it jumps to the correct location, and it's actively confusing. |
To @dangoor since it's related to code hints (though the solution might actually be more in the timing of editor switches). Nominating for sprint 35. |
Not going to get to this in 35. Moving to 36. |
Just calling To avoid redundant tokenization you just need to make sure that the editor is made visible before any other Documents are created (so the offscreen, "un-anchored" editor isn't cleaned up by |
Reviewed - here's our suggested plan:
|
Reviewed -- removing 1.0 milestone. Although it's ugly, it does still work reliably... and a fix may be somewhat tricky (and ideally we'd spend some effort just trying to make it faster, too). |
Dialogs.showModalDialog()
Result: the first time you do this, you'll see Dialogs.js open scrolled to the top of the file, and then after a short pause it will jump to the actual definition.
The text was updated successfully, but these errors were encountered: