-
-
Notifications
You must be signed in to change notification settings - Fork 179
feat: enable LSP (Language Server Protocol) infrastructure #2477
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
Open
charlypa
wants to merge
6
commits into
phcode-dev:main
Choose a base branch
from
charlypa:claude/enable-js-lsp-011CUtoDV259DVqhmWSsRFDk
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.
Open
feat: enable LSP (Language Server Protocol) infrastructure #2477
charlypa
wants to merge
6
commits into
phcode-dev:main
from
charlypa:claude/enable-js-lsp-011CUtoDV259DVqhmWSsRFDk
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
This commit enables the complete LSP infrastructure that was previously disabled in Phoenix. The LSP system provides a foundation for language server integration supporting features like code completion, parameter hints, jump to definition, find references, and diagnostics. Changes: - Enabled LSP initialization in ClientLoader.js by uncommenting initDomainAndHandleNodeCrash() call - Enabled LSP unit tests in UnitTestSuite.js The LSP infrastructure includes: - Complete Language Client implementation with Node.js bridge - Protocol adapter for LSP communication (JSON-RPC over IPC/stdio) - Default providers for code hints, parameter hints, and navigation - Support for all standard LSP features defined in ToolingInfo.json - Test suite with mock language servers This enables the platform for JavaScript/TypeScript and other language server integrations. Language-specific clients can now be registered using LanguageTools.initiateToolingService() API.
…LSP support This commit adds full Language Server Protocol (LSP) support for JavaScript, TypeScript, JSX, and TSX files using the TypeScript language server. Changes: - Created TypeScriptLanguageServer extension in src/extensions/default/ - Installed typescript-language-server v5.1.1 and typescript dependencies - Registered extension in DefaultExtensions.json - Configured language server to use stdio communication Extension Components: 1. client.js (Node.js side) - Spawns typescript-language-server process - Configures server with --stdio communication - Sets up TypeScript preferences and initialization options 2. main.js (Phoenix/Brackets side) - Registers LSP client for ['javascript', 'typescript', 'jsx', 'tsx'] - Integrates with LanguageTools.initiateToolingService API - Provides preference to enable/disable: languageTools.enableTypeScriptLSP Features Enabled: - Intelligent code completion with IntelliSense - Parameter hints and signature help - Jump to definition/declaration/implementation - Find all references - Document symbols (outline) - Workspace symbols (project-wide search) - Real-time error detection and diagnostics - Rename refactoring - Auto-imports The TypeScript language server provides advanced TypeScript and JavaScript code intelligence, significantly enhancing the development experience for web developers using Phoenix.
Add test file with comprehensive examples to verify TypeScript language server integration. File includes tests for: - Code completion - Hover information - Error detection - Function parameter hints - Jump to definition - Type inference - JSDoc support This file can be opened in Phoenix to manually verify all LSP features are working correctly.
The path to typescript-language-server was incorrect (3 levels up instead of 4). Fixed path: src/extensions/default/TypeScriptLanguageServer/ → project root - Was: ../../../node_modules/ (goes to src/node_modules - wrong!) - Now: ../../../../node_modules/ (goes to project root - correct!) Also added architecture documentation to clarify: - Phoenix runs in browser - client.js runs in Node.js via NodeDomain - Language server runs as child process of client.js - LSP protocol bridges browser ↔ Node.js ↔ language server This was a critical bug that would prevent the language server from starting because it couldn't find the typescript-language-server binary.
Add diagnostic script to verify TypeScript LSP integration is ready to test. The script checks: - LSP infrastructure is enabled - Extension is registered - Extension files exist - typescript-language-server is installed and executable - Path resolution is correct - All components can be found Usage: node check-lsp-ready.js This helps quickly verify everything is set up correctly before attempting to test in the browser.
- Mark extension as nodeIsRequired: true (desktop app only) - Required because LSP integration uses NodeDomain - Follows Phoenix extension metadata conventions
|
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.



This commit enables the complete LSP infrastructure that was previously disabled in Phoenix. The LSP system provides a foundation for language server integration supporting features like code completion, parameter hints, jump to definition, find references, and diagnostics.
Changes:
The LSP infrastructure includes:
This enables the platform for JavaScript/TypeScript and other language server integrations. Language-specific clients can now be registered using LanguageTools.initiateToolingService() API.
What kind of change does this PR introduce?
Screenshots or Gifs of the change
Does this PR introduce a breaking change?
Tests done
Checklist
Other information
pull request guidelines: