Community
Participate
Working Groups
When triggering snipmatch behind a dot as in the snippet below, the selected template is not applied (tested with junit template). void zip() throws Exception { ZipFile file = new ZipFile(new File("")); file.|<snipmatch> }
This behavior is known. A snippet/or template cannot be applied at this position by either snipmatch or the template completion. To inform the user about this, the preview windows starts with a message: // XXX Cannot apply snippet at cursor position // FIXME Reposition cursor
Okay, i read the comment but didn't get it :) Maybe the comment should be rewritten for dump users like me?
(In reply to Marcel Bruch from comment #2) > Okay, i read the comment but didn't get it :) > Maybe the comment should be rewritten for dump users like me? Maybe a stronger indication is needed? What about a light red background instead of the "Javadoc yellow" for the popup whenever the proposal cannot be applied (+ the comment that explains what's going on)? Anyway, postponing this for 2.2. What's the best UX needs some more discussion.
(In reply to Andreas Sewe from comment #3) > (In reply to Marcel Bruch from comment #2) > > Okay, i read the comment but didn't get it :) > > Maybe the comment should be rewritten for dump users like me? > > Maybe a stronger indication is needed? What about a light red background > instead of the "Javadoc yellow" for the popup whenever the proposal cannot > be applied (+ the comment that explains what's going on)? > > Anyway, postponing this for 2.2. What's the best UX needs some more > discussion. The behavior in comment 0 has changed in the meantime. Right now we don't display snippets that cannot be evaluated at all at a position like file.<snipmatch> Now, this is also not ideal, as the user might have entered search terms that do return results; they just cannot be inserted at the current position. I think the best UX would be to add a pseudo-proposal (possibly with a different coloring) to the list of results (at the bottom) stating 42 snippets matched your query but cannot be inserted at the current cursor position. Please reposition your cursor and try again. @Yasett: It would be great if you could give this a try. I suggest starting with a breakpoint in SnippetProposal.isValid() so you can get a feel when a proposals validity is checked.
(In reply to Andreas Sewe from comment #4) > @Yasett: It would be great if you could give this a try. I suggest starting > with a breakpoint in SnippetProposal.isValid() so you can get a feel when a > proposals validity is checked. Hi, I have been reading the source code of the completion engine, to get a better understanding of how proposals are computed, displayed and validated. I attached a screenshot of what I have in mind at this point. Any thoughts on it?
Created attachment 260859 [details] Warning displayed when the cursor position does not permit to insert snippets.
(In reply to Yasett Acurana from comment #5) > (In reply to Andreas Sewe from comment #4) > > @Yasett: It would be great if you could give this a try. I suggest starting > > with a breakpoint in SnippetProposal.isValid() so you can get a feel when a > > proposals validity is checked. > > Hi, > > I have been reading the source code of the completion engine, to get a > better understanding of how proposals are computed, displayed and validated. > > I attached a screenshot of what I have in mind at this point. Any thoughts > on it? That looks great. I don't think you can implement it exactly as shown, as your warning cannot be a multi-line string. That being said, a single-line warning like 8 more matches cannot be inserted at cursor position with a longer tooltip to fully explain the sitatuon would work great. BTW, that tooltip should not use a monospace code font, but look more like the "Code Recommenders is enabled" proposal's tooltip.
I agree, this looks very nice. Since a multiline proposal isn't possible, i would very much like to see this suggestion implemented with the modifications outlined by Andreas. @Yasett: Would you like to to implement that solution?
Created attachment 261259 [details] Demo of pseudopropsal with warning
(In reply to Johannes Dorn from comment #8) > I agree, this looks very nice. Since a multiline proposal isn't possible, i > would very much like to see this suggestion implemented with the > modifications outlined by Andreas. > > @Yasett: Would you like to to implement that solution? Hi :) I've been working on this, I just attached a screenshot of how it looks now. I am testing the solution and will submit a patchset as soon as I finish.
(In reply to Yasett Acurana from comment #10) > (In reply to Johannes Dorn from comment #8) > > I agree, this looks very nice. Since a multiline proposal isn't possible, i > > would very much like to see this suggestion implemented with the > > modifications outlined by Andreas. > > > > @Yasett: Would you like to to implement that solution? > > Hi :) > > I've been working on this, I just attached a screenshot of how it looks now. Looks very nice. > I am testing the solution and will submit a patchset as soon as I finish. Looking forward to it. Shall I set the target milestone to 2.3.2? ;-)
New Gerrit change created: https://git.eclipse.org/r/71650
(In reply to Eclipse Genie from comment #12) > New Gerrit change created: https://git.eclipse.org/r/71650 That change does not only add an error message but also changes behavior. We need to discuss this (in Gerrit).