Community
Participate
Working Groups
When a word is double-clicked, the word selection selects tokens over the word under the cursor. For instance with "local var = foo.ba[]r.baz(1,2,3)" ([] is the caret), a double click would select "foo.bar.baz" but it shold select only "bar".
A little precision: my first example is wrong, the tokens separated by dots are correctly selected. This is actually the colon which makes wrong selection, so the wrong example is "local var = foo.ba[]r:baz(1,2,3)" ([] is the caret) will select the whole "foo.bar:baz".
I have a simple example: foo:bar() I double-click on foo, foo:bar is selected.
Attaching a Mylyn context. Behavior on double-click happens in LuaSourceViewerConfiguration (need to override SourceViewerConfiguration#getDoubleClickStrategy(ISourceViewer, String))
Created attachment 209704 [details] mylyn/context/zip
(In reply to comment #3) > Attaching a Mylyn context. > Behavior on double-click happens in LuaSourceViewerConfiguration (need to > override SourceViewerConfiguration#getDoubleClickStrategy(ISourceViewer, > String)) Thanks for the info, I will work on this.
Created attachment 210544 [details] Double click detector patch This patch adds a double click detector. It is inspired by DLTK and CDT but has a slight modification that makes it behave closer to JDT. If double click is done on the right of the word, the word is not selected. I split the test plugin in a separate zip because I had troubles making a patch that would apply with all the changes.
Created attachment 210545 [details] Editor test plugin
Thanks a lot Marc-André! I'll try to review the patch this week, but it looks great (and from the few smoke tests I performed, it works great too :-)). FWIW, this contribution will need a CQ since it is slightly bigger than 250 lines, but I think this won't take too long...
Marc-André, the patch looks great! Could you please try to provide a patch which contains both the fix and the tests? I have had no peculiar issues squashing the two patches into one single commit ; let me know if I can help. Also, can you please double-check the license headers in the files you either modified or created? - LuaWordFinder: the first line should be "Copyright (c) 2012 Marc-Andre Laperle and others." - org.eclipse.koneki.ldt.editor.tests#Activator should also have a copyright header similar to LuaWordFinderTest (even though that's probably arguable), and you may want to remove the "@author Kevin KIN-FOO <kkinfoo@anyware-tech.com>" mention too (as well as the "// TODO: Auto-generated Javadoc" by the way!) - same remarks for org.eclipse.koneki.ldt.editor.tests#Suite Alsom can you then please confirm in a comment that: (a) you wrote 100% of the code or reused EPL code from ecipse.org (b) you have the right to contribute the code to Eclipse Thanks so much!
(In reply to comment #9) > Also, can you please double-check the license headers in the files you either > modified or created? > - LuaWordFinder: the first line should be "Copyright (c) 2012 Marc-Andre > Laperle and others." Even though IBM wrote the initial implementation? I really just copied the file and Refactored/Extracted a couple of methods. I thought when copying a file like that, the initial copyright owner should be kept (at least that's what I've seen when working on CDT) but the text is not very clear on that IMO: "{INITIAL COPYRIGHT OWNER} is the copyright owner that created the initial content. If the content is subsequently modified and appended to by other copyright owners, the words "and others" are typically appended." http://www.eclipse.org/legal/copyrightandlicensenotice.php > - org.eclipse.koneki.ldt.editor.tests#Activator should also have a copyright > header similar to LuaWordFinderTest (even though that's probably arguable), I left the copyrights since those files are basically just renamed versions of other ldt tests files but I can change them. > you may want to remove the "@author Kevin KIN-FOO > <kkinfoo@anyware-tech.com>" mention too (as well as the "// TODO: > Auto-generated Javadoc" by the way!) Will do! > Also can you then please confirm in a comment that: > (a) you wrote 100% of the code or reused EPL code from ecipse.org > (b) you have the right to contribute the code to Eclipse a) I wrote 100% of the code and reused EPL code from eclipse.org b) I have the right to contribute code to Eclipse. (I'm a committer on CDT BTW)
I tend to agreed with your remarks Marc-André, and I think that will do! If you can provide an updated single patch, with the few TODOs removed, I'll open the CQ. I am not sure it can make it for Juno, but I really do hope so though... (you may not have seen that, but we are trying to join the Juno train).
Created attachment 211465 [details] Double click detector including tests Generated with git format-patch.
Thanks! I opened https://dev.eclipse.org/ipzilla/show_bug.cgi?id=6280
Thank you again Marc-André, your patch made it to master... at last! (commit aee5d8b). Marking as FIXED.