Skip to content

feat(examples): Add LSP TypeScript example project - #74

Merged
amondnet merged 4 commits into
mainfrom
73-featexamples-add-lsp-typescript-example-project
Jan 15, 2026
Merged

feat(examples): Add LSP TypeScript example project#74
amondnet merged 4 commits into
mainfrom
73-featexamples-add-lsp-typescript-example-project

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

  • LSP 기능 테스트를 위한 TypeScript 예제 프로젝트 추가
  • examples/lsp-typescript/ 디렉토리에 완전한 예제 구성

Features Demonstrated

  • LSPManager 초기화 및 생명주기 관리
  • 파일 열기 및 진단(diagnostics) 조회
  • Hover 정보 조회
  • 정의로 이동 (Go to Definition)
  • 참조 찾기 (Find References)
  • 코드 완성 (Code Completion)
  • 문서 및 워크스페이스 심볼 검색

Files Added

examples/lsp-typescript/
├── README.md           # 사용법 문서
├── package.json        # 프로젝트 의존성
├── tsconfig.json       # TypeScript 설정
├── demo.ts             # LSP 데모 스크립트
└── src/
    ├── index.ts        # 진입점 (클래스, 인터페이스 예제)
    └── utils/
        └── math.ts     # 유틸리티 함수 (JSDoc 포함)

Test Plan

  • cd examples/lsp-typescript && bun install
  • bun run demo 실행하여 LSP 기능 확인
  • TypeScript LSP 서버가 정상 연결되는지 확인

Closes #73

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
@amondnet amondnet linked an issue Jan 15, 2026 that may be closed by this pull request
11 tasks
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @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은 @pleaseai/code-lsp 라이브러리의 기능을 시연하기 위해 TypeScript로 작성된 새로운 예제 프로젝트를 도입합니다. 이 프로젝트는 LSPManager를 초기화하고 다양한 언어 서버 프로토콜 기능을 활용하는 방법을 포괄적으로 보여주어, 개발자들이 LSP 기능을 이해하고 자신의 프로젝트에 통합하는 것을 더 쉽게 만듭니다. 이를 통해 라이브러리의 활용성을 명확히 하고 개발자 경험을 향상시키는 데 기여합니다.

Highlights

  • 새로운 LSP TypeScript 예제 프로젝트 추가: LSP 기능 테스트를 위한 완전한 TypeScript 예제 프로젝트가 examples/lsp-typescript/ 디렉토리에 추가되었습니다.
  • 다양한 LSP 기능 시연: 이 예제는 LSPManager 초기화 및 생명주기 관리, 파일 열기 및 진단 조회, 호버 정보 조회, 정의 이동, 참조 찾기, 코드 완성, 문서 및 워크스페이스 심볼 검색 등 여러 핵심 LSP 기능을 시연합니다.
  • 실행 가능한 데모 스크립트 포함: demo.ts 스크립트를 통해 LSP 기능을 프로그래밍 방식으로 실행하고 그 결과를 콘솔에서 직접 확인할 수 있습니다.
  • 자세한 사용법 문서 제공: 새로운 README.md 파일은 프로젝트 구조, 빠른 시작 가이드, LSPManager 사용 예시, 의도적인 오류 테스트 방법 및 API 참조를 포함하여 예제 사용에 필요한 모든 정보를 제공합니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 15, 2026

Copy link
Copy Markdown

Deploying code-please with  Cloudflare Pages  Cloudflare Pages

Latest commit: 321382e
Status:🚫  Build failed.

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이 PR은 LSP TypeScript 예제 프로젝트를 추가하여 @pleaseai/code-lsp 라이브러리의 다양한 기능을 시연합니다. 프로젝트 구조, 사용법, 시연 기능 및 API 참조가 잘 문서화되어 있습니다. 전반적으로 잘 구성된 예제이며, LSP 기능 테스트에 매우 유용할 것으로 보입니다. demo.ts 파일의 코드 완성 요청에서 character 위치가 의도와 다르게 설정된 부분이 있어 수정이 필요합니다.

Comment thread examples/lsp-typescript/demo.ts Outdated
@codecov

codecov Bot commented Jan 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.71%. Comparing base (7bce41f) to head (321382e).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

amondnet and others added 3 commits January 15, 2026 17:04
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>
@amondnet
amondnet merged commit 9df0bd4 into main Jan 15, 2026
8 of 10 checks passed
@amondnet
amondnet deleted the 73-featexamples-add-lsp-typescript-example-project branch January 15, 2026 08:16
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Jan 15, 2026
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(examples): Add LSP TypeScript example project

1 participant