Skip to content

Commit

Permalink
Merge pull request #19 from Enerccio/stable
Browse files Browse the repository at this point in the history
0.1.1 bugfixes
  • Loading branch information
Enerccio authored Jan 15, 2023
2 parents 4681185 + af61748 commit dae710a
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 37 deletions.
File renamed without changes.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ IDE capabilities for Common Lisp.
## Requirements

1) Intellij based IDE - tested on `Intellij Idea Community/Ultimate` but should workd on all major IDEs
1) Versions supported are from 2022.2 and upwards
2) [Steel Bank Common Lisp](https://www.sbcl.org/) installed
3) [Quicklisp](https://www.quicklisp.org/beta/)

## Getting started

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'

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

| Jetbrains IDE Variant | Plugin name pattern |
Expand All @@ -36,6 +40,29 @@ To find out which release applies to you check this table:
PhpStorm is coming when I read how to build it correctly since just swapping
the type does not work.

For the first time use, I recommend installing swank and eclector dependencies manually
from sbcl because there is 10 seconds timeout to see if swank has initialized,and it might
terminate before quicklisp has initialized.

Start sbcl and run this script:

On linux and default quicklisp path:

```common lisp
(load "~/quicklisp/setup.lisp")
(ql:quickload :swank)
(ql:quickload :eclector)
```

## Plugin options

Plugin has 2 options right now.
These are accessible in Settings>SLT Configuration

- SBCL executable: Full path to sbcl or if sbcl is in path just `sbcl` is fine.
- on windows, you might need .exe or even full path to .exe
- Quicklisp path: path to the `setup.lisp` file of quicklisp. Defaults to `~/quicklisp/setup.lisp`

## Compiling source

Clone the repository and change gradle.properties for your IDE.
Expand All @@ -58,6 +85,13 @@ You can also open this as a project in Intellij Idea.
* [ ] List of quicklisp installed packages / ASDF packages
* [ ] List of modified top level forms that are yet to be evaluated

### Far futures / possible goals

* [ ] Virtual Environment à la pycharm so you can specify which interpret instance you want
* [ ] Automatic download of lisp interpret and quicklisp
* [ ] Different lisp interpreter support
* [ ] Remote connections to interpreters

## License

This project is licensed under [Apache License v2](LICENSE.txt).
12 changes: 8 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "com.en_circle.slt"
version = "0.1.0"
version = "0.1.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -51,9 +51,13 @@ tasks {
}

signPlugin {
certificateChain.set(File("./signcerts/chain.crt").readText(Charsets.UTF_8))
privateKey.set(File("./signcerts/private.pem").readText(Charsets.UTF_8))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
try {
certificateChain.set(File("./signcerts/chain.crt").readText(Charsets.UTF_8))
privateKey.set(File("./signcerts/private.pem").readText(Charsets.UTF_8))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
} catch (_: Exception) {

}
}

