sublimehq/sublime_text

Regression: Goto Definition no longer prioritizes symbols in same file

Closed this issue · 2 comments

Description of the bug

This is a regression of something that was fixed in this issue: #14

367510362-a16ce6b1-08dd-4064-9b93-dc97ae5344c4
In the picture above I try go to symbol consume_comment while editing src/parser.cpp. There is a consume_comment symbol in that file. I put my cursor on a usage of consume_comment within src/parser.cpp and press F12 (Goto Definition). It then shows core/parser.cpp as first symbol hit, i.e. the not the current file. core/parser.cpp is some other file that also had a symbol with the same name.

Steps to reproduce

  • Unzip this file: goto_symbol_repro.zip
  • Open new sublime window, drag in goto_symbol_repro folder
  • Go into src/parser.cpp
  • Put cursor on consume_comment on line consume_comment();
  • Press F12
  • It shows the file core/parser.cpp at the top even though there is a consume_comment in the current file src/parser.cpp. This is wrong and was fixed in this issue #14

Expected behavior

When you press F12 while caret is on a symbol and there exists such as symbol in the currently open file, then the symbol in the currently open file is prioritized by ending up at the top of the list of symbol hits.

Actual behavior

The list seems to be sorted alphabetically, you are likely to end up with a symbol in some other file at the top of the list of symbol hits.

Sublime Text build number

4180

Operating system & version

Windows 10

(Linux) Desktop environment and/or window manager

No response

Additional information

I tried using two different file names in the repro, instead of naming both files parser.cpp. That doesn't change anything, it still always shows the file in core before the one in src.

Extra info from @deathaxe that they wrote on the original issue (#14)

It is a regression in more recent builds between 4152 and 4169.

It is working as expected in ST4126 ... 4152 but no longer in 4169+.

So that's a new issue.

I.e. a temporary work around to fix this is to downgrade to version 4152.

OpenGL context information

No response

Fixed in build 4181.

Thank you. Tried the dev 4181 build, works like a charm!