After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706535 - gtksourceview should place highlighted completion proposal as temporary text in editor
gtksourceview should place highlighted completion proposal as temporary text ...
Status: RESOLVED WONTFIX
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-21 20:18 UTC by Christian Hergert
Modified: 2018-05-26 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
image showing example (327.03 KB, image/png)
2013-08-21 20:19 UTC, Christian Hergert
Details

Description Christian Hergert 2013-08-21 20:18:08 UTC
Currently, there is not the requirement of a one-to-one mapping of the text you see in a completioninfo window and the text that will be inserted into the sourcebuffer. This is good, especially as the complexity of completions is raised.

However, it would be very handy to show the potential completion text in a much lighter color after the cursor and keep it updated as the user continues to complete the proposal.

I've attached an example of what I mean.
Comment 1 Christian Hergert 2013-08-21 20:19:01 UTC
Created attachment 252666 [details]
image showing example
Comment 2 Christian Hergert 2013-08-22 03:50:15 UTC
So after thinking about this a bit more, I think what we want instead of "display the potential entry text", is two-fold:

 1) A hook when the proposal changes so that text can be inserted after the cursor and ability to remove it, with ability to add gtktexttags.
 2) A callback to perform the insertion of text instead of the default proposal text.

#2 will allow us to display completion text with various gtktexttag's applied for aesthetic purposes, but then move into a snippet system upon completion (so that we can tab through parameters and complete them too).
Comment 3 Paolo Borelli 2013-08-22 06:42:51 UTC
From an aesthetic point of view I like this. And as we briefly discussed we could even use it to show the common prefix among all available proposals.

I guess we could add an _insert_placeholder_text or something like that to the provider interface and a _get_placeholder_text to the proposal interface (or something like that but more complex in order to handle tags)

Note that we need to be very careful though to not mess with the undo stack.

I also wonder what happens when you are near to the end of the line. I do not think it would make much sense for the temporary text to wrap to the next line...
Comment 4 Christian Hergert 2013-08-22 19:33:17 UTC
(In reply to comment #3)
> Note that we need to be very careful though to not mess with the undo stack.

This sounds tricky, but we have control over the undo/redo stack right?

> I also wonder what happens when you are near to the end of the line. I do not
> think it would make much sense for the temporary text to wrap to the next
> line...

I can see line-wrapping being common for general text, but is it really that common with programming languages? (Is it strange that I turn of wrapping?)
Comment 5 Sébastien Wilmet 2018-05-26 13:52:05 UTC
There will be a new completion system in gnome-builder. So I close this bug.