Skip to content

Commit

Permalink
[linter] Exclude ElementLocation from analyzer_use_new_elements + upd…
Browse files Browse the repository at this point in the history
…ate migration file

As far as I can tell, `ElementLocation` isn't something we need to migrate off so this excludes it and updates the list with some additional files that no longer trigger the lint.

Change-Id: I31fae6616e0b0fa7e8a2f969ced74c5e8faacbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390601
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Brian Wilkerson <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
  • Loading branch information
DanTup authored and Commit Queue committed Oct 16, 2024
1 parent 7dd74af commit 0da426d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/analysis_server/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ lib/src/lsp/handlers/handler_cancel_request.dart
lib/src/lsp/handlers/handler_change_workspace_folders.dart
lib/src/lsp/handlers/handler_code_actions.dart
lib/src/lsp/handlers/handler_code_lens.dart
lib/src/lsp/handlers/handler_completion.dart
lib/src/lsp/handlers/handler_dart_text_document_content_provider.dart
lib/src/lsp/handlers/handler_document_color.dart
lib/src/lsp/handlers/handler_document_highlights.dart
Expand All @@ -154,6 +155,7 @@ lib/src/lsp/handlers/handler_shutdown.dart
lib/src/lsp/handlers/handler_signature_help.dart
lib/src/lsp/handlers/handler_states.dart
lib/src/lsp/handlers/handler_text_document_changes.dart
lib/src/lsp/handlers/handler_type_hierarchy.dart
lib/src/lsp/handlers/handler_will_rename_files.dart
lib/src/lsp/handlers/handler_workspace_configuration.dart
lib/src/lsp/handlers/handler_workspace_symbols.dart
Expand Down Expand Up @@ -202,6 +204,7 @@ lib/src/server/sdk_configuration.dart
lib/src/server/stdio_server.dart
lib/src/services/completion/completion_performance.dart
lib/src/services/completion/completion_state.dart
lib/src/services/completion/dart/dart_completion_suggestion.dart
lib/src/services/completion/dart/fuzzy_filter_sort.dart
lib/src/services/completion/dart/keyword_helper.dart
lib/src/services/completion/dart/label_helper.dart
Expand Down Expand Up @@ -296,7 +299,9 @@ lib/src/services/correction/dart/convert_to_normal_parameter.dart
lib/src/services/correction/dart/convert_to_null_aware.dart
lib/src/services/correction/dart/convert_to_null_aware_spread.dart
lib/src/services/correction/dart/convert_to_on_type.dart
lib/src/services/correction/dart/convert_to_package_import.dart
lib/src/services/correction/dart/convert_to_raw_string.dart
lib/src/services/correction/dart/convert_to_relative_import.dart
lib/src/services/correction/dart/convert_to_set_literal.dart
lib/src/services/correction/dart/convert_to_super_parameters.dart
lib/src/services/correction/dart/convert_to_switch_expression.dart
Expand Down Expand Up @@ -968,6 +973,7 @@ test/services/snippets/dart/switch_statement_test.dart
test/services/snippets/dart/test_all.dart
test/services/snippets/dart/test_definition_test.dart
test/services/snippets/dart/test_group_definition_test.dart
test/services/snippets/dart/test_support.dart
test/services/snippets/dart/try_catch_statement_test.dart
test/services/snippets/dart/while_statement_test.dart
test/services/snippets/snippet_manager_test.dart
Expand Down Expand Up @@ -999,6 +1005,7 @@ test/src/computer/imported_elements_computer_test.dart
test/src/computer/outline_computer_test.dart
test/src/computer/selection_range_computer_test.dart
test/src/computer/test_all.dart
test/src/computer/type_hierarchy_computer_test.dart
test/src/domains/execution/completion_test.dart
test/src/domains/execution/test_all.dart
test/src/domains/flutter/base.dart
Expand Down Expand Up @@ -1420,6 +1427,7 @@ test/src/services/correction/fix/surround_with_parentheses_test.dart
test/src/services/correction/fix/test_all.dart
test/src/services/correction/fix/update_sdk_constraints_test.dart
test/src/services/correction/fix/use_curly_braces_test.dart
test/src/services/correction/fix/use_different_division_operator_test.dart
test/src/services/correction/fix/use_effective_integer_division_test.dart
test/src/services/correction/fix/use_eq_eq_null_test.dart
test/src/services/correction/fix/use_is_not_empty_test.dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:analysis_server/src/protocol_server.dart'
show CompletionSuggestion;
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';

/// An extension of [CompletionSuggestion] that includes additional
/// Dart-specific fields that are not part of the JSON protocol.
Expand Down
3 changes: 2 additions & 1 deletion pkg/analyzer/lib/dart/element/element2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export 'package:analyzer/dart/element/element.dart'
DirectiveUriWithSource,
DirectiveUriWithUnit,
ElementAnnotation,
ElementKind;
ElementKind,
ElementLocation;

/// An element or fragment that can have either annotations (metadata), a
/// documentation comment, or both associated with it.
Expand Down
3 changes: 3 additions & 0 deletions pkg/linter/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lib/src/rules/avoid_catching_errors.dart
lib/src/rules/avoid_double_and_int_checks.dart
lib/src/rules/avoid_dynamic_calls.dart
lib/src/rules/avoid_empty_else.dart
lib/src/rules/avoid_equals_and_hash_code_on_mutable_classes.dart
lib/src/rules/avoid_escaping_inner_quotes.dart
lib/src/rules/avoid_final_parameters.dart
lib/src/rules/avoid_function_literals_in_foreach_calls.dart
Expand Down Expand Up @@ -53,6 +54,7 @@ lib/src/rules/constant_identifier_names.dart
lib/src/rules/control_flow_in_finally.dart
lib/src/rules/curly_braces_in_flow_control_structures.dart
lib/src/rules/dangling_library_doc_comments.dart
lib/src/rules/diagnostic_describe_all_properties.dart
lib/src/rules/directives_ordering.dart
lib/src/rules/discarded_futures.dart
lib/src/rules/do_not_use_environment.dart
Expand Down Expand Up @@ -173,6 +175,7 @@ lib/src/rules/unnecessary_to_list_in_spreads.dart
lib/src/rules/unrelated_type_equality_checks.dart
lib/src/rules/use_colored_box.dart
lib/src/rules/use_decorated_box.dart
lib/src/rules/use_full_hex_values_for_flutter_colors.dart
lib/src/rules/use_function_type_syntax_for_parameters.dart
lib/src/rules/use_if_null_to_convert_nulls_to_bools.dart
lib/src/rules/use_is_even_rather_than_modulo.dart
Expand Down
1 change: 1 addition & 0 deletions pkg/linter/lib/src/rules/analyzer_use_new_elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bool _isOldModelElement(Element2? element) {
'DirectiveUriWithSource',
'ElementAnnotation',
'ElementKind',
'ElementLocation',
}.contains(firstFragment.name)) {
return false;
}
Expand Down

0 comments on commit 0da426d

Please sign in to comment.