Skip to content

Jump to the entry point line when viewing or editing a shader#3771

Closed
qwmnerbvqwmn wants to merge 1 commit intobaldurk:v1.xfrom
qwmnerbvqwmn:pr/jump-to-entry-point
Closed

Jump to the entry point line when viewing or editing a shader#3771
qwmnerbvqwmn wants to merge 1 commit intobaldurk:v1.xfrom
qwmnerbvqwmn:pr/jump-to-entry-point

Conversation

@qwmnerbvqwmn
Copy link

Description

Improves UX by automatically scrolling the shader editor to the line where the entry point function is defined when a user opens a shader for viewing or editing.

@qwmnerbvqwmn qwmnerbvqwmn force-pushed the pr/jump-to-entry-point branch from ab02918 to 2b8c64c Compare January 16, 2026 19:25
@qwmnerbvqwmn qwmnerbvqwmn force-pushed the pr/jump-to-entry-point branch from 2b8c64c to 77e7714 Compare January 16, 2026 21:22
@baldurk
Copy link
Owner

baldurk commented Jan 28, 2026

I do not want to make this change. This is too complicated and error prone and the code that's already there does the most reliable thing it can. This is making the big assumption that the entry point name is unique enough to only show up in one place which may be true for some shaders but definitely isn't true in the general case.

The existing code already uses the debug info to scroll to the entry point where available, since that is verifiable and always correct. Doing text-searches for the entry point string and scrolling is not reliable enough for me to be happy doing that as a very common entry point name is going to be main which could appear in many places in the shader source.

@baldurk baldurk closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants