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

[Doc Gen] CTRL+CLICK doesnt go to script documentation #52892

Open
nonunknown opened this issue Sep 21, 2021 · 7 comments
Open

[Doc Gen] CTRL+CLICK doesnt go to script documentation #52892

nonunknown opened this issue Sep 21, 2021 · 7 comments

Comments

@nonunknown
Copy link
Contributor

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:

doc

Steps to reproduce

Shown above

Minimal reproduction project

N/a

@KoBeWi KoBeWi added this to the 4.0 milestone Sep 22, 2021
@rxlecky
Copy link
Contributor

rxlecky commented Sep 30, 2021

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?

@Calinou
Copy link
Member

Calinou commented Sep 30, 2021

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?

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.

@rxlecky
Copy link
Contributor

rxlecky commented Sep 30, 2021

Hmm, I was afraid there might not be any suitable free mouse shortcut... Maybe we could use keyboard shortcuts instead then?

@LeaoLuciano
Copy link
Contributor

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.

Why not Ctrl - Shift - click?

@nonunknown
Copy link
Contributor Author

if the default scripts works with CTRL + click, why not the custom ones!

@ClarkThyLord
Copy link
Contributor

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:

Screenshot (10)

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.

@L4Vo5
Copy link
Contributor

L4Vo5 commented Sep 19, 2023

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.
Someone looking for documentation would be two clicks away instead of one, but there'd be no need to come up with new shortcuts to jump to the script source (a feature that I personally use, more often than I would use the documentation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants