Skip to main content

Generate a VSCode extension with LSP server from an Antlr4 grammar. This program is part of the Trash toolkit.

Total Downloads
23.6K
23,565
Published
Jul 6, 2025
1y ago

Get Started

dotnet add package trgenvsc --version 0.23.23

No framework information available.

README

trgenvsc

Summary

Generate a VSCode extension and LSP server for an Antlr4 grammar.

Description

Generates a Visual Studio Code extension from an Antlr4 grammar. A CSharp target must be available for the grammar as the LSP server is implemented in C#.

After generating the extension/server, proceed to building the extension by changing to the "Generated-vsc/" directory, then running "bash install.sh". The install.sh script performs the build of the C# server, and the TypeScript extension. The script will also create a settings.rc JSON file that describes the syntactic highlighting for the grammar. The script calls an auxilary Python program to examine the grammar for single-character string literals, and using the Unicode category to group these in a common class with a particular color. You can modify the settings.rc file to perform semantic highlighting by adjusting the XPath patterns to match certain parse trees.

Usage

trgenvsc * 

Examples

trgenvsc

Current version

0.23.23 (Updates to trgen templates.)

License

The MIT License

Copyright (c) 2024 Ken Domino

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Downloads by Version

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.