パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.4.0

lsp_server_ce

Language Server Protocol の Dart 実装。このパッケージは、Language Server Protocol をサポートするサーバーを実装するために使用できます。

AndroidiOSLinuxmacOSWebWindows
30日間ダウンロード
6.4万
いいね数
0
Pub ポイント
130

パッケージをインストール

flutter pub add lsp_server_ce

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

言語サーバープロトコル(LSP)のDart実装であり、コード補完、診断、リファクタリングなどの機能をエディターやIDEで提供する言語サーバーの構築を可能にします。このパッケージはすべての主要プラットフォームをサポートし、Flutterプロジェクトとシームレスに統合されます。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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング