Sharpy VSCode Extension

March 6, 2026 ยท View on GitHub

Installation

From Marketplace

Search for Sharpy in the VSCode Extensions panel (Ctrl+Shift+X / Cmd+Shift+X) and click Install.

Manual Install

Build the extension from source and install the .vsix file:

cd editors/vscode
npm install
npm run package
code --install-extension sharpy-*.vsix

Features

  • Syntax highlighting -- TextMate grammar for .spy files
  • LSP integration -- Full language server support via sharpyc lsp
  • Code snippets -- Common patterns (class, function, main, etc.)
  • Language configuration -- Bracket matching, comment toggling, auto-closing pairs

Settings Reference

All settings are prefixed with sharpy..

SettingTypeDefaultDescription
sharpy.server.pathstring"sharpyc"Path to the sharpyc executable
sharpy.server.argsstring[]["lsp"]Arguments passed to the language server
sharpy.trace.serverstring"off"Trace level for LSP communication ("off", "messages", "verbose")
sharpy.diagnostics.enabledbooleantrueEnable compiler diagnostics
sharpy.inlayHints.typeAnnotationsbooleantrueShow inferred type annotations
sharpy.inlayHints.parameterNamesbooleantrueShow parameter name hints in function calls
sharpy.codeLens.enabledbooleantrueShow reference counts and run buttons
sharpy.formatting.enabledbooleantrueEnable document formatting

Commands

CommandTitleDescription
sharpy.restartServerSharpy: Restart Language ServerRestart the LSP server process
sharpy.showOutputChannelSharpy: Show OutputOpen the Sharpy output channel for server logs

Keyboard Shortcuts

Standard VSCode/LSP shortcuts apply:

ShortcutAction
F2Rename symbol
F12Go to definition
Shift+F12Find all references
Ctrl+Shift+O / Cmd+Shift+OGo to symbol in file
Ctrl+T / Cmd+TGo to symbol in workspace
Ctrl+SpaceTrigger completion
Ctrl+Shift+SpaceTrigger signature help
Ctrl+. / Cmd+.Quick fix (code action)
Ctrl+Shift+I / Cmd+Shift+IFormat document

Troubleshooting

Check the Output Channel

Open the Sharpy output channel via the command palette: Sharpy: Show Output. This displays LSP server logs including startup messages, errors, and request traces.

Enable Trace Logging

Set sharpy.trace.server to "verbose" in your settings to see full JSON-RPC message traffic:

{
  "sharpy.trace.server": "verbose"
}

Restart the Server

If the language server becomes unresponsive, restart it via the command palette: Sharpy: Restart Language Server.

Verify Server Path

Ensure sharpyc is on your PATH or set sharpy.server.path to the full path:

{
  "sharpy.server.path": "/path/to/sharpyc"
}

Common Issues

IssueSolution
No diagnostics appearingCheck that sharpy.diagnostics.enabled is true and the server is running
Server not startingVerify sharpyc is installed and the path is correct
Slow completionsCheck the output channel for compilation errors slowing analysis
Extension not activatingEnsure the file has a .spy extension