Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6646] Jump-to-definition jumps only to first line of generated interface instead of to the declaration #49195

Open
jepers opened this issue Dec 19, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@jepers
Copy link

jepers commented Dec 19, 2017

Previous ID SR-6646
Radar None
Original Reporter @jepers
Type Bug

Attachment: Download

Environment

Xcode 9.2, macOS 10.13.2 (17C88)

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: 14304dd6e682f4aeafb0ec2f8e842fc8

Issue Description:

See attached source kit log and screen recording (sorry about the low video quality, had to bc 10 MB limit).

Steps to reproduce:

  1. Start a new Command Line App project in Xcode 9.2
  2. Jump to definition on the `print` in main.swift.
  3. Select a different toolchain (some recent dev snapshot)
  4. Jump to definition on `print` again.

If the issue reproduces, it will only jump to the top of the generated interface, and not to the definition of `print`, as can be seen in the attached screen recording.

About step 3: While creating the attached log, I noticed that it worked/jumped to definition as expected until I selected a different toolchain (any recent snapshot). The issue then persisted even if I reselected the default Xcode 9.2 toolchain.

So it seems like it might be necessary to select another toolchain in order to trigger the issue. (I never install the symbols part of the dev snapshots, don't know if that is of interest or not.)

@benlangmuir
Copy link
Member

Thanks for the report!

This looks similar to an issue I saw recently, but in my case there were no toolchain changes involved. Can you try jumping to some other symbol, hit back, then try jumping to print again? That seems to clear it up temporarily for me. I'm still looking into what's going on here.

@jepers
Copy link
Author

jepers commented Dec 20, 2017

I've tried writing some code and jumping to definition for various symbols, without any toolchain changes, only using default 9.2 toolchain.

I'd say it works as expected about 80% of the time, but sometimes it just takes me to the first line of the generated interface. Hitting back and jumping to another symbol will sometimes clear it up. But I can't find a reliable way to reproduce it.

However, IF i change to a recent dev snapshot toolchain, it definitely will reproduce the issue (as described in the report, also note that there is no cursor in the generated interface), and the only way to clear it up seems to be to switch back to default 9.2 toolchain and try jumping to other symbols for a while (found no reliable way to do this repeatably though).

I mostly use a recent snapshot, and my feeling is that jump to definition never works (for eg Swift symbols, where the destination is in a generated interface). While reporting the issue I figured I should use the Xcode 9.2 default toolchain (which I almost never do) and then I noticed that it worked about 80% of the time, which is an improvement over what I'm used to. Switching back to a recent snapshot will make it mostly not work again.

I'm afraid I cannot describe the issue more clearly, it seems to be very random.

If you want me to make another log where the issue happens without any toolchain changes, I can do that (probably both using the 9.2 default toolchain and using a recent snapshot).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants