Skip to content

User Guide

Enerccio edited this page Feb 11, 2023 · 25 revisions

This guide is for version 0.3.1 and up unless mentioned otherwise!

Installation

Plugin Installation

Download plugin for your IDE from releases and install it via file.

ie File->Settings->Plugin, click on gear icon and then 'Install plugin from disk' and then select the downloaded zip (do not unzip the zip)

To find out which release applies to you check this table:

Jetbrains IDE Variant Plugin name pattern
CLion slt-version-signed-CL.zip
GoLand slt-version-signed-GO.zip
Intellij Community slt-version-signed-IC.zip
Intellij Ultimate slt-version-signed-IU.zip
PyCharm slt-version-signed-PY.zip
PyCharm Community slt-version-signed-PC.zip
Rider slt-version-signed-RD.zip

PhpStorm is coming when I read how to build it correctly since just swapping the type does not work.

Continue with installation of SDK below:

Windows

Automatic Download

  • In the IDE open Settings > Languages & Frameworks > Common Lisp SDKs, then click on Download New SBCL SDK (Windows Only)

  • It just works!™ --Todd Howard (cca 2015, colorized)

Manual Installation

  • It should end with T. Then type (quicklisp-quickstart:install) end press enter. After download it should look like this:

  • Quicklisp is now installed in your home directory (C:\Users\<name>\quicklisp)

  • In the IDE open Settings > Languages & Frameworks > Common Lisp SDKs, then click on Add New SBCL SDK

  • Then locate sbcl.exe for SBCL executable.

  • You can do same with SBCL.core file but it is optional, alternatively you can supply your own core. Then find your setup.lisp inside quicklisp folder in your home and add it to the sdk. Should look like this when filled:

  • Clicking on Verify SBCL SDK will download all necessary libraries requires and will verify the SDK. Wait until verification is finished, it can take some time to download all dependencies. Click Save and then Apply to add your SDK.

  • Then go to Languages And Settings > Common Lisp SDK and click the refresh icon and select your installed SDK from the menu and hit Apply

This is a change from 0.3.0! to accommodate deprecated Project setting

  • Done!

Mac

Since I don't own Mac you are on your own. But brew can probably be used or you can google how to get sbcl on mac. Rest should be the same as for linux version.

Linux

Repository Installation

Installing SBCL from repo works and usually all you need to enter into path is sbcl. Install quicklisp via

$ curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp

$ sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp --eval '(quicklisp-quickstart:install :path "~/.quicklisp") --quit

To set up SDK, follow Windows guide above but usually if sbcl is in path, simple sbcl is all that is required. Quicklisp path must be filled though, which, if you used previous commands to install quicklisp is ~/.quicklisp/setup.lisp.

Usage

To unlock most potential out of plugin you have to start sbcl instance. This is done on Common Lisp toolbar, green icon "Start SBCL Instance".

You can stop the instance by following red button. If you get this error you need to setup SDK, see above.

How to..

...open REPL?

Click on the "Create Lisp REPL" + button in Common Lisp toolbar.

To evaluate expression add one blank line at the end. You can use arrows to get to previous expressions and such.

...create lisp file?

Right click on folder and then "New > Asdf system/Common Lisp Lisp File/Common Lisp CL File" to create basic template

...evaluate lisp file?

Right click on a file in project explorer and pick Evaluate File option:

Alternatively, you can right click in any opened file and then select "Evaluate Current File"

...evaluate expressions?

There are options when you right click:

  • Evaluate Selected Region will evaluate selected region as an expression. You can evaluate parts of toplevel expressions and inside comments.

    • Default key combination: Ctrl+Alt+R
  • Evaluate This S-Expression will evaluate S-Expression cursor is in. Only right this expression will be evaluated, not whole toplevel. Will also select the evaluated expression.

    • Default key combination: Ctrl+Alt+F
  • Evaluate Previous S-Expression will evaluate S-Expression left of cursor. Will also select the evaluated expression.

    • Default key combination: Ctrl+Alt+E
  • Evaluate Next S-Expression will evaluate S-Expression to the right of the cursor. Will also select the evaluated expression.

    • Default key combination: Ctrl+Alt+Q

...debug my code?

As of 0.3.0, only interactive debugger is implemented. If failure happens, SBCL Debuggers panel will be selected and Debugger #N will be there:

You can select actions what to do on the left. If actions require parameters you will be prompted to input them:

You can also click on frames to see variables. Click on frame will also open up source location, if available.

this example is from linux where I have SBCL sources available

You can use Frame REPL to evaluate code in that frame. Alternatively, you can click on locals to enter inspector:

In inspector you can click on more links and/or use arrows to move in history. Refresh will refresh inspector contents on change.

...learn more about a symbol?

Hovering over a symbol will show documentation retrieved from SBCL:

If the call is a macro, hovering again will also show macro expansion of that macro:

...go where symbol has definition?

Ctrl+Click on a symbol will open new editor with a file containing source, if there is such file

...get context help?

When you are typing, you get automatic contextual help of available functions and macros

...search symbols?

Shift+shift gives context help.

...change colors of elements?

For coloring to work completely, SBCL has to be running. This is also reason default color preview in Jetbrains IDE won't preview correctly.

  • Open the Settings Menu,
  • Navigate to Editor > Color Scheme > Common Lisp
  • Change colors to your liking (if need more help check Intellij help)

...change indentation settings?

You can change some indentation settings for every common lisp project in "Settings > Editor > Common Lisp Indentation"

Or you can also change project specific ones in "Editor > Common Lisp Indentation (Project)"

This is a change from 0.3.0! to accommodate deprecated Project setting

If "Apply indentation rules" is checked, SLT will try to indent according to simplified slime indentation rules. It will also work with user generated macros and their &body argument position.

...show threads?

Click on Lisp Instance Information

You can select a thread and stop/kill it with buttons.

...show argument list?

If you are inside function call, you can press Ctrl+P to show argument list:

...enable spell checking?

new from 0.4.0

Spell checking is enabled by default but file has to be under content root (File>Project Structure>Modules)

Other Implementations

new from 0.4.0

SLT works with these implementations to a degree: SBCL, ABCL, CCL, Allegro CL, CMUCL. Each version is configured as SDK. You can check FEATURES.md file to see which parts of SLT are supported for that implementation.

What about roswell?

You can use roswell in case of binary executable for executable path. Just use ros run instead of path to sbcl and it will work just fine.

Clone this wiki locally