-
Notifications
You must be signed in to change notification settings - Fork 1
feat: integrate Gregorio Language Server Protocol (LSP) #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
lbssousa
wants to merge
10
commits into
main
Choose a base branch
from
feat/lsp-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add comprehensive LSP integration for advanced GABC language features. Features Added: - Language Server Protocol client implementation (lsp-client.js) - Real-time semantic validation of GABC/NABC files - Quilisma validation with glyph break suggestions - NABC-lines alternation validation - Header validation with error checking - Status bar indicator for LSP connection status - Command to restart language server Configuration: - Add 5 new settings under 'Gregorio LSP' * maxNumberOfProblems: limit diagnostic count * enableSemanticValidation: toggle validation * enableNabcLinesValidation: toggle NABC checks * strictAlternationChecking: error vs warning mode * enableQuilismaValidation: toggle quilisma checks Implementation: - lsp-client.js: LSP client with auto-discovery of server - main.js: integrated LSP activation/deactivation - package.json: added configuration section and dependencies - LSP_INTEGRATION.md: complete setup and usage documentation Dependencies: - Added vscode-languageclient@9.0.1 Server Discovery: The client automatically searches for gregorio-lsp in: 1. Adjacent directory (development setup) 2. node_modules (package installation) 3. Global installation path Graceful Degradation: If LSP server is not found, extension continues with basic features and shows informational message about missing server. Version: 1.1.0 → 1.2.0
Major improvements to LSP integration: BUNDLED SERVER: - Add gregorio-lsp as Git submodule in server/ - Automatic compilation on npm install (postinstall script) - No external dependencies required - Update command: npm run update-server - Falls back gracefully if external server configured but not found CONFIGURATION OPTIONS: - gregorioLsp.enabled: Enable/disable LSP entirely - gregorioLsp.serverPath: 'bundled' (default) or 'external' - gregorioLsp.externalServerPath: Path to external server - gregorioLsp.trace.server: Debug communication (off/messages/verbose) SERVER DISCOVERY: Priority order: 1. Check if LSP is enabled in settings 2. If serverPath='external', try externalServerPath 3. Try bundled server (server/out/server.js) 4. Try fallback locations (development, node_modules, global) 5. Show error if none found NPM SCRIPTS: - npm run compile: Compile bundled server - npm run compile:server: Compile server only - npm run watch:server: Watch mode for server development - npm run update-server: Update submodule and recompile - npm run postinstall: Auto-compile on install DOCUMENTATION: - Updated LSP_INTEGRATION.md with submodule setup - Added SERVER_README.md for submodule management - Updated CHANGELOG.md with new features - Added configuration examples for all scenarios IMPROVEMENTS: - Better error messages with configuration hints - Graceful degradation when server not available - Output channels for debugging (LSP + Trace) - Configuration validation before activation - Proper cleanup on deactivation FILES: - .gitignore: Ignore server build artifacts - .gitmodules: Submodule configuration - lsp-client.js: Enhanced server discovery logic - package.json: New scripts and configuration options - PR_DESCRIPTION.md: Updated PR description - SERVER_README.md: Submodule documentation This makes the extension fully self-contained while still allowing developers to use external servers for testing.
…de intelligence - Add tree-sitter-gregorio as Git submodule in parser/ directory - Implement tree-sitter-provider.js with 4 providers: * Semantic tokens provider (context-aware syntax highlighting) * Document symbols provider (outline view) * Folding ranges provider (structural code folding) * Selection ranges provider (smart selection) - Add 3 new configuration options under gregorioTreeSitter: * enabled: Enable/disable tree-sitter features (default: true) * bundledPath: Path to bundled parser (default: 'parser') * externalPath: Path to external parser for development - Add 'GABC: Reload Tree-sitter Parser' command - Add NPM scripts: compile:parser, watch:parser, update-parser - Update .gitignore to exclude parser build artifacts - Create comprehensive documentation: * TREE_SITTER_INTEGRATION.md: Technical integration guide * TREE_SITTER_COMPARISON.md: Visual comparison TextMate vs Tree-sitter * TREE_SITTER_EXAMPLE.md: Implementation examples * PARSER_README.md: Submodule management guide - Update LSP_INTEGRATION.md with tree-sitter information - Update CHANGELOG.md for v1.3.0 - Implement hybrid architecture: TextMate + Tree-sitter working together - Add tree-sitter dependency (v0.21.0) - Intelligent server discovery with priority: external → bundled → node_modules - Graceful fallback to TextMate when tree-sitter unavailable
lbssousa
added a commit
that referenced
this pull request
Oct 19, 2025
Adiciona suporte completo a macros LaTeX para todos os cabeçalhos documentados: ✨ Novos cabeçalhos com LaTeX (3 tipos): - mode-differentia: Diferenças modais com formatação LaTeX - mode-modifier: Modificadores de modo com LaTeX - def-m0 até def-m9: Definições de macros com numeração destacada 🎨 Destaques especiais: - Números em def-m# recebem escopo constant.numeric.integer (verde) - Padrão separado para capturar prefixo e número individualmente - Consistência com headers LaTeX existentes 📝 Total de headers LaTeX: 10 tipos (20 variações com def-m0..9) 🔧 Alterações técnicas: - syntaxes/gabc.tmLanguage.json: linhas 131-168 * Novo padrão meta.header.def-macro.gabc (26 linhas) * Expandido meta.header.with-latex.gabc (2 novos headers) - Todos os patterns incluem latex-verbatim e latex-inline-command ✅ Validação: - JSON sem erros de sintaxe - Arquivo de teste com 60+ casos - Documentação completa (1300+ linhas) 📚 Documentação criada: - EXTENSION_ALL_LATEX_HEADERS.md: Análise completa - test-all-latex-headers.gabc: Suite de testes abrangente Refs: #9 - Implementações de melhorias de sintaxe
Resolved conflicts in package.json and package-lock.json: - Updated package name to 'gregorio' (from 'gabc-gregorian-chant-notation') - Maintained version 1.2.0 - Preserved LSP dependencies (tree-sitter, vscode-languageclient) - Updated engines.vscode to ^1.96.0 Merged changes from main: - Documentation updates in docs/ directory - Syntax highlighting improvements - CHANGELOG and README updates - Command title updates (GABC → Gregorio)
…tallation - Remove server and parser submodules (.gitmodules, .git/modules) - Add install-deps.js script for automatic GitHub release-based installation - Add install-deps.sh as Bash alternative for CI/CD environments - Update package.json scripts (install-deps, postinstall, compile, update-*) - Modify .gitignore to ignore entire server/ and parser/ directories - Add comprehensive DEPENDENCY_MANAGEMENT.md documentation - Add MIGRATION_FROM_SUBMODULES.md migration guide - Add scripts/README.md for quick reference Features: - Installs latest tagged release from GitHub (with fallback to main) - Automatic compilation via postinstall hook - Version tracking and reproducible builds - Colored console output for better UX - Error handling and retry logic Breaking Change: - server/ and parser/ directories no longer tracked in Git - Run 'npm install' to download and compile dependencies Benefits: - Semantic versioning with release tags - Reproducible builds across environments - Simplified Git workflow - Reduced repository size - CI/CD friendly (no submodule complexity) - Clear version tracking Tested: - ✅ install-deps.js successfully installs and compiles both dependencies - ✅ Fallback to main branch works when no releases exist - ✅ Server compiles to TypeScript → JavaScript - ✅ Parser generates and compiles native bindings - ✅ Extension loads correctly with compiled dependencies
- Add NEXT_STEPS.md with recommended actions post-migration - Include guidance for creating first releases - Document CI/CD updates needed - Provide long-term improvement suggestions - Add testing and automation recommendations
- Update install-deps.js to check for tags when no releases exist - Update install-deps.sh with same fallback logic - Priority: releases → tags → main branch - Tested with v0.1.0 tags successfully This allows using Git tags (v0.1.0) without requiring formal GitHub releases, making the version management more flexible. Tested: ✓ Detects tags v0.1.0 correctly for both dependencies ✓ Clones correct version ✓ Compiles successfully ✓ Both server and parser at version 0.1.0
- Document v0.1.0 tag deployment for both dependencies - Explain tag detection fallback mechanism (releases → tags → main) - Provide guidelines for semantic versioning - Include troubleshooting and best practices - Document version history and verification methods - Outline migration path to GitHub Releases Current versions: - gregorio-lsp: v0.1.0 (commit 794b5b1) - tree-sitter-gregorio: v0.1.0 (commit 38aab61)
- Comprehensive checklist for verifying v0.1.0 tag deployment - Step-by-step verification procedures - Quick verification commands - Troubleshooting references - Status tracking template This ensures the tagging process was successful and all components are working correctly.
- Update launch.json with LSP server debugging configuration - Add vscode-gregorio.code-workspace with LSP tracing enabled - Create LSP_DEBUGGING.md with complete debugging guide - Add configuration for attaching to LSP server on port 6009 Debugging features: - Two debug configurations: Run Extension + Attach to LSP Server - Verbose logging enabled by default in workspace - Step-by-step debugging instructions - Troubleshooting checklist - Test cases for NABC-lines validation - Output channel monitoring guide This makes it easier to debug and verify LSP functionality, especially for NABC-lines alternation pattern validation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrate Gregorio Language Server Protocol (LSP)
🎯 Overview
This PR adds comprehensive Language Server Protocol (LSP) integration to the VS Code GABC extension, enabling advanced language features for GABC/NABC files.
✨ Features Added
Core LSP Integration
lsp-client.js)Validation Features
!before quilisma)User Interface
Configuration
Five new settings under "Gregorio LSP":
maxNumberOfProblemsenableSemanticValidationenableNabcLinesValidationstrictAlternationCheckingenableQuilismaValidation📁 Files Changed
New Files
lsp-client.js- LSP client implementation with auto-discoveryLSP_INTEGRATION.md- Complete setup and usage documentationModified Files
main.js- Integrated LSP activation/deactivationpackage.json- Added configuration section, dependencies, and commandspackage-lock.json- Updated with new dependenciesCHANGELOG.md- Documented v1.2.0 changes🔧 Technical Details
Server Discovery
The client searches for
gregorio-lspin order:../gregorio-lsp/out/server.js(development setup)node_modules/gregorio-lsp/out/server.js(package)../../gregorio-lsp/out/server.js(global)Dependencies
vscode-languageclient@^9.0.1Activation
onLanguage:gabcevent📚 Documentation
LSP_INTEGRATION.md includes:
Example Usage
Quilisma Validation
NABC-lines Validation
🧪 Testing
Manual Testing Checklist
Test Files
Use existing test files:
examples/*.gabc- Various GABC examples🔗 Related Work
Depends On
c5a56f4,610c547,c11ee79Integration Points
📈 Version
🎯 Next Steps
After this PR is merged:
gregorio-lspas NPM package🚧 Draft Status
This PR is in draft mode for:
📝 Checklist
💬 Feedback Welcome
Please test the integration and provide feedback on:
Related Issues: N/A (new feature)
Related PRs: N/A
Dependencies: gregorio-lsp repository