Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [flux-dev] QuickFix prototype in Github

Hi Martin,

Right now, this is how it's done:

On request for applying a particular proposal, the JDT service simply asks the proposal for the preview content and replace the current document's content. After this, the service sends a "liveResourceChanged" message back to the editor. Here is some bits of relevant code:

String preview = proposal.getPreviewContent();
...
document.addDocumentListener(this.documentListener);
document.replace(0, preview.length(), preview);
...
responseMessage.put("offset", this.documentListener.event.getOffset());
responseMessage.put("removedCharCount", this.documentListener.event.getLength());
responseMessage.put("addedCharacters", this.documentListener.event.getText());
this.messagingConnector.send("liveResourceChanged", responseMessage);

Replacing the whole content is definitely not ideal. The JDT/UI code that updates the document (in the IDE) seems to be tied closely to some UI elements. But I believe there's still a way to compute this, but I haven't gotten there yet.

Regards,
Jay



From:        Martin Lippert <mlippert@xxxxxxxxx>
To:        Flux developer discussions <flux-dev@xxxxxxxxxxx>
Date:        11/05/2014 01:16 AM
Subject:        Re: [flux-dev] QuickFix prototype in Github
Sent by:        flux-dev-bounces@xxxxxxxxxxx




Hey Jay,

this is awesome. Haven’t looked at the code yet, but I am curious to learn how you are doing the file rewrite. Wanna share and discuss details here?

Cheers,
-Martin

>
> Hello,
>
> I have pushed a first cut prototype of a quickfix prototype here:
https://github.com/jarthana/flux
>
> Even for a prototype, this is in initial stage and I have added only the JDT side of things. Just so people can try out this feature, I have put some stuff in the embeddededitor.js.
>
> Currently the way the feature can be used is:
>
> 1. Keep the cursor at the problem location and press F6 - this will display the suggested quick fixes as bullet list in a hover.
> 2. Keep the cursor at the problem location and press Ctrl + F6 - This will compute the quick fixes and apply the first quick fix automatically and rewrite the file being edited.
>
> The way I see the above use cases being integrated eventually: The quick fix service will cache the last quick fixes it sent to the editor in user session. The quick fixes are recognized by an ID, which will be sent back to the JDT service when the user selects one of them in the editor. Upon receiving confirmation, the fix will be applied.
>
> I have also put up a demo of the prototype here:
http://youtu.be/DfQTuX2Kd8c
>
> Regards,
> Jay
> _______________________________________________
> flux-dev mailing list
> flux-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>
https://dev.eclipse.org/mailman/listinfo/flux-dev

_______________________________________________
flux-dev mailing list
flux-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/flux-dev

Back to the top