An open API service indexing awesome lists of open source software.

https://github.com/xaxys/bubbler-vscode

A bubbler language server for VSCode.
https://github.com/xaxys/bubbler-vscode

Last synced: about 1 month ago
JSON representation

A bubbler language server for VSCode.

Awesome Lists containing this project

README

        

# bubbler-vscode

[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/xaxys/bubbler-vscode/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/xaxys/bubbler-vscode/pulls)
[![Release](https://img.shields.io/github/v/release/xaxys/bubbler-vscode.svg)](https://github.com/xaxys/bubbler-vscode/releases)
[![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/xaxys.Bubbler)](https://marketplace.visualstudio.com/items?itemName=xaxys.Bubbler)
[![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/xaxys.Bubbler)](https://marketplace.visualstudio.com/items?itemName=xaxys.Bubbler&ssr=false#version-history)

A bubbler language server for VSCode.

Powered by [uni-vscode](https://github.com/kaby76/uni-vscode).

Quick install for VSCode: [bubbler-vscode](https://marketplace.visualstudio.com/items?itemName=xaxys.Bubbler)

This is a "bubbler language" vscode extension based on Antlr and Language Server Protocol. It is useful for quick parsing checks using VSCode. Semantic highlighting is the only major component implemented because static semantics computations (aka attributes) are not implemented for grammars.

The code is divided into two parts:
Server and Client:

* The server (with Logger, LspHelpers, and Workspaces) is C# code that
implements an LSP server.
* The client is Typescript code that implemements the client VSCode
extension.

## How to build this extension

### 1. You will need prerequisites

* [.NET SDK](https://dotnet.microsoft.com/) (7.0 or higher)
* [Trash](https://github.com/kaby76/Domemtech.Trash#install) (0.14.3)

### 2. Clone the repo. Run dotnet to build the language server

The server is a C# program that reads stdin and writes to stdout. VSCode will redirect the input and output in order to communicate with the server.

```sh
git clone https://github.com/xaxys/bubbler-vscode.git
cd bubbler-vscode
dotnet build
```

### 3. Create (or copy) an Antlr4 Bubbler grammar

The grammar must be processed by the [trgen](https://github.com/kaby76/Domemtech.Trash/tree/main/trgen) (0.14.3) application of Trash. `trgen` creates a standardized parser application from templates.

Recommand to use .Net5.0

```sh
cd Trgen
mkdir Generated
trgen -s proto
```

```sh
cd Generated
dotnet build
```

### 4. Copy the language server and the generated parser, then run the "install.sh" script to create the extesion for VSCode

The client is a thin layer of code in Typescript. The "install.sh" script builds the .vsix file which you can install.

```sh
cd VsCode
bash clean.sh && bash install.sh
```

### 5. Run VSCode, and install the .vsix

```sh
code .
```

In VSCode, open a file (e.g., a Bubbler source file). In the lower right corner, there is a type. Change the type of the file to "Bubbler". It takes a little while, but it should colorize the source file.

## Implementation

* LSP server in C#.
* VSCode client code in Typescript.
* Grammars are implemented in Antlr4. The parser driver is implemented using [trgen](https://github.com/kaby76/Domemtech.Trash/tree/main/trgen).