-
Notifications
You must be signed in to change notification settings - Fork 758
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
Scide/autocomplete help #1333
Scide/autocomplete help #1333
Conversation
There is no intends to modify the file name. It can be set const. The aim of this patch is to prepare the scdoc support into scide.
This patch allows scide to call scdoc functions such as scdoc_parse_file(). It adds a scdoc_log.cpp file to implement error() and post() functions needed by scdoc. The aim of this patch is to prepare the autocompleter help: the display of additionnal help (description, summary, examples) when completing classes.
This patch switch the CompletionMenu class from the autocompleter.cpp file to its own files in order to set it as a Q_OBJECT and use its own signals. This patch also registers the completion_menu.hpp file into the ide_moc_hdr list. The aim of this patch is to prepare the autocompleter help: the display of additionnal help (description, summary, examples) when completing classes.
This patch allows the scide autocompleter to use scdoc to look for informations such as classes description or summary. The aim of this patch is to prepare the autocompleter help: the display of additionnal help (description, summary, examples) when completing classes.
This patch allows completion_menu to display additional infos at the right of the completion list. The aim of this patch is to prepare the autocompleter help: the display of additionnal help (description, summary, examples) when completing classes.
This patch allows scide to display additionnal help during class autocomplete: - class summary - class description - class examples
This is great @vdonnefort! A few thoughts:
I've been thinking about this sort of application ever since we first started discussing scdoc! Thanks!! |
Hi @muellmusik, Thank you for your review.
|
This is cool, but it might get in the way of people who want to write quickly, so I also think it should be optional. |
If this introduces any lag, it could be solved by displaying the autocomplete window containing completion suggestions immediately, and load the help text into the window when it becomes available (waiting for it asynchronously, without blocking the main thread). |
The adapt() function allows to resize the item list according to the widest. It remplaces the call of the resize at each addItem() which can lead to a small lag.
This option allows to activate or not additional infos displayed by the completion menu.
I've just added:
@muellmusik, can you tell me more about "formating"? Does anyone has comments about my coding choices? |
Nice! |
…wser The QTextBrowser class adds support for hypertext navigation.
This signal is emitted when a clickable information (mostly an HTML anchor) has been clicked.
This patch adds a link at the end of additional infos displayed with completion menu. This link opens the related page into the help browser.
I've just added:
Open points left:
|
Sorry for slow reply, I've been travelling. I mean a little more rendering of the structure, etc. If you look for instance at OSCdef, the note::...:: is presented as the same paragraph as the description, with no space between. Indeed, paragraph breaks seem not to be respected at all. Server looks pretty bad because of this. Similarly, subheadings in the description are not rendered, and just get squished in. Links are presented with the scdoc syntax instead of the link text. I think this makes it look a little unpolished and needs fixing before it should go in a release. |
This patch allows the autocompleter to translate NOTE and LINK IDs into HTML. It improves the autocompleter help rendering during class completion.
@muellmusik This problem is fixed by the last commit. |
Thanks, but I just looked, and not entirely. Subsections are still squished without spacing or formating. Anchor links within the same doc show up with scdoc syntax. You can see this with Server help. code:: tags are also ignored. This is a great feature though, and thanks for all the work! |
This patch fixes the string comparison introduced by: scide: autocompleter: interpret SCDoc "NOTE" and "LINK" IDs
This patch allows the autocompleter to translate CODE and CODEBLOCK IDs into HTML. It improves the autocompleter help rendering during class completion.
This patch allows the autocompleter to deal with local links (#) when parsing SCDoc.
@muellmusik Fixed! Once again, thank you for testing! |
Okay, looks very good now! Two minor things for the future:
But I'm very happy to merge this as is. |
This patch removes the "Example" title if there is no example available into SCDoc for autocomplete help.
@muellmusik I fixed the Examples title. I have however no clue for syntax colourising for now |
Formatting and links are very nice! But now I get this issue: The links to help seem to open a help-page based on the assumption that the/a help-pane is already open (and visible). If that is not the case, indexing help is triggered but no page opens. Also if the help pane is in the background (detached and possibly covered by other windows) - the correct help-page will be loaded, but the pane does not come to the foreground. |
This patch allows to force the help dock to be displayed when clicking on a help link.
@bagong, it must be fixed. The last patch force the help dock to focus. Thanks for report |
Sorry, this changes nothing for me. Does it work for you, did you try it out? There are two issues:
Maybe unrelated but worth a mention: it used to be possible to switch between main window and detached help window (and post Window) by pressing the |
@bagong, check if you applied correctly the patch on your side because on mine, |
Yea, the commit is in the log... Are you on Qt4? I just looked a bit into the new Quarks system and there the same phenomenon: you press a button to open a specific scdoc page and it works if the help pane is open but it does nothing, if it is closed. It also does not bring the help window to the foreground if it is covered by other windows. |
@bagong, I'm using Qt4.8. I tested it on OSX 10.9 and Ubuntu 14.10 |
Well, then it is likely a quite general Qt5 issue. Would be nice if somebody else on Qt5 compared. Should I file an issue? Btw, why don't you switch to latest master? Would make sense as your stuff will be committed to a SC version that can only work with Qt5. |
@bagong I don't think so, it's working on my side using Qt5. |
This patch lets the completion_menu use show() and hide() functions instead of a null size to display or not the additional infos. This allows to have a better looking completion_menu when there is no additional infos.
I am not sure why :), but now it works as expected for me here. Help window comes to front in all cases! (not in Quarks though) |
Shall we merge then? |
Just saw that it conflicts with @scztt 's branch topic/ui-refresh in the autocompleter. Maybe wait for him to comment? |
@bagong - don't worry about it. that branch is a ways from being mergable, and in any case merging the autocompleter changes from that is easy. 👍 to merge. |
Actually - merge now, I'm going to mark 3.7-alpha0 in a bit, and it would be good to have this in for feedback :) |
Just found another issue: help files from locations integrated via LangConfig are not found. This used to be the case for general scdoc too, but has been fixed here: c48d5d6 Is this the right place to report this, or should I file a general issue as this is in master now? |
…ete-help Scide/autocomplete help
Here's a new feature for scide. This PR adds help informations about selected class when showing autocomplete menu.