Skip to content

Commit

Permalink
reload clojure in target eclipse
Browse files Browse the repository at this point in the history
  • Loading branch information
miaubiz committed Feb 27, 2010
1 parent 5b555b0 commit e1382c9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ccw.core/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ GoTo_matchingBracket_label=Matching Bracket
GoTo_previousTopLevelSexpr_label=Previous Top Level S-Expression
GoTo_nextTopLevelSexpr_label=Next Top Level S-Expression

clojureHyperlinkDetector=Clojure hyperlink detector
clojureHyperlinkDetector=Clojure hyperlink detector

command.reload.clojure.name=Reload clojure code
command.reload.clojure.description=Reload clojure code
14 changes: 14 additions & 0 deletions ccw.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@
id="ccw.ui.edit.text.clojure.format.code">
</command>

<command
name="%command.reload.clojure.name"
description="%command.reload.clojure.description"
categoryId="org.eclipse.ui.category.navigate"
id="ccw.ui.edit.text.clojure.reload">
</command>


<command
name="%command.navigateToDefinition.name"
description="%command.navigateToDefinition.description"
Expand Down Expand Up @@ -349,6 +357,12 @@
contextId="ccw.ui.clojureEditorScope"
commandId="ccw.ui.edit.text.clojure.format.code"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>

<key
sequence="M1+R"
contextId="ccw.ui.clojureEditorScope"
commandId="ccw.ui.edit.text.clojure.reload"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>

<key
sequence="F3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ protected void createActions() {
setAction(CompileLibAction.ID, action);
action = new FormatAction(this);
action.setActionDefinitionId(IClojureEditorActionDefinitionIds.FORMAT_CODE);
setAction(FormatAction.ID, action);
setAction(FormatAction.ID, action);
action = new reload_clojure();
action.setActionDefinitionId(IClojureEditorActionDefinitionIds.RELOAD_CLOJURE);
setAction("reload_clojure", action);
action = new OpenDeclarationAction(this);
action.setActionDefinitionId(IClojureEditorActionDefinitionIds.OPEN_DECLARATION);
setAction(OpenDeclarationAction.ID, action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ Tests_passed=Tests passed
Tests_failed=Tests failed
Compilation_failed=Compilation failed
FormatAction_label=Format code

Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ public interface IClojureEditorActionDefinitionIds extends ITextEditorActionDefi
public static final String HIGHLIGHT_SAME_WORD = "ccw.ui.edit.text.clojure.highlight.same.word";
public static final String RUN_TESTS = "ccw.ui.edit.text.clojure.run.tests";
public static final String OPEN_DECLARATION = "ccw.ui.edit.text.clojure.open.declaration";
public static final String RELOAD_CLOJURE = "ccw.ui.edit.text.clojure.reload";
}
16 changes: 16 additions & 0 deletions ccw.core/src/ccw/editors/antlrbased/reload_clojure.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(ns ccw.editors.antlrbased.reload-clojure
(:gen-class
:init init
:state state
:extends org.eclipse.jface.action.Action))

(defn -init [])

(defn -run [this]
(require :reload '(ccw.editors.antlrbased
[reload-clojure]
[ClojureFormat]
[StacktraceHyperlink]
[PareditAutoEditStrategy])))


0 comments on commit e1382c9

Please sign in to comment.