Skip to content

smucclaw/ide

Repository files navigation

L4 Language Support for VS Code

Provides L4 support for VS Code.

<<<<<<< Updated upstream

Preview

=======

Features

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.

For example if there is an image subfolder under your extension project workspace:

![feature X](images/feature-x.png)

Tip: Many popular extensioinns utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.

Autocompletion

class attributes after a dot

What does Hover show?

Stashed changes

First preview screenshot

Features

  • Syntax highlighting (currently regex-based)
  • Generate natural language output from L4
  • Generate graph from L4 (WIP)

LSP support:

  • Hover provider
    • hover definitions
    • type information
  • Typechecking
  • Error display

Installation & Prerequisites

  • Follow installation instructions over at the baby-l4 repository to install L4
  • Clone this repository
  • Open this repository in VS Code, then press F5. This will compile and run the extension in a new Extension Development Host window.
  • Open any .l4 file in the Extension Development Host window
  • To see LSP output while the extension is running, go to the Output tab (to the left of the VSCode terminal) and toggle the dropdown at the top right corner to 'L4 Language Server':

Output panel

  • Errors will be displayed in the Problems tab
  • NOTE: This codebase is evolving quickly and in tandem with the other repositories like baby-l4, so you need to be familiar with those tracks of development. The best way to come up to speed is an in-person tutorial with the IDE developers; anything else risks this documentation going out of date. When the codebase matures and stabilizes we will add more developer-facing documentation.

Commands

Accessed by opening the command palette (Ctrl+Shift+P on Linux/Windows and Cmd+Shift+P on Mac), and entering the command name:

  • Generate markdown (natural language output)
  • Generate graph (via dot file) (WIP)

For Contributors:

If you'd like to contribute to the extension, please read the following sections for background information & future avenues of work.

What exactly happens when I run the IDE extension?

Client-Server-LSP diagram

  • The extension provides a Language Client and a Language Server for L4
  • When the extension is activated, it starts the Language Client and spawns the Language Server in another process and communicates with it through the Language Server Protocol.
  • When you do something with a .l4 file, like hover over a line of code, VS Code informs the client of the hover, and the client sends a query to the server for a hover result. This result is sent back to VS Code, and finally the editor displays the hover result in a Hover widget
  • See also: VSCode's Language Server Extension Guide

What are some things I should read to get started?

Future Work

  • A custom command to generate & display a graph from the dot output produced by L4
  • Tests. Currently the tests that exist cover lsp features. It might be a good idea to write tests for the mkMarkdown and mkGraph commands eventually
  • Semantic highlighting (when the codebase is more mature)

Release Notes

0.0.1

Basic syntax highlighting.

Troubleshooting

Please open an issue if you encounter any problems while using the extension.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published