feat(examples): Add LSP TypeScript example project - #74
Conversation
Add a complete example project demonstrating @pleaseai/code-lsp functionality with TypeScript language server. Features demonstrated: - LSPManager initialization and lifecycle - File opening and diagnostics retrieval - Hover information - Go to definition - Find references - Code completion - Document and workspace symbols Closes #73
Summary of ChangesHello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
- Coverage 39.35% 38.71% -0.65%
==========================================
Files 59 59
Lines 6489 6515 +26
==========================================
- Hits 2554 2522 -32
- Misses 3935 3993 +58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add eslint as a devDependency for testing LSP diagnostics.
Fix bug where LSP servers would incorrectly attempt to start on projects without the appropriate config files. The issue was that `server.root(projectDir, projectDir)` passed the directory path as the first argument, but the function expects a file path. When `path.dirname(directory)` was called, it would return the parent directory, breaking the search boundary. Solution: Use a dummy file path within projectDir so that `path.dirname()` returns projectDir itself, keeping the search within the correct bounds. This ensures LSP servers like Deno only start when their config files (e.g., deno.json) actually exist in the project.
Fix the LSP completion demo line number from 76 to 79 (0-based).
The actual `return Math.abs(value)` line is at line 80 (1-based),
which is line 79 in 0-based indexing used by LSP.
The character position (14) was already correct:
2 (indent) + 7 ('return ') + 5 ('Math.') = 14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
examples/lsp-typescript/디렉토리에 완전한 예제 구성Features Demonstrated
Files Added
Test Plan
cd examples/lsp-typescript && bun installbun run demo실행하여 LSP 기능 확인Closes #73