<commit_before>Counterclockwise User Guide
===========================
<NAME> <<EMAIL>>
:toc:
:toclevels: 0
:sectlinks:
:sectanchors:
:highlight: highlightjs
:experimental:
:icons: font

Counterclockwise User Documentation

= What is Counterclockwise ?

Counterclockwise is best described as an Integrated Development Environment for the http://www.clojure.org[Clojure] language. +
It is an extension of the popular http://www.eclipse.org[Eclipse IDE].

Goals of Counterclockwise:

- be as easy as possible for Clojure beginners
- integrate nicely into the Eclipse IDE

Counterclockwise bundles everything for hacking Clojure Code:

- Wizards for creating / importing existing Clojure projects from scratch or from Leiningen project definitions
- Clojure Editor with advanced editing features
- Starting Clojure REPLs, interacting between Clojure Editors and Clojure REPLs 
- Tight integration with Leiningen


= Install Counterclockwise

- No Eclipse? <<install-as-standalone-product,Install as a Standalone Product>>

//

- or <<install-as-plugin,Install as an Eclipse Plugin>> into an existing Eclipse

[[install-as-standalone-product]]
== Install as a Standalone Product

Current Version is %%VERSION%%

[NOTE]
====
Pre-requisites

- Java Virtual Machine (JVM) 7 installed and setup in the Operating System's PATH

====

[cols="1,6"]
|===
| 1. Download
| link:products/Counterclockwise-%%VERSION%%-win32.win32.x86.zip[Windows 32 Bits] / link:products/Counterclockwise-%%VERSION%%-win32.win32.x86_64.zip[Windows 64 Bits] +
link:products/Counterclockwise-%%VERSION%%-linux.gtk.x86.zip[Linux 32 Bits] / link:products/Counterclockwise-%%VERSION%%-linux.gtk.x86_64.zip[Linux 64 Bits] +
link:products/Counterclockwise-%%VERSION%%-macosx.cocoa.x86_64.zip[OS X 64 Bits]

| 2. Unzip
| This will create a `Counterclockwise-%%VERSION%%` directory (application directory for OS X)

| 3. Start
| Launch the `Counterclockwise` executable for your platform, located inside the `Counterclockwise-%%VERSION%%` directory
|===

You may now want to <<first-project,create your first project>> or <<open-project,open an existing project>>. +
Having a problem? Check the <<configure,Configure Counterclockwise>> Section or the https://code.google.com/p/counterclockwise/wiki/FAQ[Troubleshooting page].


[[install-as-plugin]]
== Install as an Eclipse Plugin

[NOTE]
====
Pre-requisites

- Java Virtual Machine (JVM) 7 running Eclipse
- Eclipse 4.3 (Kepler) highly recommanded. Eclipse 3.7 (Indigo) still supported.
** any packaging including JDT (Java Development Tools) will do:  "Eclipse SDK" package, "Eclipse for Java Developers" package, "Eclipse for Java EE Developers" package, etc.
====

=== TL;DR

- via the Eclipse Marketplace Client: search for `Counterclockwise`
- via the Eclipse Software Update Site: http://updatesite.ccw-ide.org/stable

You may now want to <<first-project,create your first project>> or <<open-project,open an existing project>>. +
Having a problem? Check the <<configure,Configure Counterclockwise>> Section or the https://code.google.com/p/counterclockwise/wiki/FAQ[Troubleshooting page].

[[configure]]
== Configure Counterclockwise

=== Proxy Settings (optional)

Currently Counterclockwise does not use the menu:Window[Preferences > General >Network Connections] Proxy Preference for use with the embedded Leiningen.

So to make it use a proxy, you'll have to create the appropriate environment variable(s) and make them available when you start the Counterclockwise / Eclipse executable.

- `http_proxy`: URL of an HTTP proxy. +
e.g. `http_proxy=http://username:password@proxy:port`
- `https_proxy`: URL of an HTTPS proxy. +
e.g. `http://username:password@proxy:port`
- `http_no_proxy`: list of hosts for which the proxy just declared should be bypassed. +
e.g. `http_no_proxy="*.example1.com|*.example2.com|*.example3.com"`

See the https://github.com/technomancy/leiningen/wiki/HTTP-Proxies[Leiningen HTTP Proxies] page for more detail.


[[first-project]]
= Create your first project

- Open the Java perspective (unnecessary step for `Counterclockwise Standalone product` users)
** menu:Window[Open Perspective > Java] '''(a perspective is a predefined layout of views, suitable for a particular type of development)'''
- Create a Clojure project 
** Menu menu:File[New > Clojure Project], name it `myproject`
** The project is created using the `default` Leiningen Template, which creates a Clojure project with a predefined `myproject.core` namespace in `src/myproject/core.clj`
- Run the project: 
** Click on the editor pane containing the code in `core.clj` and then select `Load file in REPL` from the `Clojure` menu. This sends the whole file's code to the REPL (and also takes care of starting a REPL for the project if none is currently started).
- Switch to the REPL in the namespace of your file: 
** Click on the bottom of the REPL inside the "text input area"
- Call your function (Hit kbd:[Enter] to send the expression if the cursor is at the end, or hit kbd:[Ctrl+Enter] / kbd:[Cmd+Enter] if the cursor is not at the end of the text):

[source,clojure]
----
;; Clojure 1.5.1
#<Namespace myproject.core>
#'myproject.core/foo
=> (foo "Hey")
Hey Hello, World!
nil
----


[[create-new-project]]
= Create a new project

Use the wizard named `Clojure Project`.

