Skip to content
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

Hover framework & refactoring #39

Closed
wants to merge 5 commits into from
Closed

Hover framework & refactoring #39

wants to merge 5 commits into from

Conversation

arichiardi
Copy link
Contributor

Finally, the following is the hover framefork, plus some refactoring that helped me to solve a couple of problems with my hovers and I am sure will enhance CCW modularity. This feature adds the ability of contributing and configuring ITextHover* instances to Counterclockwise.
The extension point is ccw.core.cljEditorTextHovers whereas the schema (a cousin of Jdt's) is
contained in schema/cljEditorTextHovers.exsd. Moreover, I basically created a layer of mixins for IClojureEditor and (the new) IClojureSourceViewer.

From the first to the last, I will list the comments, highlighting the most important commits:

refactor(ccw.core): Add some preference function that was around back to eclipse.clj
feat(ccw.core): add pluggable ITextHover, configurable through their preference page*
refactoring(ccw.core): Split IClojureEditor in IClojureAwarePart, IReplAwarePart, IClojurePart
feat(ccw.core-hovers): added support for ITextHoverExtension2 to docstring_hover
refactor(ccw.core-repl): promote getSafeToolingConnection to IReplAwarePart

I refactored on my taste, but of course I am available for any discussion on the topic 👍
I hope I have decently cleaned up my patches.

-ar

… to eclipse.clj

This patch puts all the preference-related fns in eclipse.clj, refactoring the affected files. It
also fixes a potential NPE in NamespaceBrowser.java.

Renames the nrepl autostart property in StaticStrings (new name is ccw.nrepl.autostart added to the
launchers as well).
… preference page

This feature adds the ability of contributing and configuring ITextHover* instances to
Counterclockwise.
The extension point is ccw.core.cljEditorTextHovers whereas the schema (a cousin of Jdt's) is
contained in schema/cljEditorTextHovers.exsd. The big difference is that a ITextHover instance can
be returned by Clojure functions leveraging ccw.util.GenericExecutableExtension (see plugin.xml for
an example).
This patch also adds a reactive preference page where the user can enable, disable or change the
hover modifier. It has been rewritten from scratch using the Eclipse's databinding framework,
solving a couple of annoying bugs of the Jdt one. The page follows the MVVM pattern and needs
injection of the HoverModel. In order to achieve that, a custom IEclipseContext has been created and
stored in CCWPlugin together with init/clean functions.

The hover framework traces using "support/hover".
…plAwarePart, IClojurePart

Totally redesigned the abstractions of Counterclockwise. Now IClojureAwarePart, IReplAwarePart,
IClojurePart are the mixin-like abstractions and they compose to build IClojureEditor and
IClojureSourceViewer.

All the clients of IClojureEditor have been refactored, both in .java and .clj files.
…tring_hover

Adds ITextHoverExtension2 and getHoverInfo2 for Docstring reified instances.

The old getHoverInfo has been deprecated and always returns null.
…rePart

The getSafeToolingConnection is now part of the interface IReplAwarePart and some code in
ClojureEditor has been refactored in order to always delegate IReplAwarePart.getCorrespondingREPL
and IReplAwarePart.getSafeToolingConnection to the SourceViewer instance.

The base implementation of both methods return null.
@arichiardi arichiardi closed this Feb 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant