50 lines
1.8 KiB
Markdown
50 lines
1.8 KiB
Markdown
# Shrimp VSCode Extension
|
|
|
|
Language support for Shrimp in VSCode. This README is for probablycorey and defunkt.
|
|
|
|
**What it provides:**
|
|
|
|
- Syntax highlighting and semantic tokens
|
|
- Language server with error diagnostics
|
|
- Commands: "Show Parse Tree" (Alt+K Alt+I), "Show Bytecode" (Alt+K Alt+,), and "Run File" (Cmd+R)
|
|
- `.sh` file association
|
|
|
|
## Development Workflow
|
|
|
|
**Developing the extension:**
|
|
|
|
1. Open `vscode-extension/` in VSCode
|
|
2. Run `bun run watch` in a terminal (keeps it compiling as you make changes)
|
|
3. Use **Run > Start Debugging** to launch Extension Development Host
|
|
4. Make changes to the code
|
|
5. Press **Cmd+R** (or Ctrl+R) in the Extension Development Host window to reload
|
|
6. Repeat steps 4-5
|
|
|
|
The `.vscode/launch.json` is configured to compile before launching and use a separate "Shrimp Dev" profile. This means you can have the extension installed in your main VSCode while developing without conflicts.
|
|
|
|
**Installing for daily use:**
|
|
|
|
Run `bun run build-and-install` to build a VSIX and install it in your current VSCode profile. This lets you use the extension when working on Shrimp scripts outside of development mode.
|
|
|
|
## Project Structure
|
|
|
|
The extension has two parts: a **client** (`client/src/extension.ts`) that registers commands and starts the language server, and a **server** (`server/src/`) that implements the Language Server Protocol for diagnostics and semantic highlighting.
|
|
|
|
Both compile to their respective `dist/` folders.
|
|
|
|
## Next Steps
|
|
|
|
**Autocomplete:**
|
|
|
|
- [ ] Identifiers in scope
|
|
- [ ] Globals from the prelude (including native functions)
|
|
- [ ] Imports
|
|
- [ ] Dot-get properties
|
|
- [ ] Function argument completion
|
|
|
|
**Other features:**
|
|
|
|
- [ ] Better syntax coloring
|
|
- [ ] REPL integration
|
|
- [ ] Bundle shrimp binary with extension (currently uses `shrimp.binaryPath` setting)
|