publishPlugin {
Expand Down
3 changes: 3 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Report any bugs please!

I will think of what to write here at later date when it's bit bigger project.
42 changes: 27 additions & 15 deletions src/main/gen/com/en_circle/slt/plugin/lisp/LispParser.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/main/gen/com/en_circle/slt/plugin/lisp/psi/LispDatum.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/main/gen/com/en_circle/slt/plugin/lisp/psi/LispTypes.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main/java/com/en_circle/slt/plugin/SltSBCL.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public void stop() throws Exception {
listener.onPreStop();
}
try {
client.close();
if (client != null)
client.close();
} finally {
SltSBCLSymbolCache.INSTANCE.clear();
SwankServer.stop();
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/en_circle/slt/plugin/lisp/Lisp.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enhancement ::= REFERENCE_SET | REFERENCE_LABEL | TEST_SUCCESS | COMMA | BACKQUO

datum ::= tested | evaled | pathname | UNDEFINED_SEQUENCE | BIT_ARRAY | CHARACTER
| number | real_pair
| symbol
| compound_symbol
| string | vector | array | structure | list | pair

tested ::= (TEST_SUCCESS | TEST_FALURE) sexpr
Expand Down Expand Up @@ -67,7 +67,9 @@ integer ::= INTEGER_NUMBER

ratio ::= RATIO_NUMBER

symbol ::= UNINTERN? SYMBOL_TOKEN {
compound_symbol ::= UNINTERN? symbol

symbol ::= SYMBOL_TOKEN {
mixin="com.en_circle.slt.plugin.lisp.psi.impl.LispNamedElementImpl"
implements="com.en_circle.slt.plugin.lisp.psi.LispNamedElement"
methods=[getName setName getNameIdentifier]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ private static String getPackageName(LispList form) {
LispSexpr packageName = sexpressions.get(1);
if (packageName.getDatum() != null) {
LispDatum datum = packageName.getDatum();
if (datum.getSymbol() != null) {
String text = datum.getSymbol().getText();
if (datum.getCompoundSymbol() != null) {
LispCompoundSymbol symbolElement = datum.getCompoundSymbol();
String text = symbolElement.getSymbol().getText();
if (text.startsWith(":")) {
return text.substring(1);
} else if (!text.contains(":")) {
Expand All @@ -86,9 +87,9 @@ private static String getPackageName(LispList form) {
private static String getAsSymbol(LispSexpr seSymbol) {
LispDatum datum = seSymbol.getDatum();
if (datum != null) {
LispSymbol symbol = datum.getSymbol();
LispCompoundSymbol symbol = datum.getCompoundSymbol();
if (symbol != null) {
return symbol.getName();
return symbol.getSymbol().getName();
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public SltSettingsComponent() {
root = FormBuilder.createFormBuilder()
.addLabeledComponent(new JBLabel(SltBundle.message("slt.ui.settings.executable")),
sbclExecutable, 1, false)
.addLabeledComponent(new JBLabel(SltBundle.message("slt.ui.settings.port")),
port, 1, false)
.addLabeledComponent(new JBLabel(SltBundle.message("slt.ui.settings.qlpath")),
quicklispStartScript, 1, false)
.addComponentFillVertically(new JPanel(), 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.en_circle.slt.plugin.SltBundle;
import com.en_circle.slt.plugin.SltSBCL;
import com.en_circle.slt.plugin.SltState;
import com.en_circle.slt.plugin.swank.SwankServer;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.ProjectManager;
Expand Down Expand Up @@ -48,7 +49,7 @@ public boolean isModified() {
public void apply() throws ConfigurationException {
SltState settings = SltState.getInstance();
boolean restartServer = false;
if (!settings.sbclExecutable.equals(component.getSbclExecutable())) {
if (!component.getSbclExecutable().equals(settings.sbclExecutable)) {
restartServer = true;
}
if (component.getPort() != settings.port) {
Expand All @@ -59,7 +60,10 @@ public void apply() throws ConfigurationException {
}

settings.sbclExecutable = component.getSbclExecutable();
if (restartServer) {
settings.port = component.getPort();
settings.quicklispStartScript = component.getQuicklispStartScript();

if (restartServer && SwankServer.INSTANCE.isActive()) {
if (Messages.YES == Messages.showYesNoDialog(
SltBundle.message("slt.ui.settings.restart.prompt"),
SltBundle.message("slt.ui.settings.restart.title"),
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/messages/SltBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ slt.ui.debugger.frame.value=Value
slt.ui.settings.title=SLT Configuration
slt.ui.settings.executable=SBCL executable:
slt.ui.settings.qlpath=Quicklisp path:
slt.ui.settings.port=Swank port:
slt.ui.settings.restart.prompt=Settings changed, restart server?
slt.ui.settings.restart.title=Settings Changed
slt.ui.settings.restart.yes=Yes
Expand Down

0 comments on commit dae710a

Please sign in to comment.