A Language Server Protocol (LSP) implementation for DWScript (Delphi Web Script), providing IDE features like go-to-definition, hover, find-references, and diagnostics for DWScript projects.
- Diagnostics: Real-time compilation errors and warnings
- Hover: Symbol information (basic - shows symbol details)
- Go-to Definition: Navigate to symbol declarations
- Find References: Locate all symbol usages
- Document Symbols: Outline view of symbols in current file
- Document Highlight: Highlight symbol occurrences
- Code Completion: Context-aware suggestions using DWScript's suggestion engine
- Signature Help: Function parameter hints and overload information
- Stdio: Default mode for VS Code integration (dwsc.exe -type=ls)
- TCP Socket: Development/debugging mode (dwsc.exe -type=ls -tcp=8765)- Enables use with lsp-devtoolsfor protocol inspection
- Useful for testing and development
 
- Enables use with 
# Build the server
# The VS Code extension will automatically launch:
dwsc.exe -type=ls# Start server in TCP mode
dwsc.exe -type=ls -tcp=8765
# Record LSP session with lsp-devtools
lsp-devtools record --to-file session.json tcp://localhost:8765
# Or inspect in real-time
lsp-devtools inspect tcp://localhost:8765-type=ls                                 Run as Language Server
-LSPTrace=off|messages|verbose           Set logging level
-LSPLogPath=<path>                       Custom log file location
-tcp=<port>                              Use TCP socket (debugging mode)
-socket=<port>                           Alias for -tcp
Primary supported editor with dedicated extension in Clients/VSCode/.
The server follows LSP standards and should work with any LSP-compatible editor:
- Neovim: Via nvim-lspconfig
- Emacs: Via lsp-mode
- Sublime Text: Via LSP plugin
- Vim: Via various LSP plugins
Configure your editor to launch: dwsc.exe -type=ls
dwsc.exe
├─ Stdio Transport (default)     - For VS Code integration
├─ TCP Transport (optional)      - For debugging with lsp-devtools
├─ LSP Message Handling          - Complete lifecycle management
├─ DWScript Compiler Integration - Diagnostics and symbol resolution
└─ Comprehensive Logging         - Trace levels and rotating logs
- Requirements: Delphi (tested with recent versions)
- Dependencies: DWScript library (included as git submodule)
- Build: Compile Server/dwsc.dpr
# Unit tests
cd UnitTest && dcc32 dwscTest.dpr && dwscTest.exe
# Protocol tests (requires Python)
cd Tests/Protocol && python -m pytest test_lifecycle.py -v
# Manual testing with lsp-devtools
dwsc.exe -type=ls -tcp=8765 -LSPTrace=verboseLogs are written to %TEMP%/dwsc-lsp-*.log with configurable trace levels:
- off: No logging
- messages: Log LSP message names and timing
- verbose: Full message content (sanitized for PII)
This is an active development project following a phased implementation plan:
- Phase 0 (Foundation): ✅ Transport, lifecycle, basic debugging tools
- Phase 1 (Document Sync): 🚧 Incremental text synchronization, workspace indexing
- Phase 2 (Core Features): 🚧 Improved hover, completion, error handling
- Phase 3 (Advanced): 🚧 Rename, semantic tokens, code actions
See PLAN.md for detailed roadmap and progress tracking.
- Check PLAN.md for current development priorities
- Follow the phased approach for implementing features
- Ensure all changes include appropriate logging
- Test with both stdio and TCP transports
- Update tests and documentation
[Check license file for details]