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
[Doc Gen] CTRL+CLICK doesnt go to script documentation #52892
Comments
This is not a bug, it's an intentional behaviour. When CTRL-clicking a player-defined class, you are taken to the class source code instead of the documentation page. However, you don't notice this in the example shown in the GIF, since you already have that source file open so it appears that nothing happens. Now, whether this should be changed to be made consistent with the built-in classes and make CTRL-click take you to the documentation page is another question. In my opinion, for short scripts (which are the majority in my case), you get the same (and probably more) information from looking at the script itself as you do from looking at the generated documentation - and that is assuming that members are properly documented, which is, let's be honest, rarely the case. The added bonus is that you can start editing the script immediately, which is often what you want to do. So my take is that going to source as the default action is fine. But maybe for consistency, we should change the CTRL-click to go to docs for all classes and add a different shortcut for going to source for custom classes? Thoughts @Calinou? |
Sounds like a good idea to me, but I'm not sure what to use for going to the source as a shortcut. Alt-clicking is finicky because most Linux window managers will capture it by default. Shift is already used to perform text selection when clicking, so that would conflict too. |
Hmm, I was afraid there might not be any suitable free mouse shortcut... Maybe we could use keyboard shortcuts instead then? |
Why not Ctrl - Shift - click? |
if the default scripts works with CTRL + click, why not the custom ones! |
I was just going to make an issue for this specific use-case, as I frequently use the "Go to definition" shortcut on the extended class to access documentation without having to search it. But seeing as there is already a discussion here I'll leave my 2-cents here, and say that the "Go to definition" shortcut should also go to documentation for custom classes, as it's best for consistency 👍 Of course, there is the case that custom classes might not have documentation for their custom properties / methods. For which, going to its documentation might just provide the "There is currently no description for this property." text and no further insight. For this case, I propose that the "Go to definition" shortcut checks whether there is documentation for this property / method if so go to it, and if not go to source. Although this would still leave some inconsistency. Which is why it might be better to make it so that whenever custom class documentation is generated it checks if there's documentation for custom properties / methods, if there isn't then a link that takes you to the source is attached, something like what’s seen below: This way "Go to definition" is always consistent in taking you to the documentation and you'd be able to jump to source by clicking the link if no documentation is present. |
Maybe there could be an exception that takes you to the class documentation only when ctrl+clicking the class name next to class_name, takes you to variable/signal/function documentation only on the line they're declared, etc. |
Godot version
v4.0.dev.20210916.official [104a619]
System information
manjaro Gnome 21, AMD R7 200 series, Intel i3 3.0 GHZ,8GB RAM
Issue description
When you click on a godot class with CTRL holded, you go to its documentation, which is not true for the custom classes:
Steps to reproduce
Shown above
Minimal reproduction project
N/a
The text was updated successfully, but these errors were encountered: