Ganjaboy3942 / Pharo-LanguageServer

A Language Server Protocol implementation in Pharo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pharo Language Server

Continuous Pharo 9 Moose version

I am an implementation of the Language Server Protocol (LSP) for the Pharo programming language. My main goal is to provide a unique interface for several generic IDE to manipulate a Pharo environment.

I am used by the following client extensions:

Features

As a language server, I accept two Pharo/SmallTalk formats:

  • .st for smalltalk script (as you can see in a playground).
  • .class.st for tonel files.

Most of the features are available for both formats.

  • Code highlighting
  • Hover
  • Auto-completion

Script specific features

  • Code formatting

Tonel specific features

  • Saving the file create/update the corresponding class in the image

Installation

There is two ways to download this project:

  • by downloading a pre-build image (in releases or from the pharo launcher)
  • by loading the code in a Pharo Image

Add project in PharoLauncher

To add this project into the pharo launcher:

  1. Download the PharoLauncher
  2. Open PharoLauncher
  3. Open a playground (Ctrl + O, Ctrl + W)
  4. Execute the following piece of code
| sources |
sources := {
    PhLTemplateSource new
        type: #HttpListing;
        name: 'Pharo Language Server';
        url: 'https://github.com/badetitou/Pharo-LanguageServer/releases';
        filterPattern: 'href="([^"]*/(Pharo|Moose)[0-9][^"]*.zip)"';
        templateNameFormat: '{6} ({5})' }.
    PhLUserTemplateSources sourcesFile writeStreamDo: [ :s | 
        (STON writer on: s)
            newLine: String lf;
            prettyPrint: true;
            nextPut: sources ]

Load the code

Execute this code in any Pharo Image

Metacello new
  githubUser: 'badetitou' project: 'Pharo-LanguageServer' commitish: 'v2' path: 'src';
  baseline: 'PharoLanguageServer';
  load

About

A Language Server Protocol implementation in Pharo

License:GNU General Public License v3.0


Languages

Language:Smalltalk 98.0%Language:StringTemplate 2.0%