| .. | ||
| .vscode | ||
| client/src | ||
| server/src | ||
| .gitignore | ||
| .vscodeignore | ||
| bun.lock | ||
| example.sh | ||
| icon.png | ||
| language-configuration.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
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)
.shfile association
Development Workflow
Developing the extension:
- Open
vscode-extension/in VSCode - Run
bun run watchin a terminal (keeps it compiling as you make changes) - Use Run > Start Debugging to launch Extension Development Host
- Make changes to the code
- Press Cmd+R (or Ctrl+R) in the Extension Development Host window to reload
- 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.binaryPathsetting)