Skip to content

refactor: refactor language server#263

Merged
hardfist merged 5 commits intomainfrom
yj/refactor-lsp
Aug 14, 2025
Merged

refactor: refactor language server#263
hardfist merged 5 commits intomainfrom
yj/refactor-lsp

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

@hardfist hardfist commented Aug 14, 2025

align rslint lsp implementation with tsgo lsp
the previous implementation has a fundamental flaw that jsonrpc2 use encoding/json while tsgo use go-json-experiment
which has subtle difference behavior for same message which cause edge bugs

Copilot AI review requested due to automatic review settings August 14, 2025 09:30
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 14, 2025

Deploy Preview for rslint canceled.

Name Link
🔨 Latest commit c958720
🔍 Latest deploy log https://app.netlify.com/projects/rslint/deploys/689dbd61328d5a0008ab1c69

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the rslint language server implementation to align with the TypeScript-Go LSP architecture. It modernizes the LSP server structure and improves protocol compliance.

Key Changes

  • Restructures the LSP server implementation to use a handler-based architecture with proper error handling and cancellation support
  • Replaces jsonrpc2 dependency with native LSP protocol implementation from typescript-go
  • Implements proper LSP initialization flow with position encoding negotiation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
internal/lsp/service.go Updates handler method signatures to use typed parameters and implements new diagnostic response format
internal/lsp/server.go Complete rewrite implementing modern LSP server architecture with proper request/response handling
cmd/rslint/main.go Adds command line argument passing to LSP mode
cmd/rslint/lsp.go Refactors LSP initialization to use new server architecture with proper OS-specific typing cache setup

@hardfist hardfist merged commit a1586f0 into main Aug 14, 2025
11 checks passed
@hardfist hardfist deleted the yj/refactor-lsp branch August 14, 2025 10:55
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.

2 participants