Complete language support for the Ahoy programming language, including syntax highlighting and Language Server Protocol (LSP) integration.
Full syntax highlighting for all Ahoy language features:
- Keywords:
if,then,else,anif,loop,do,return,function,local,end, etc. - Functions and variables
- Operators:
+,-,*,/,==,>,<, etc. - Word operators:
plus,minus,times,div,is,greater_than,and,or, etc. - Comments:
--and? comment style - Strings and numbers
- Tables and arrays
Intelligent code assistance powered by the Ahoy Language Server:
- Real-time Diagnostics: Syntax error checking and linting as you type
- Go to Definition: Jump to function and variable definitions (F12 or Ctrl+Click)
- Hover Information: View type information and documentation on hover
- Autocompletion: Context-aware code completion (Ctrl+Space)
- Document Symbols: Navigate file structure with outline view (Ctrl+Shift+O)
- Code Actions: Quick fixes and refactoring suggestions (Ctrl+.)
- Auto-closing brackets:
{},[],(),"" - Comment toggling with
-- - Smart bracket matching and indentation
The Language Server requires the ahoy-lsp binary to be installed. See LSP_SETUP.md for detailed installation instructions.
Quick install:
cd ../ahoy/lsp
./build.sh
./install.shThis installs ahoy-lsp to /usr/local/bin/.
code --install-extension ahoy-lang-0.1.0.vsix-
Clone and build:
cd vscode-ahoy npm install npm run compile npm run package -
Install:
code --install-extension ahoy-lang-0.1.0.vsix
-
Restart VS Code
- Open any
.ahoyfile - Syntax highlighting activates automatically
- LSP features activate if
ahoy-lspis installed - Check status: View → Output → "Ahoy Language Server"
Run the test script to validate your setup:
./test_lsp.shThis will:
- Verify
ahoy-lspis installed - Build and install the extension
- Create test files with various features
- Open VS Code with the test workspace
Create a test file test.ahoy:
-- Test LSP features
function add(a, b)
return a + b
end
function greet(name)
print("Hello, " .. name)
end
local result = add(5, 10)
greet("World")
Try these features:
- Diagnostics: Add a syntax error and see red squiggles
- Go to Definition: Ctrl+Click on
addin the last lines - Hover: Hover over
function,add, orresult - Completion: Type
funand press Ctrl+Space - Symbols: Press Ctrl+Shift+O to see outline
- Problems: Press Ctrl+Shift+M to see all diagnostics
function fibonacci(n)
if n <= 1 then do
return n
end
return fibonacci(n - 1) + fibonacci(n - 2)
end
function factorial(n)
if n <= 1 then do
return 1
end
return n * factorial(n - 1)
end
local count = 0
local message = "Hello, Ahoy!"
local numbers = {1, 2, 3, 4, 5}
local person = {
name = "Alice",
age = 30,
city = "Wonderland"
}
if score > 90 then do
print("Excellent!")
elseif score > 80 then do
print("Great!")
else
print("Keep trying!")
end
-- For loop
for i = 1, 10, 1 do
print("Iteration: " .. i)
end
-- While loop
while count < 100 do
count = count + 1
end
The extension currently uses default settings. Future versions will support:
- Custom path to
ahoy-lspbinary - LSP logging level
- Linting strictness
- Formatting preferences
- Check Output Panel: View → Output → "Ahoy Language Server"
- Verify Installation: Run
which ahoy-lspin terminal - Restart Extension Host: Ctrl+Shift+P → "Restart Extension Host"
- Check Developer Console: Help → Toggle Developer Tools
- Verify
.ahoyfile extension is recognized - Check language mode in bottom-right corner (should show "Ahoy")
- Reinstall extension:
code --install-extension ahoy-lang-0.1.0.vsix --force
- Go to Definition: Requires valid syntax and symbol table
- Hover: Works on keywords, functions, and variables
- Completion: Available for keywords and operators
- Cross-file: Not yet supported (single-file analysis only)
See LSP_SETUP.md for detailed troubleshooting.
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension
npm run package- Open
vscode-ahoyfolder in VS Code - Press F5 to launch Extension Development Host
- In the new window, open a
.ahoyfile - Test LSP features and check console for logs
After changes to ../ahoy/lsp:
cd ../ahoy/lsp
go build -o ahoy-lsp .
sudo cp ahoy-lsp /usr/local/bin/Restart VS Code extension host to pick up the new binary.
- Column positions may be approximate for some AST nodes
- Cross-file symbol resolution not yet implemented
- Semantic tokens currently disabled
- Large files (>1000 lines) may have slower response times
- Syntax highlighting
- Language configuration
- LSP integration
- Diagnostics
- Go to definition
- Hover information
- Code completion
- Document symbols
- Code actions
- Precise column tracking in parser
- Find all references
- Rename refactoring
- Semantic token highlighting
- Workspace symbols
- Cross-file analysis
- Code formatting
- Snippet library
- Signature help
- Debugging support
- REPL integration
- Configurable linting rules
- LSP Setup Guide - Detailed installation and configuration
- Development Guide - Contributing and development setup
- Testing Guide - Automated testing script
Contributions are welcome! Please:
- Check existing issues or create a new one
- Fork the repository
- Make your changes with tests
- Submit a pull request
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Ahoy Language Docs
MIT License - See LICENSE file for details
- Built with vscode-languageclient
- LSP implementation using go.lsp.dev
- Inspired by the Language Server Protocol specification
New Features:
- Complete LSP integration with ahoy-lsp server
- Real-time syntax error diagnostics
- Go to definition for functions and variables
- Hover information with type details
- Context-aware autocompletion
- Document symbol outline
- Code actions and quick fixes
- Enhanced syntax highlighting
Improvements:
- Updated language configuration
- Better bracket matching
- Improved comment handling
Known Issues:
- Column positions may be approximate
- Cross-file features not yet available
- Semantic tokens temporarily disabled
Happy coding with Ahoy! 🚀⚓