패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.4.0

lsp_server_ce

언어 서버 프로토콜의 다트 구현입니다. 이 패키지는 언어 서버 프로토콜을 지원하는 서버를 구현하는 데 사용할 수 있습니다.

AndroidiOSLinuxmacOSWebWindows
30일 다운로드
6.4만
좋아요
0
Pub 점수
130

패키지 설치

flutter pub add lsp_server_ce

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

언어 서버 프로토콜(LSP)의 다트 구현으로, 코드 완성, 진단, 리팩터링과 같은 기능을 텍스트 에디터 및 IDE에서 제공하는 언어 서버를 개발할 수 있게 합니다. 이 패키지는 모든 주요 플랫폼을 지원하며, 플러터 프로젝트와 원활하게 통합됩니다. LSP 표준을 사용하여 텍스트 에디터의 언어 기능을 확장하고자 하는 도구 제작자를 위한 것입니다.

사용 사례

  • Dart 또는 기타 언어용 사용자 지정 언어 서버 빌드
  • 고급 코드 지능을 IDE에 통합하기
  • 실시간 구문 검사 및 제안 활성화
  • 풍부한 언어 기능을 갖춘 편집기 확장 만들기
  • 다중 플랫폼 개발 워크플로우 지원

주요 기능

  • 완전한 LSP 사양 호환성
  • 크로스 플랫폼 지원 (Android, iOS, Linux, macOS, Web, Windows)
  • Flutter 앱과의 간편한 통합
  • 확장 가능한 언어 서버 로직을 위한 모듈러 디자인
  • LSP 메시지 및 통신 프로토콜의 내장 처리

적합한 대상

  • Dart 도구 개발자
  • IDE 플러그인 개발자
  • 언어 기능 구현자
  • 코드 분석 도구 빌더
  • 다중 플랫폼 개발 팀

고려 사항

  • 언어 서버 프로토콜에 대한 이해가 필요합니다
  • 복잡한 언어 기능을 위해 추가 설정이 필요할 수 있습니다
  • 서버-클라이언트 통신 패턴에 익숙한 개발자에게 가장 적합
  • 최종 사용자 애플리케이션에 직접적으로 사용하기 위한 것이 아님
  • 편집기 호환성을 위한 올바른 구성에 의존

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

LSP Server

This is a dart implementation of the Language Server Protocol and comes with all serializable objects defined in the specification (v3.17).

The interface also contains the event methods for Document synchronization as well as the Language Features.

Features

  • Life cycle methods

  • Language features

  • Generic registration of listeners for events and methods.

  • Generic methods to send events and requests

Getting started

To get a better understanding of how this work it can be useful to look at the official documentation and the similar implementations in node.

Full LSP spec definition.

LSP Guide for vscode.

LSP Example for vscode.

Usage

You can use any stream you want, stdio is commonly used and is easy to set up.

void main() async {
  // Create a connection that can read and write data to the LSP client.
  // Supply a readable and writable stream. In this case we are using stdio.
  // But you could use a socket connection or any other stream.
  var connection = Connection(stdin, stdout);

  // Register a listener for when the client initialzes the server.
  // You are suppose to respond with the capabilities of the server.
  // Some capabilities must be enabled by the client, you can see what the client
  // supports by inspecting the ClientCapabilities object, inside InitializeParams.
  connection.onInitialize((params) async {
    return InitializeResult(
      capabilities: ServerCapabilities(
        // In this example we are using the Full sync mode. This means the
        // entire document is sent in each change notification.
        textDocumentSync: const Either2.t1(TextDocumentSyncKind.Full),
      ),
    );
  });
}

Additional information

Who should use this? If you want to build a plugin for an editor that supports the LSP format, and you want to build the server in Dart, then this is the package for you. With this package you can implement features such as "linting", "go to reference", giving contextual information and more.

Todo

Implement the missing features from the protocol:

  • workspaces
  • window
  • notebook
  • client (dynamic capabilities)
  • trace

카테고리

의존성

의존성 목록 8 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.

순위