83c26333a2
Taking into consideration `prefer_relative_imports` and `always_use_package_imports` for adding import options to the assists list. When neither is set, both will appear always showing package imports first. If both are set we will treat this as if only `always_use_package_imports` is and show only package imports. Fixes https://github.com/dart-lang/sdk/issues/56800 R=scheglov@google.com Change-Id: If2353479de91f50c6c44eb7a17487fb6d0d6f681 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387500 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
48 lines
1.7 KiB
Dart
48 lines
1.7 KiB
Dart
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'package:analyzer/dart/ast/ast.dart';
|
|
|
|
/// A set of options related to coding style that apply to the code within a
|
|
/// single analysis context.
|
|
///
|
|
/// Clients may not extend, implement or mix-in this class.
|
|
abstract class CodeStyleOptions {
|
|
/// Return `true` if the `require_trailing_commas` is enabled and trailing
|
|
/// commas should be inserted in function calls and declarations.
|
|
bool get addTrailingCommas;
|
|
|
|
/// Return `true` if local variables should be `final` whenever possible.
|
|
bool get makeLocalsFinal;
|
|
|
|
/// Return `true` if `prefer_int_literals` is enabled.
|
|
bool get preferIntLiterals;
|
|
|
|
/// Return the preferred quote based on the enabled lints, otherwise a single
|
|
/// quote.
|
|
String get preferredQuoteForStrings;
|
|
|
|
/// Return `true` if constructors should be sorted first, before other
|
|
/// class members.
|
|
bool get sortConstructorsFirst;
|
|
|
|
/// Return `true` if types should be specified whenever possible.
|
|
bool get specifyTypes;
|
|
|
|
/// Return `true` if the formatter should be used on code changes in this
|
|
/// context.
|
|
bool get useFormatter;
|
|
|
|
/// Return `true` if URIs should be always added with a package scheme.
|
|
bool get usePackageUris;
|
|
|
|
/// Return `true` if URIs should be "relative", meaning without a scheme,
|
|
/// whenever possible.
|
|
bool get useRelativeUris;
|
|
|
|
/// Returns the preferred quote based on the enabled lints, otherwise based
|
|
/// on the most common quote, otherwise a single quote.
|
|
String preferredQuoteForUris(Iterable<NamespaceDirective> directives);
|
|
}
|