EditDomain class
The edit domain contains commands related to edits that can be applied to the code.
Constructors
- EditDomain(AnalysisServer server)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- server → AnalysisServer
-
finalinherited
Methods
-
bulkFixes(
List< String> ? included, {bool? inTestMode, List<String> ? codes}) → Future<BulkFixesResult> - Analyze the specified sources for fixes that can be applied in bulk and return a set of suggested edits for those sources. These edits may include changes to sources outside the set of specified sources if a change in a specified source requires it.
-
format(
String? file, int? selectionOffset, int? selectionLength, {int? lineLength}) → Future< FormatResult> - Format the contents of a single file. The currently selected region of text is passed in so that the selection can be preserved across the formatting operation. The updated selection will be as close to matching the original as possible, but whitespace at the beginning or end of the selected region will be ignored. If preserving selection information is not required, zero (0) can be specified for both the selection offset and selection length.
-
formatIfEnabled(
List< String> ? directories) → Future<FormatIfEnabledResult> - Format the contents of the files in one or more directories, but only if the analysis options file for those files has enabled the 'format' option.
-
getAssists(
String? file, int? offset, int? length) → Future< AssistsResult> - Return the set of assists that are available at the given location. An assist is distinguished from a refactoring primarily by the fact that it affects a single file and does not require user input in order to be performed.
-
getAvailableRefactorings(
String? file, int? offset, int? length) → Future< AvailableRefactoringsResult> - Get a list of the kinds of refactorings that are valid for the given selection in the given file.
-
getFixes(
String? file, int? offset) → Future< FixesResult> - Return the set of fixes that are available for the errors at a given offset in a given file.
-
getPostfixCompletion(
String? file, String? key, int? offset) → Future< PostfixCompletionResult> - Get the changes required to convert the postfix template at the given location into the template's expanded form.
-
getRefactoring(
String? kind, String? file, int? offset, int? length, bool? validateOnly, {RefactoringOptions? options}) → Future< RefactoringResult?> - Get the changes required to perform a refactoring.
-
getStatementCompletion(
String? file, int? offset) → Future< StatementCompletionResult> - Get the changes required to convert the partial statement at the given location into a syntactically valid statement. If the current statement is already valid the change will insert a newline plus appropriate indentation at the end of the line containing the offset. If a change that makes the statement valid cannot be determined (perhaps because it has not yet been implemented) the statement will be considered already valid and the appropriate change returned.
-
importElements(
String? file, List< ImportedElements> ? elements, {int? offset}) → Future<ImportElementsResult> - Return a list of edits that would need to be applied in order to ensure that all of the elements in the specified list of imported elements are accessible within the library.
-
isPostfixCompletionApplicable(
String? file, String? key, int? offset) → Future< IsPostfixCompletionApplicableResult> - Determine if the request postfix completion template is applicable at the given location in the given file.
-
listPostfixCompletionTemplates(
) → Future< ListPostfixCompletionTemplatesResult> - Return a list of all postfix templates currently available.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
organizeDirectives(
String? file) → Future< OrganizeDirectivesResult> -
Organizes all of the directives - removes unused imports and sorts
directives of the given Dart file according to the (Dart Style
Guide)
https://dart.dev/guides/language/effective-dart/style
. -
sortMembers(
String? file) → Future< SortMembersResult> - Sort all of the directives, unit and class members of the given Dart file.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited