Skip to content

xaxys/bubbler-vscode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bubbler-vscode

License PRs Welcome Release Visual Studio Marketplace Installs Visual Studio Marketplace Downloads

A bubbler language server for VSCode.

Powered by uni-vscode.

Quick install for VSCode: bubbler-vscode

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

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.

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 (0.14.3) application of Trash. trgen creates a standardized parser application from templates.

Recommand to use .Net5.0

cd Trgen
mkdir Generated
trgen -s proto
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.

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

5. Run VSCode, and install the .vsix

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.

About

A bubbler language server for VSCode.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages