dart_analysis_client 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 0

dart_analysis_client

Dart client library to access Dart analysis server

Usage

A simple usage example:

library main;

import 'dart:io';
import 'package:dart_analysis_client/dart_analysis_client.dart';

main() async {
  Directory dir = new Directory('C:\\Program Files\\Dart\\dart-sdk');
  if(!dir.existsSync()) {
    throw new Exception("Dart SDK dir does not exist!");
  }
  final config = new AnalyzerConfig(dir);

  final server = new AnalysisServer(config);
  await server.start();
  print((await server.getVersion()).toJson());
  exit(0);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version, created by Stagehand

example/example.dart

// Copyright (c) 2017, Ravi Teja Gudapati. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library main;

import 'dart:io';
import 'package:dart_analysis_client/dart_analysis_client.dart';

const folders = const <String>[
  r'C:\Users\seragud\dart\icu\dart_analysis_client\example\data\project1\lib\src\'
];
const file =
    r'C:\Users\seragud\dart\icu\dart_analysis_client\example\data\project1\lib\src\project1_base.dart';

main() async {
  Directory dir = new Directory(r'C:\Program Files\Dart\dart-sdk');
  if (!dir.existsSync()) {
    throw new Exception("Dart SDK dir does not exist!");
  }
  final config = new AnalyzerConfig(dir);

  final server = new AnalysisServer(config);
  await server.start();

  // print version
  print((await server.getVersion()).toJson());

  // add dart files
  await server.setProjectRoots(folders);

  // add dart files
  GetNavigationResult nav = await server.getNavigation(file, 16, 30);

  GetSuggestionResult suggestions = await server.getSuggestions(file, 284);

  // print version
  print((await server.getVersion()).toJson());

  exit(0);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_analysis_client: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_analysis_client/dart_analysis_client.dart';
  
Version Uploaded Documentation Archive
0.0.3 Jan 29, 2017 Go to the documentation of dart_analysis_client 0.0.3 Download dart_analysis_client 0.0.3 archive
0.0.2 Jan 27, 2017 Go to the documentation of dart_analysis_client 0.0.2 Download dart_analysis_client 0.0.2 archive
0.0.1 Jan 27, 2017 Go to the documentation of dart_analysis_client 0.0.1 Download dart_analysis_client 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0