// TODO footnotes, or rather section notes
- Open menu:File[New > Clojure Project]  *(`**`)*
// TODO image
** In the wizard, choose a project name (the project folder will be named after the project name),  and a location for where to create the project folder (if you don't like the default one)
- "Leiningen template" field:
** By default it uses the "default" template
** You can change it to use another lein-newnew template released somewhere in a maven repository (generally in clojars) *(`*`)*

Press the btn:[Finish] button, that's all. You have a fully working Leiningen project with its Java Build path (aka class path) managed by Counterclockwise.

// TODO check if the following about lein-newnew still holds
[NOTE]
====
*(`*`)* Lein2's Lein-newnew plugin allows you to create new leiningen projects from "project templates". +
To find the list of currently available project templates, you can ask clojars for "lein-template" artifacts : https://clojars.org/search?q=lein-template
====

[NOTE]
====
*(`**`)*
If you don't see the menu:File[New > Clojure Project] menu entry:
** check that you're in the "Java" or "Plugin Development" Perspective ( menu:Window[Open Perspective > ...] )
** If you still don't see the command, then Reset your Perspective ( menu:Window[Reset Perspective ...])
====

[[open-project]]
= Open a project

Drag a folder from your OS filesystem browser (Windows Explorer, Nautilus, Finder, etc.) and drop it over Counterclockwise's Window.

If the folder is a root folder containing many Leiningen projects, as many projects as found on the filesystem will be created in Counterclockwise.

[NOTE]
====
This feature will only work correctly if menu:Preference[Clojure > General > Automatic detection of Clojure / Leiningen projects] is enabled (which it is by default). +
If the preference is disabled, it is possible to manually trigger leiningen detection via the contextual menu menu:Configure[Convert to Leiningen project].
====


= Leiningen Support

Counterclockwise automatically detects Leiningen projects.

== Project classpath management

Eclipse has its own way of managing the Classpath, and so does Leiningen. Counterclockwise reconciles the two:

- A new node named "Leiningen dependencies" inside your project in the `Package Explorer View`
** This is an addition to the classpath containing all dependencies (including transitive ones) declared in `project.clj` (a `Classpath Container` in Eclipse terminology):
** It is automatically updated when changes in `project.clj` are detected (your changes, or changes you get by refreshing the project, merging from Git, etc.)<commit_msg>doc(Leiningen): adding explanations on what Leiningen is, and hyperlinks.<commit_after>Counterclockwise User Guide
===========================
<NAME> <<EMAIL>>
:toc:
:toclevels: 0
:sectlinks:
:sectanchors:
:highlight: highlightjs
:experimental:
:icons: font

Counterclockwise User Documentation

= What is Counterclockwise ?

Counterclockwise is best described as an Integrated Development Environment for the http://www.clojure.org[Clojure] language. +
It is an extension of the popular http://www.eclipse.org[Eclipse IDE].

Goals of Counterclockwise:

- be as easy as possible for Clojure beginners
- integrate nicely into the Eclipse IDE

Counterclockwise bundles everything for hacking Clojure Code:

- Wizards for creating / importing existing Clojure projects from scratch or from http://leiningen.org[Leiningen] project definitions
- Clojure Editor with advanced editing features
- Starting Clojure REPLs, interacting between Clojure Editors and Clojure REPLs 
- Tight integration with http://leiningen.org[Leiningen] (http://leiningen.org[Leiningen] is the most popular build tool used for clojure projects)


= Install Counterclockwise

- No Eclipse? <<install-as-standalone-product,Install as a Standalone Product>>

//

- or <<install-as-plugin,Install as an Eclipse Plugin>> into an existing Eclipse

[[install-as-standalone-product]]
== Install as a Standalone Product

Current Version is %%VERSION%%

[NOTE]
====
Pre-requisites

- Java Virtual Machine (JVM) 7 installed and setup in the Operating System's PATH

====

[cols="1,6"]
|===
| 1. Download
| link:products/Counterclockwise-%%VERSION%%-win32.win32.x86.zip[Windows 32 Bits] / link:products/Counterclockwise-%%VERSION%%-win32.win32.x86_64.zip[Windows 64 Bits] +
link:products/Counterclockwise-%%VERSION%%-linux.gtk.x86.zip[Linux 32 Bits] / link:products/Counterclockwise-%%VERSION%%-linux.gtk.x86_64.zip[Linux 64 Bits] +
link:products/Counterclockwise-%%VERSION%%-macosx.cocoa.x86_64.zip[OS X 64 Bits]

| 2. Unzip
| This will create a `Counterclockwise-%%VERSION%%` directory (application directory for OS X)

| 3. Start
| Launch the `Counterclockwise` executable for your platform, located inside the `Counterclockwise-%%VERSION%%` directory
|===

You may now want to <<first-project,create your first project>> or <<open-project,open an existing project>>. +
Having a problem? Check the <<configure,Configure Counterclockwise>> Section or the https://code.google.com/p/counterclockwise/wiki/FAQ[Troubleshooting page].


[[install-as-plugin]]
== Install as an Eclipse Plugin

[NOTE]
====
Pre-requisites

- Java Virtual Machine (JVM) 7 running Eclipse
- Eclipse 4.3 (Kepler) highly recommanded. Eclipse 3.7 (Indigo) still supported.
** any packaging including JDT (Java Development Tools) will do:  "Eclipse SDK" package, "Eclipse for Java Developers" package, "Eclipse for Java EE Developers" package, etc.
====

=== TL;DR

- via the Eclipse Marketplace Client: search for `Counterclockwise`
- via the Eclipse Software Update Site: http://updatesite.ccw-ide.org/stable

You may now want to <<first-project,create your first project>> or <<open-project,open an existing project>>. +
Having a problem? Check the <<configure,Configure Counterclockwise>> Section or the https://code.google.com/p/counterclockwise/wiki/FAQ[Troubleshooting page].

[[configure]]
== Configure Counterclockwise

=== Proxy Settings (optional)

Currently Counterclockwise does not use the menu:Window[Preferences > General >Network Connections] Proxy Preference for use with the embedded Leiningen.

So to make it use a proxy, you'll have to create the appropriate environment variable(s) and make them available when you start the Counterclockwise / Eclipse executable.

- `http_proxy`: URL of an HTTP proxy. +
e.g. `http_proxy=http://username:password@proxy:port`
- `https_proxy`: URL of an HTTPS proxy. +
e.g. `http://username:password@proxy:port`
- `http_no_proxy`: list of hosts for which the proxy just declared should be bypassed. +
e.g. `http_no_proxy="*.example1.com|*.example2.com|*.example3.com"`

See the https://github.com/technomancy/leiningen/wiki/HTTP-Proxies[Leiningen HTTP Proxies] page for more detail.


[[first-project]]
= Create your first project

- Open the Java perspective (unnecessary step for `Counterclockwise Standalone product` users)
** menu:Window[Open Perspective > Java] '''(a perspective is a predefined layout of views, suitable for a particular type of development)'''
- Create a Clojure project 
** Menu menu:File[New > Clojure Project], name it `myproject`
** The project is created using the `default` http://leiningen.org[Leiningen] Template, which creates a Clojure project with a predefined `myproject.core` namespace in `src/myproject/core.clj`
- Run the project: 
** Click on the editor pane containing the code in `core.clj` and then select `Load file in REPL` from the `Clojure` menu. This sends the whole file's code to the REPL (and also takes care of starting a REPL for the project if none is currently started).
- Switch to the REPL in the namespace of your file: 
** Click on the bottom of the REPL inside the "text input area"
- Call your function (Hit kbd:[Enter] to send the expression if the cursor is at the end, or hit kbd:[Ctrl+Enter] / kbd:[Cmd+Enter] if the cursor is not at the end of the text):

[source,clojure]
----
;; Clojure 1.5.1
#<Namespace myproject.core>
#'myproject.core/foo
=> (foo "Hey")
Hey Hello, World!
nil
----


[[create-new-project]]
= Create a new project

Use the wizard named `Clojure Project`.

// TODO footnotes, or rather section notes
- Open menu:File[New > Clojure Project]  *(`**`)*
// TODO image
** In the wizard, choose a project name (the project folder will be named after the project name),  and a location for where to create the project folder (if you don't like the default one)
- "Leiningen template" field:
** http://leiningen.org[Leiningen] is the de-facto build tool for clojure projects
** By default it uses the "default" template
** You can change it to use another lein-newnew template released somewhere in a maven repository (generally in clojars) *(`*`)*

Press the btn:[Finish] button, that's all. You have a fully working Leiningen project with its Java Build path (aka class path) managed by Counterclockwise.

// TODO check if the following about lein-newnew still holds
[NOTE]
====
*(`*`)* Lein2's Lein-newnew plugin allows you to create new leiningen projects from "project templates". +
To find the list of currently available project templates, you can ask clojars for "lein-template" artifacts : https://clojars.org/search?q=lein-template
====

[NOTE]
====
*(`**`)*
If you don't see the menu:File[New > Clojure Project] menu entry:
** check that you're in the "Java" or "Plugin Development" Perspective ( menu:Window[Open Perspective > ...] )
** If you still don't see the command, then Reset your Perspective ( menu:Window[Reset Perspective ...])
====

[[open-project]]
= Open a project

Drag a folder from your OS filesystem browser (Windows Explorer, Nautilus, Finder, etc.) and drop it over Counterclockwise's Window.

If the folder is a root folder containing many http://leiningen.org[Leiningen]-based projects, as many projects as found on the filesystem will be created in Counterclockwise.

[NOTE]
====
This feature will only work correctly if menu:Preference[Clojure > General > Automatic detection of Clojure / Leiningen projects] is enabled (which it is by default). +
If the preference is disabled, it is possible to manually trigger leiningen detection via the contextual menu menu:Configure[Convert to Leiningen project].
====


= Leiningen Support

http://leiningen.org[Leiningen] is the de-facto standard build tool used for Clojure projects.

Counterclockwise automatically detects Leiningen projects.

== Project classpath management

Eclipse has its own way of managing the Classpath, and so does Leiningen. Counterclockwise reconciles the two:

- A new node named "Leiningen dependencies" inside your project in the `Package Explorer View`
** This is an addition to the classpath containing all dependencies (including transitive ones) declared in `project.clj` (a `Classpath Container` in Eclipse terminology):
** It is automatically updated when changes in `project.clj` are detected (your changes, or changes you get by refreshing the project, merging from Git, etc.)
{'fraction_non_alphanumeric': 0.1028490728232838, 'fraction_numerical': 0.006508657742846617, 'mean_word_length': 4.987867647058824, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 63, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4409159', 'n_tokens_mistral': 4873, 'n_tokens_neox': 4549, 'n_words': 1920}