Skip to content

Commit

Permalink
add usage explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Feb 7, 2024
1 parent f8de64d commit 0b26eb7
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ My main goal is to provide a unique interface for several generic IDE to manipul
I am used by the following client extensions:

- [vscode-pharo](https://github.com/badetitou/vscode-pharo)
- [vscode-eclipse](https://github.com/badetitou/eclipse-pharo) *Really only a POC. But you might be interested to have a look at it.*

> If you experiement with other IDE, do not hesitate to contact us in an Issue :)
## Features

Expand All @@ -35,7 +38,6 @@ Most of the features are available for both formats.

## Installation


Execute this code in any Pharo10/11 Image

```Smalltalk
Expand All @@ -44,3 +46,39 @@ Metacello new
baseline: 'PharoLanguageServer';
load
```

> Or download a pre-existing image in the [release](https://github.com/badetitou/Pharo-LanguageServer/releases) section.
## Usage

Once you have an image with the project installed, you can run it using

```sh
/path/to/vm/pharo [--headless] /path/to/pls.image st /path/to/run-server.st
```

In above example, we used an another file named `run-server.st` that is used to define the Pharo script that run the code.
You can find the definition of this file for the [vscode extension](https://github.com/badetitou/vscode-pharo/blob/main/res/run-server.st) and for the [eclipse extension](https://github.com/badetitou/eclipse-pharo/blob/main/res/run-server.st).

Basically the file looks like this

```st
| server |
"Stop and reset potential existing instance in the image you start"
PLSServer reset.
"Create a new Language Server"
server := PLSServer new.
"Start the new language server"
server start.
```

By default, the server will start a socket and give you the port of the opened socket in the standard output.
If you want to use standard input/ouput to deal with communication, you can use the folowing option:

```st
server := PLSServer new
withStdIO: true;
yourself
```

> This option is less tested and might create bug with Pharo writing to the standard output for other reason

0 comments on commit 0b26eb7

Please sign in to comment.