shrimp/vscode-extension
2025-12-09 08:13:11 -08:00
..
.vscode cool 2025-11-04 15:52:39 -08:00
client/src Add run! 2025-11-04 16:25:22 -08:00
scripts Shrimp was broken 2025-11-24 12:19:58 -08:00
server/src unused import 2025-12-09 08:12:37 -08:00
.vscodeignore Basic vscode works! 2025-11-03 17:19:29 -08:00
bun.lock extension is working! 2025-11-04 13:59:22 -08:00
example.shrimp Shrimp was broken 2025-11-24 12:19:58 -08:00
icon.png Basic vscode works! 2025-11-03 17:19:29 -08:00
language-configuration.json neat 2025-11-04 14:57:13 -08:00
package.json Shrimp was broken 2025-11-24 12:19:58 -08:00
README.md Add run! 2025-11-04 16:25:22 -08:00
tsconfig.json extension is working! 2025-11-04 13:59:22 -08:00

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)