Provides L4 support for VS Code.
<<<<<<< Updated upstream
=======
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.
Stashed changes
- Syntax highlighting (currently regex-based)
- Generate natural language output from L4
- Generate graph from L4 (WIP)
- Hover provider
- hover definitions
- type information
- Typechecking
- Error display
- 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':
- 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.
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)
If you'd like to contribute to the extension, please read the following sections for background information & future avenues of work.
- 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
- If you haven't built a VSCode extension before, VSCode's tutorial walks you through the steps to create a small extension. This will help demystify the setup process.
- Once you're done with setup, you can poke around the API documentation. Here are some of the features we've used in our extension:
- These might come in handy for future functionalities:
- It might also be helpful to look at the VSCode extension samples while making your way through the tutorials.
- Our extension supports syntax highlighting. VS Code’s tokenization engine is built on TextMate grammars, which rely on Oniguruma regular expressions.
- 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)
Basic syntax highlighting.
Please open an issue if you encounter any problems while using the extension.