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

Improve editor autocomplete #23188

Closed
voithos opened this issue Oct 21, 2018 · 2 comments
Closed

Improve editor autocomplete #23188

voithos opened this issue Oct 21, 2018 · 2 comments

Comments

@voithos
Copy link
Contributor

voithos commented Oct 21, 2018

Currently, as far as I am aware, the built-in editor's autocomplete functionality mostly just consists of completing symbol names (variables and functions, etc), but doesn't include other relevant information. It would be very useful if it was extended in a few ways (apologies if any of these are already possible):

  • Include additional documentation information, such as e.g. method comments
  • Include types for typed GDScript
  • Have some kind of indicator / icon for completed symbol types (variable, method, etc)

For inspiration, here is how VSCode currently does this; by default, it shows the name, symbol type (with icon), and part of the signature, but shows more extensive information (including doc comments) when Ctrl+Space is pressed.

Normal autocomplete:
screenshot from 2018-10-20 22-47-20

Info-dense mode:
screenshot from 2018-10-20 22-47-43

@willnationsdev
Copy link
Contributor

willnationsdev commented Mar 10, 2019

So, I think we'd have to consider all the details about what this actually goes into.

In untyped GDScript, I would expect to see...

  1. whether "forRoot" (in this example) is a property, constant, or method.
  2. If it is a constant, what type it is
  3. If it is a method, the names of each of its parameters
    • if the script defining it uses class_name, then also display that name to reveal which script defines the method (if not local to the current script, but is in fact inherited).

If typed GDScript, then I would expect all of the above, but also:

  1. Show the types of properties, not just constants
  2. Show the types of method parameters, not just their names.
  3. Also show the return types of methods.

Maybe also highlight the current parameter in a parameter list the cursor is on.

For content in the "detailed" view shown above, we'd have to wait and rely on #20318 to allow scripts to bind this additional information to the script itself. I don't know if annotations are intended to be a GDScript-only or Script-wide feature, but we'd only get autocompletion for a foreign language's types if annotations were passed through the scripting API.

Something else necessary to ensure that checking this information doesn't involve torture would be to add [the issue where people want an option for the GDScript parser not to run unless the user is at the start of a new line] (forgot the ID number and can't relocate the Issue). If people suddenly stop typing to look at the autocompletion-generated GUI, then they won't want the editor to spam them about there being parse errors since they aren't finished typing.

Any other ideas?

@Calinou
Copy link
Member

Calinou commented Mar 16, 2020

Closing in favor of godotengine/godot-proposals#408, as type icons are now displayed next to suggestions since 3.2.

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

3 participants