Giter VIP home page Giter VIP logo

la-clojure's Introduction

obsolete JetBrains project

Project state

The project is closed because of Cursive Clojure, which is more stable and feature-rich and it was originally based on La Clojure sources. The last update is available for IntelliJ IDEA 15 (as soon as Cursive Clojure will be available from JetBrains plugin manager, it won't be updated anymore).

la-clojure

Clojure plugin for IntelliJ IDEA.
Provides Clojure language support: syntax and error highlighting, completion, navigation and refactorings.

Getting Started

You have decided to develop in Clojure with your favorite IDE. Great! This README will assume that you have already downloaded and installed the "la-clojure" plugin via "Settings -> Plugins".

If you are familiar with Clojure, your first intuition will be to try to open a REPL in the IDE. However, before you do that, you must first create a Clojure project.

This README assumes that you already have a JDK installed.

  1. Click "File -> New Project -> Create Project from Scratch".
  2. Enter a name for your project, and select "Java Module" as the type. Click "Next".
  3. Create a new source directory (or not) and click "Next".
  4. In the "Desired technologies" list check the "Clojure" checkbox. You can choose to "Download" the Clojure jar (version 1.2) or select "Set up library later" to specify your own version of clojure.jar.
  5. Click "Finish" and the project will be created.

If you selected "Set up library later", configure the library as below:

  1. Download the latest version of the Clojure jar from clojure.org
  2. Right click on the project to "Open Module Settings"
  3. Click on "Modules -> Dependencies".
  4. Click "Add -> Single Entry Module Library", and select the path where you downloaded clojure.jar to.
  5. Click "Apply" and "OK".

Now you can start a Clojure Console via "Tools -> Clojure Console" or "Ctrl+Shift+F10".

Develop (Clojure) with Pleasure!

Setting up "La Clojure" project from sources

Follow these steps:

  1. Clone this repository.
  2. Create IDEA13SDK directory (or symlink) in folder lib
  3. Download archive of the latest IDEA 15 EAP Ultimate or Community edition. Note, that for Windows and Community edition you need to download installer.
  4. Unpack it into IDEA13SDK directory (or symlink), bin directory should be in the root.
  5. Open 'La Clojure' project now
  6. Setup JDK. Additionally add tools.jar, from JDK lib directory. It contains JDI classes.
  7. Now you can compile and run IDEA run configuration.
  8. To build plugin, run 'Production' artifact from IDEA (Build -> Build Artifacts)
  9. To attach IDEA sources you need to create sources.zip file (and put it in the IDEA13SDK directory) with the following structure: community/java, community/platform and so on (from plugins sources you need only copyright plugin).
  10. To run tests use 'AllTests' run configuration. To run single test, configure defaults for JUnit configuration like it's done in 'AllTests' run configuration. Additionally you have to extend VM options of default JUnit configuration with property -Didea.platform.prefix=Idea.

la-clojure's People

Contributors

adovzh avatar aheusingfeld avatar alefas avatar alexeypegov avatar atifmansoor avatar cjkent avatar dlebrero avatar donnerpeter avatar drewnoakes avatar gregsh avatar hsestupin avatar ianp avatar ilyasergey avatar martingross avatar mdaniel avatar mstarzyk avatar opus111 avatar oshyshko avatar osipovstas avatar pavelfatin avatar ponomandr avatar sesm avatar sgt avatar trptcolin avatar vbauer avatar wuhx avatar xbsd-nikolay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

la-clojure's Issues

Plugin doesn't show no one external dependency (except JDK) in Leiningen project

I've created simple Luminus based sandbox project using Leiningen and don't see project dependencies except JDK.

My "project.clj" file:

(defproject
  ziggurat
  "0.1.0-SNAPSHOT"
  :repl-options {:init-ns ziggurat.repl}
  :dependencies
  [[com.h2database/h2 "1.3.175"]
   [ring-server "0.3.1"]
   [ring/ring-json "0.2.0"]
   [environ "0.4.0"]
   [com.taoensso/timbre "2.7.1"]
   [korma "0.3.0-RC6"]
   [http-kit "2.1.16"]
   [com.taoensso/tower "2.0.1"]
   [org.clojure/clojure "1.5.1"]
   [org.clojure/clojure-contrib "1.2.0"]
   [log4j "1.2.17"
    :exclusions
    [javax.mail/mail javax.jms/jms com.sun.jdmk/jmxtools com.sun.jmx/jmxri]]
   [compojure "1.1.6"]
   [lib-noir "0.7.9"]
   [com.postspectacular/rotor "0.1.0"]]

  :ring {:handler ziggurat.handler/app
         :init ziggurat.handler/init
         :destroy ziggurat.handler/destroy
         :port 8080}

  :profiles {:uberjar {:aot :all}
             :production {:ring {:open-browser? false
                                 :stacktraces? false
                                 :auto-reload? false}}
             :dev {:dependencies [[ring-mock "0.1.5"] [ring/ring-devel "1.2.1"]],
                   :env {:selmer-dev true}}}

  :url "http://example.com/FIXME"
  :main ziggurat.core
  :plugins [[lein-ring "0.8.10"] [lein-environ "0.4.0"]]
  :description "FIXME: write description"
  :min-lein-version "2.0.0")

Screenshot:
image

Environment setup:
OS: Ubuntu 13.10
Intellij IDEA 13.0.2 Build #IU-133.696 built on January 24, 2014
JRE: 1.7.0_45-b18 amd64, HotSpot(TM) 64

issues with highlighting

I'm playing with a project created by lein new ii_2. The core.clj file looks like:

(ns ii-2.core)

(defn foo
  "I don't do a whole lot."
  [x]
  (println x "Hello, World!"))
  • When I select either parenthesis around the ns form, neither one highlights.
  • When I select either double quote around the docstring, neither one highlights.
  • When I select either double quote around "Hello, World!", neither one highlights.

All other parentheses and brackets highlight as expected.

Specify what exactly version of IDEA 13 is supported

The third step at your contribution tutorial says:

3. Download archive of the latest IDEA 13 EAP Ultimate or Community edition.

But with latest IDEA 13 SKD la-clojure simply doesn't compile. The error raises at the class ClojureBasicSelectioner

Could you please specify more concretely which version is supported right now cause it seems that trying out to download all the IDEA 13 builds from here is not the best practice.
Thanks.

"Align clojure forms by the second element" checkbox doesn't seem to work

The "Align clojure forms by the second element" checkbox under Settings > Code Style > [Scheme Name] doesn't seem to do anything

I am running Idea Community Edition 11.1.4, build 117.963 and La-Clojure version 0.4.512

(defn my-zipmap [keys vals]
(loop [map {}
ks (seq keys)
vs (seq vals)]
(if (and ks vs)
(recur (assoc map (first ks) (first vs))
(rest ks)
(rest vs))
map)))
(my-zipmap [:a :b :c ] [1 2 3])

reformats to

(defn my-zipmap [keys vals]
  (loop [map {}
         ks (seq keys)
         vs (seq vals)]
    (if (and ks vs)
      (recur (assoc map (first ks) (first vs))
        (rest ks)
        (rest vs))
      map)))
(my-zipmap [:a :b :c ] [1 2 3])

whether or not the box is checked.

It seems like it should become

(defn my-zipmap [keys vals]
  (loop [map {}
         ks (seq keys)
         vs (seq vals)]
    (if (and ks vs)
        (recur (assoc map (first ks) (first vs))
               (rest ks)
               (rest vs))
        map)))
(my-zipmap [:a :b :c] [1 2 3])

when the box is checked.

Ctrl+Q not working

Quick Help (Ctrl+Q) is not working with IntelliJ 12 with LaClojure, even if the project/module has the sources and JavaDocs attached.

Steps to reproduce it:

  1. with Lein 2, create new project: "lein new test_prj"
  2. with Lein 2, create the corresponding pom.xml for this project.
  3. create IntelliJ project, with importing the according maven module (check to download sources and docs too)
  4. Ctrl+Q on e.g. "(println x "...")" in the generated sources will show the "No Documentation found" text for the quick help popup :(.

Thanks in advance.

Vector with :keyword as final element leaves an extra space

This is what we see, upon clojure-formatting a file or region:

(ns foo.bar-spec
  (:require [joodo.spec-helpers.controller :refer :all ]
            [hyperion.dev.spec-helper :refer [with-memory-datastore]]
            [speclj.core :refer :all ]))

I'd expect to see this instead:

(ns foo.bar-spec
  (:require [joodo.spec-helpers.controller :refer :all]
            [hyperion.dev.spec-helper :refer [with-memory-datastore]]
            [speclj.core :refer :all]))

I've only noticed vectors ending with keywords, probably because of their prevalence in ns forms, but not sure if this happens with lists, maps, etc. (I'm not a regular IntelliJ user, but have coworkers who are.)

Very old pull requests that are still open

This isn't per se an issue with the plugin but there are two very old pull requests that have no comments and are still open. Have these already been addressed and just not been closed? If they aren't going to be merged shouldn't they be closed?

#14 CLJ-119 Rename refactoring doesn't take metadata into account

#11 Fix various AOT compilation related issues

Rainbow parenthesis and commenting

I'm using IntelliJ IDEA 12.0.2 and the La Clojure plugin version 0.5.228.

I have rainbow parenthesis turned on and when I comment lines of code the rainbow parens are not drawn using the comment color. They still have the same color as they do in normal code blocks.

Screenshot:

IntelliJ-RainbowParen-Comment

1.3 support for IDEA 10.5.x

I got tired of manually setting up clojure-1.3 support each time, so here's a patch that will load the jar directly from the maven site (applied against the master branch):

diff --git a/src/org/jetbrains/plugins/clojure/config/ClojureVersion.java b/src/org/jetbrains/plugins/clojure/config/ClojureVersion.java
--- a/src/org/jetbrains/plugins/clojure/config/ClojureVersion.java
+++ b/src/org/jetbrains/plugins/clojure/config/ClojureVersion.java
@@ -13,20 +13,22 @@
 public enum ClojureVersion {

   Clojure_1_0("1.0", new LibraryInfo[]{
-      createJarDownloadInfo("clojure.jar", "", ClojureUtils.CLOJURE_MAIN),
-      createJarDownloadInfo("clojure-contrib.jar", ""),
-
+      createJarDownloadInfo(true, "clojure.jar", "", ClojureUtils.CLOJURE_MAIN),
+      createJarDownloadInfo(true, "clojure-contrib.jar", ""),
   }),

   Clojure_1_1_0("1.1.0", new LibraryInfo[]{
-      createJarDownloadInfo("clojure.jar", "1.1.0", ClojureUtils.CLOJURE_MAIN),
+      createJarDownloadInfo(true, "clojure.jar", "1.1.0", ClojureUtils.CLOJURE_MAIN),
   }),

   Clojure_1_2("1.2", new LibraryInfo[]{
-      createJarDownloadInfo("clojure.jar", "1.2", ClojureUtils.CLOJURE_MAIN),
+      createJarDownloadInfo(true, "clojure.jar", "1.2", ClojureUtils.CLOJURE_MAIN),
+  }),
+
+  Clojure_1_3("1.3.0", new LibraryInfo[]{
+      createJarDownloadInfo(false, "clojure.jar", "1.3.0", ClojureUtils.CLOJURE_MAIN),
   });

-
   private final String myName;
   private final LibraryInfo[] myJars;

diff --git a/src/org/jetbrains/plugins/clojure/config/util/ClojureMavenLibraryUtil.java b/src/org/jetbrains/plugins/clojure/config/util/ClojureMavenLibraryUtil.java
--- a/src/org/jetbrains/plugins/clojure/config/util/ClojureMavenLibraryUtil.java
+++ b/src/org/jetbrains/plugins/clojure/config/util/ClojureMavenLibraryUtil.java
@@ -13,14 +13,24 @@
   @NonNls
   private static final String DOWNLOADING_URL = DOWNLOAD_JETBRAINS_COM + "/idea/clojure/";

+  @NonNls
+  private static final String DOWNLOAD_MAVEN_ORG = "http://repo1.maven.org";
+  @NonNls
+  private static final String MAVEN_DOWNLOADING_URL = DOWNLOAD_MAVEN_ORG + "/maven2/org/clojure/clojure/";
+
   private ClojureMavenLibraryUtil() {
   }

-  public static LibraryInfo createJarDownloadInfo(final String jarName, final String version,
+  public static LibraryInfo createJarDownloadInfo(final boolean useBrainsUrl, final String jarName, final String version,
                                                   final String... requiredClasses) {
     final String v = version == null || version.length() == 0 ? "" : "/" + version + "/";
-    return new LibraryInfo(jarName, DOWNLOADING_URL + v + jarName, DOWNLOAD_JETBRAINS_COM, null,
-        requiredClasses);
+    if (useBrainsUrl) 
+      return new LibraryInfo(jarName, DOWNLOADING_URL + v + jarName, DOWNLOAD_JETBRAINS_COM, null,
+          requiredClasses);
+    else
+      return new LibraryInfo(jarName, MAVEN_DOWNLOADING_URL + v 
+          + jarName.substring(0, jarName.lastIndexOf('.')) + "-" + version + ".jar" , DOWNLOAD_MAVEN_ORG, null,
+          requiredClasses);
   }

 }

Keyboard-shortcut for switching namespace

It would be great if developers add keyboard-shortcut for switching in REPL to namespase of opened file, like in clojure plugin for eclipse.
In my working copy of la-clojure i`ve added
org.jetbrains.plugins.clojure.repl.actions.SwitchNamespaceClojureFileInConsoleAction class, extending ClojureConsoleActionBase, implementing actionPerformed(AnActionEvent e) method:

public void actionPerformed(AnActionEvent e) {
..
final String namespace = ((ClojureFile) psiFile).getNamespace();
if (namespace == null) return;
final String command = "(ns " + namespace + ")";
executeCommand(project, command);
}

and registered REPL-related action in plugin.xml:
<action id="org.jetbrains.plugins.clojure.repl.actions.SwitchNamespaceClojureFileInConsoleAction"
class="org.jetbrains.plugins.clojure.repl.actions.SwitchNamespaceClojureFileInConsoleAction"
text="Switch to file's namespace in REPL">
<keyboard-shortcut keymap="$default" first-keystroke="ctrl shift M"/>
</action>

ArrayIndexOutOfBoundsException when Tools menu pops out on Idea 12

To replicate:

Click on the Tools menu.
The exception shown below is thrown.

This is running on Windows 7 SP1 64 bit, JDK 1.7.0_09, La Clojure 0.5.104, Idea build 122.694. Exception was thrown in earlier builds as well.

update failed for AnAction with ID=org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction: 0
java.lang.ArrayIndexOutOfBoundsException: 0
at org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction.getModule(RunClojureConsoleAction.java:79)
at org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction.update(RunClojureConsoleAction.java:35)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:98)
at com.intellij.openapi.actionSystem.impl.Utils.a(Utils.java:165)
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:124)
at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:84)
at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:238)
at com.intellij.openapi.actionSystem.impl.ActionMenu.g(ActionMenu.java:260)
at com.intellij.openapi.actionSystem.impl.ActionMenu.access$400(ActionMenu.java:42)
at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.menuSelected(ActionMenu.java:223)
at javax.swing.JMenu.fireMenuSelected(JMenu.java:1043)
at javax.swing.JMenu$MenuChangeListener.stateChanged(JMenu.java:1122)
at javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:349)
at javax.swing.DefaultButtonModel.setSelected(DefaultButtonModel.java:232)
at javax.swing.JMenu.setSelected(JMenu.java:311)
at javax.swing.JMenu.menuSelectionChanged(JMenu.java:1190)
at com.intellij.openapi.actionSystem.impl.ActionMenu.menuSelectionChanged(ActionMenu.java:197)
at javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:118)
at javax.swing.plaf.basic.BasicMenuUI$Handler.mouseEntered(BasicMenuUI.java:526)
at java.awt.Component.processMouseEvent(Component.java:6514)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4620)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4474)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at com.intellij.ide.IdeEventQueue.d(IdeEventQueue.java:673)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:494)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:333)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

let statement indenting is incorrect

This is the behavior when formatting clojure code with a 2-line let binding:

(let [foo (bar :fizz
  :bang)]
  (other-stuff))

I'd expect it to be like this:

(let [foo (bar :fizz
               :bang)]
  (other-stuff))

'extend' cannot be used with 'defrecord' in La Clojure only

The following program:

(defprotocol PointMethods
  (add [self other])
  (distance [self]))

(defrecord Point [x y])

(defn extend-point [c]
  (extend c
    PointMethods
    { :add     (fn [self other]
                 (Point. (+ (:x self) (:x other)) (+ (:y self) (:y other))))
     :distance (fn [self]
                 (Math/sqrt (+ (* (:x self) (:x self)) (* (:y self) (:y self)))))}))

(extend-point Point)

(def p1 (Point. 2 3))
(def p2 (Point. 1 1))

(def p3 (add p1 p2))
(println p3)
(println (distance p3))

works fine in the 1.4.0 and 1.50 repl, but fails when run in La Clojure, either as a script or when pasted in to the repl. Very odd! Here is the error message:

IllegalArgumentException No implementation of method: :add of protocol: #'user/PointMethods found for class: user.Point  clojure.core/-cache-protocol-fn (core_deftype.clj:562)

automatically setting the REPL namespace to match the editor

Currently, you have to manually use in-ns to set the namespace in the REPL any time you switch between different files in the editor. This is very disruptive and it would be much better if the REPL would be set automatically to the namespace of the file that's being edited.

code completion not working using :require

I refer all functions in util.clj like this:

(ns mypreoj.core
(:require [mypreoj.util :refer :all]))

but code completion seems not working, and i also cannot go to it's defination pressing F3.

I'm using clojure 1.4, Intellij IDEA CE 11.1, and La Clojure 0.4.216

What JetBrains products does this wok on?

I use WebStorm. The only thing I can get this plugin to do is install. Nothing changes except that it show up in the installed plugins list. Nothing else is available. It doesn't show up anywhere in settings, new project or anything.

Error opening lein project with IDEA 13

I just installed IDEA 13 and the la clojure and leiningen plugins. When I try to import a lein project, I get the following error:

Error Loading Default Project
createComponent() returns null for: class
com.injellij.execution.RunManager

NullPointerException with LaClojure 0.4.30 and IntelliJ IC-111.24

Once I setup a project with Leiningen, I get a NullPointerException whenever I try to start the REPL (Ctrl-Shift-F10):

10:53:29 PM NullPointerException: Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(453,220),absolute(1165,220),button=1,modifiers=Button1,clickCount=1] on frame0
10:54:08 PM NullPointerException: Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(431,213),absolute(1143,213),button=1,modifiers=Button1,clickCount=1] on frame0

Testing Support

I would like the option to run a script as a unit test.

This should be similar to normal execution, but include the test scope dependencies as well.

Ideally, it should be able to hook into IDEA's test progress UI to show the green bar, etc., as with JUnit or TestNG tests.

An option to run all tests (possibly, following a naming convention for namespaces) would also be nice. Basically, load all test namespaces, then execute function clojure.test/run-tests.

'AllTests' run configuration just ignores lots of test classes

I've set up project according to your guide.

If I choose 'AllTests' configuration and run it than only some of all test classes will be used during the run. To be more precisely test suite consists of only 5 classes:

  • ClojureEditingTest
  • ClojureCompilerTest
  • LexerTest
  • RenameTest
  • StubTest

But definitely there are many other test classes, e.q. BarfBackwardsTest, ClojureResolveSymbolTest and so on.

If I run ClojureResolveSymbolTest as a single test with junit configuration which is the same as in AllTests it fails with strange exception:
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.openapi.vfs.LocalFileSystem$LocalFileSystemHolder at com.intellij.openapi.vfs.LocalFileSystem.getInstance(LocalFileSystem.java:46) at com.intellij.testFramework.PlatformTestCase.cleanupApplicationCaches(PlatformTestCase.java:341) at com.intellij.testFramework.LightPlatformTestCase$8.run(LightPlatformTestCase.java:666)

Please tell me what I am doing wrong cause this problem blocks me to send some useful pull requests.

p.s. My .idea/ config doesn't differ to the repo one.
Thanks.

the default *compile-path* used by the repl should match module compile output.

When using the (compile 'x.y.z) repl command classes are compiled to the default * compile-path * var "classes". This makes things a problem as these classes cannot be resolved by the repl when the compiled function needs to be called:

(x.y.z "blah")

Ideally the projects output path in the "use module compile output path" option (in the paths tab) should be used.

Another option might be just to fall back to a lein repl (if installed, but again this makes the task quite large when really a (set! *compile-path* "target/classes") with appropriate folder construction would do (this is in the case of maven)

Word wrapping in REPL

It would be great if there was an option to wrap words in the Clojure REPL output. Now when long lines are printed in the output it is necessary to scroll to the right which is quite tedious:

Screen Shot 2013-02-15 at 3 02 42 PM

In the standard Run console there is the "Use Soft Wraps" option. It would be fantastic to have it in the Clojure REPL too.

Ctrl+Alt+L works incorrectly with functions containing prime in their name

Example:

Snippet - 1 gets "reformatted" as snippet - 2 when you hit Ctrl+Alt+L.

Snippet - 1:

(defn dotify-graph' [{:keys [nodes edges]}]
  (str
    "graph{"
    (dotify-nodes nodes)
    (dotify-edges' edges)
    "}"))

Snippet - 2:

(defn dotify-graph '[{:keys [nodes edges]}]
  (str
    "graph{"
    (dotify-nodes nodes)
    (dotify-edges 'edges)
    "}"))

Console does not work with Idea 13 133.193

Looks like la-clojure 0.7.60 is not compatible with the Idea 13 API.
Clojure REPL opens, but does not output anything. There is a NoSuchMethodError in Idea logs:

2013-12-06 10:17:17,418 [  36704]  ERROR - llij.ide.plugins.PluginManager - com.intellij.execution.console.LanguageConsoleImpl.printToConsole(Lcom/intellij/execution/console/LanguageConsoleImpl;Lcom/intellij/execution/ui/ConsoleViewContentType;Ljava/util/List;)V 
java.lang.NoSuchMethodError: com.intellij.execution.console.LanguageConsoleImpl.printToConsole(Lcom/intellij/execution/console/LanguageConsoleImpl;Lcom/intellij/execution/ui/ConsoleViewContentType;Ljava/util/List;)V
    at org.jetbrains.plugins.clojure.repl.ClojureConsoleHighlightingUtil.processOutput(ClojureConsoleHighlightingUtil.java:38)
    at org.jetbrains.plugins.clojure.repl.ClojureConsoleProcessHandler.textAvailable(ClojureConsoleProcessHandler.java:26)
    at com.intellij.execution.process.ColoredProcessHandler.coloredTextAvailable(ColoredProcessHandler.java:53)
    at com.intellij.execution.process.AnsiEscapeDecoder.coloredTextAvailable(AnsiEscapeDecoder.java:96)
    at com.intellij.execution.process.AnsiEscapeDecoder.escapeText(AnsiEscapeDecoder.java:69)
    at com.intellij.execution.process.ColoredProcessHandler.notifyTextAvailable(ColoredProcessHandler.java:48)
    at com.intellij.execution.process.BaseOSProcessHandler.startNotify(BaseOSProcessHandler.java:79)
    at org.jetbrains.plugins.clojure.repl.ClojureConsoleRunner.initAndRun(ClojureConsoleRunner.java:181)
    at org.jetbrains.plugins.clojure.repl.ClojureConsoleRunner.run(ClojureConsoleRunner.java:113)
    at org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction.actionPerformed(RunClojureConsoleAction.java:54)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:564)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:611)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:463)
    at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:206)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:493)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
2013-12-06 10:17:17,421 [  36707]  ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 13.0  Build #IC-133.193 
2013-12-06 10:17:17,421 [  36707]  ERROR - llij.ide.plugins.PluginManager - JDK: 1.6.0_45 
2013-12-06 10:17:17,421 [  36707]  ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM 
2013-12-06 10:17:17,421 [  36707]  ERROR - llij.ide.plugins.PluginManager - Vendor: Sun Microsystems Inc. 
2013-12-06 10:17:17,422 [  36708]  ERROR - llij.ide.plugins.PluginManager - OS: Linux 
2013-12-06 10:17:17,422 [  36708]  ERROR - llij.ide.plugins.PluginManager - Last Action: org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction 

Single quote matching problem on arbitrary precision math functions

After introduction of arbitrary precision math functions (+' , -' ,*' etc.) in Clojure 1.3 sometimes single quote matching goes wrong in both source files and REPL. Because of this, source parsing and evaluating expressions in the REPL doesn't work as intended anymore.

In the following both pairs of expression work the same:

(+ 1 2 3) 
(+' 1 2 3)

(map +  [1 2 3] [1 2 3])
(map +' [1 2 3] [1 2 3])

However, these differ, resulting in syntax warnings, or not being able to enter the expression in the REPL when arbitrary math is used:

(doc +) 
(doc +')

(map apply [+ - *] [1 2 3] [1 2 3] [1 2 3] [nil nil nil])
(map apply [+' -' *'] [1 2 3] [1 2 3] [1 2 3] [nil nil nil])

bug with "Cannot evaluate"

this text in Clojure is correct:
(defn | [x] x)

but La Clojure says that: "S-expressions contains syntax errors".

How can I disable this buggy check?

README.md does not contain instructions for building/contributing

Please add instructions/links for setting up development environment and relevant contributors agreements to README.md or a similarly visible location. This would significantly reduce the burden for new contributors.

Specifically:

  • what should the IDEA13SDK directory/symlink contain
  • how should the plugin be built
  • what tests are available and how should they be run

Nice to have:

  • description of branches, release plan, backports policy
  • a link to wherever developer discussions take place

Classpath of console and scripts

Hi,

It seems that the console and the clojure scripts don't pickup the maven dependencies with scope "test" or "provided". Is there any reason for this? Can it be changed?

Thanks,

Daniel

wrong help panel appears for REPL

If I click on the question mark next to the Clojure REPL pane, I get a help window in my web browser. However, it tells me about the Groovy Shell, rather than La Clojure, etc.

0.3.102 Regression bug: Windows system environment not loaded into REPL

Regression of a bug originally mentioned in the Plugin Repository comments

Anonymous
Rated: noRate
2010-12-21 06:19:47

The system environment is empty in REPL. This is why I can't open socket on Windows. Can you please fix it? Below is an example fix, which works in my side.

public class ClojureReplProcessHandler extends ProcessHandler {
final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

final ArrayList env = new ArrayList();

  • for (java.util.Map.Entry entry: System.getenv().entrySet()) {
  • env.add(entry.getKey() + "=" + entry.getValue());
  • }
    final ArrayList cmd = new ArrayList();
    cmd.add(executablePath);
    cmd.addAll(line.getParametersList().getList());

This problem among others prevents socket connections being opened from the REPL under Windows, breaking REPL functionality severely. The problem was fixed a few months after the comment, but now occurs again in 0.3.102, released on 31-11-11. Revert to 0.3.92 and the problem doesn't occur again.

Cause is not loading the Windows system environment variables into Java when running the REPL. See the difference in behavior running (System/getenv) from the REPL. In 0.3.92 this returns an UnmodifiableMap with system environment settings, in 0.3.102 this returns an empty map.

Functions defined inside of a (let) are not recognized

This way of declaring a function within a let construct is valid and practical, as it allows to bind symbols which are instantiated only once and are visible only for the inner function:
Screen Shot 2013-04-27 at 6 56 06 PM

La clojure, however, fails to recognize them:
Screen Shot 2013-04-27 at 6 54 49 PM

'Run selected text' and other shortcuts not responding

Using fresh copies of IDEA Community Edition in both Ubuntu and Windows, some keyboard shortcuts don't work at all, or maybe they do once every 100 times - after random keystroking. If I set a custom combination to a command, it works, but after a while they are 'forgotten' again.

Thank you.

REPL autocomplete does not work for functions defined in the current namespace

(a) Create a new project use lein - lein new app try
(b) Import project into Intellij
(c) Open the file src/try/core.clj
(d) Define a small function in this file - (defn func1 )
(e) Start the Clojure repl from intellij
(f) Load the above file into the repl
(g) Change namespace to (ns try.core)
(h) Try typing (fun .. The plugin will not autocomplete the name func1. However try.core/fun... auto completes it.

Can't start Clojure Console

Last LaClojure plugin installed (from Settings | Plugins).
But when I call Tools | Start Clojure Console, it show IDE Fatal Errors window with this stack trace:

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(516,480),absolute(508,502),button=1,modifiers=Button1,clickCount=1] on frame0
java.lang.NullPointerException
at org.jetbrains.plugins.clojure.repl.ClojureConsoleRunner.getMainReplClass(ClojureConsoleRunner.java:311)
at org.jetbrains.plugins.clojure.repl.ClojureConsoleRunner.createRuntimeArgs(ClojureConsoleRunner.java:288)
at org.jetbrains.plugins.clojure.repl.ClojureConsoleRunner.run(ClojureConsoleRunner.java:82)
at org.jetbrains.plugins.clojure.actions.RunClojureConsoleAction.actionPerformed(RunClojureConsoleAction.java:54)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:242)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:668)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:104)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:228)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:92)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:662)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:511)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:411)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.