Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.25 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.25 KB

Buid status pub package

A library to access Dart's analysis server API.

What is the analysis server?

The analysis server is a long-running process that provides analysis results to other tools. It is designed to provide on-going analysis of one or more code bases as those code bases are changing.

Using the server

Clients (typically tools, such as an editor) are expected to run the analysis server in a separate process and communicate with it over a JSON protocol. The protocol is specified here.

Here's a simple example of starting and communicating with the server:

import 'package:analysis_server_lib/analysis_server_lib.dart';

void main() async {
  AnalysisServer server = await AnalysisServer.create();
  await server.server.onConnected.first;

  VersionResult version = await server.server.getVersion();
  print(version.version);
  
  server.dispose();
}