Commit graph

528 commits

Author SHA1 Message Date
Brian Wilkerson a4baaa3ac5 Fix a bug in the way RangeFactory deals with trailing commas in a list
Change-Id: Ic9ba9acbbb583068662972fd5cc42d28aa1dfa6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155824
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-24 20:08:47 +00:00
Konstantin Shcheglov ea7a92845c Fix NPE for CREATE_FUNCTION when IndexExpression argument.
Change-Id: I539908a5033aa0f84adcce5ae0be4ea6713ff75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-19 15:40:19 +00:00
Brian Wilkerson 380d224fcd Fix deprecation warnings
Change-Id: I3eb724e214e9c554671bf619945d81b3a8d93b2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154844
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-17 18:30:27 +00:00
Brian Wilkerson e0cfdc0d62 Deprecate the class DartChangeBuilder and update all references to it in the analyzer packages
Change-Id: I6c2692ed5ece57d28f70482877933564d443cfa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154753
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-07-17 00:11:14 +00:00
Brian Wilkerson cbe22f1533 Merge the functionality of DartChangeBuilder into ChangeBuilder
This introduces the new API. When we're happy with this I'll mark the
old APIs as deprecated and fix up the nearly 900 places impacted by the
change.

Change-Id: Ie88e354d9111339dc79448139bd64246cf06e0c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-16 17:44:34 +00:00
Konstantin Shcheglov a9e67d8194 Prepare to publish analyzer_plugin 0.3.0
We need this for https://dart-review.googlesource.com/c/sdk/+/154128

Change-Id: I7ce15ad1a0037e60422f412a0cb9840c29a7e4e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154129
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-11 17:05:43 +00:00
Brian Wilkerson 082a6e03bd Use element kind to boost the relevance of available declarations
This doesn't significantly improve the overall scores, but it does cause
the element kind to be used for available declarations, which means that
constructors are suggested before classes.

Change-Id: I75e7bb13bd867b9209a43c4d737c5079c42eb25a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154080
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-07-10 20:08:36 +00:00
Konstantin Shcheglov 653e44485f Prepare to publish analyzer_plugin 0.2.5
R=brianwilkerson@google.com

Change-Id: Ie48ebda4951c1ea6d90e049639d3bbf8e15013be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-08 01:17:50 +00:00
Brian Wilkerson ff83b0fec9 Add support for navigating from the URI in import and export configurations to the referenced file
Change-Id: Ic6234d9a24dcb52228067b20d69277e47ff89a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-24 22:46:33 +00:00
Brian Wilkerson d0e78f8a77 Fix the edit groups created by create_missing_overrides (issue 42468)
Change-Id: I53e5f44af3583549f277f1d7acbe1f725f7a6ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-24 22:39:18 +00:00
Danny Tuppeny f0e1f32c87 Add support for folding if/else/elseif blocks
Change-Id: I3cbf1f282ee59c577c6ba912e957f838e827fd3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 19:32:50 +00:00
Brian Wilkerson c22dc20a93 Use the const-ness of an element when completing in a const context using available declarations
Change-Id: Ia950ad81ed571cbcf1f0060da0cba26406206ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151031
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-12 22:15:55 +00:00
Jaime Wren 1e0611cfac Refactor the LocalConstructorContributor into the LocalReferenceContributor.
local_declaration_visitor.dart was updated to better implement ConstructorDeclarations

This adds the API of _recordCompletionElement() and _elementAlreadyInCompletionSet() to local_reference_contributor.dart, if this API looks good and lands, I will use it in the rest of the contributor to fix other known shadowing bugs.

local_constructor_contributor_test.dart was removed (a large copied & pasted body of tests not providing value) and tests were added at the beginning of local_reference_contributor_test.dart.  Tests in this file were also updated accordingly.

The change of the testCommentSnippets025 test in completion_test.dart is due to the framework not supporting (in a more robust way) the allowance of both a class and an implicit constructor

The addition of the testCommentSnippets045 test in completion_test.dart is to show that constructor invocations don't need the new keyword.

Change-Id: Ic4a52e3cb94320a92f24b1c743dd61e18c6c7b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-06-05 16:15:04 +00:00
Brian Wilkerson 333873fc05 An initial naive approach to integrating the new relevance computations
and the available declarations support.

The resulting metrics are lower than I'd like them to be, but I suspect
that this will be a reasonable first step toward the final solution.

Change-Id: Ib5d471a9d3c0dafcb2b3687e25b9af21da97854a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-03 16:29:00 +00:00
Paul Berry 930cae0f13 Revert "Remove DartSdk.useSummary."
This reverts commit a2c3ecabce.

Reason for revert: Breaking change to de facto API

Original change's description:
> Remove DartSdk.useSummary.
> 
> R=​brianwilkerson@google.com
> 
> Change-Id: Ifa851f4af47a973d65c528c6d07fcac0a515134b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149495
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I9998bedb74ea940371f18ac7dce42b2f5dcc3b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149687
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-02 15:20:32 +00:00
Paul Berry 9d8087a399 Combine all "verify sorted" tests.
The tests in analyzer_cli and analyzer_plugin imported
analysis_server, resulting in warnings when publishing
analyzer_plugin.  combining these tests all into analysis_server
shares more code and avoids the warning.

Change-Id: I519f67872500e93e399c5c3d2aeddf781f07602c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149610
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-01 20:53:58 +00:00
Konstantin Shcheglov a2c3ecabce Remove DartSdk.useSummary.
R=brianwilkerson@google.com

Change-Id: Ifa851f4af47a973d65c528c6d07fcac0a515134b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149495
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-30 19:07:32 +00:00
Paul Berry 3870ca7c9f Analyzer_plugin: fix problematic imports of analysis_server, and prepare to publish.
The previous publish attempt failed because
lib/utilities/navigation/navigation_dart.dart imported from
analysis_server.  Bumping the version number to 0.2.4 since the fix
required exposing a new method to the public API.

Note that one import of analysis_server remains, in
test/verify_sorted_test.dart.  This is less urgent to fix, since it
doesn't block publishing analyzer_plugin, it just prevents users from
running analyzer_plugin tests based on the files downloaded via pub.
I'll fix this in a follow-up CL.

Change-Id: I8ae9470db3249492b5756b8f9af742e528db004a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149387
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-29 23:29:47 +00:00
Jaime Wren 77d2a59d8e Add declaredConstructor() to the LocalDeclarationVisitor and mark all declared*() members as concrete with empty bodies. Subclasses are updated in this change as well.
Change-Id: I458968049781830af83d09512a6a1dd75b573070
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149391
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-05-29 15:23:46 +00:00
Paul Berry 8886b51640 Prepare to publish analyzer_plugin version 0.2.3
Change-Id: I1f175b53a6a07773cc2f5d43cf9993598f5f9879
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-28 22:15:05 +00:00
Konstantin Shcheglov a45d66c6e9 Make MockAnalysisDriver implement AnalysisDriver, not extend.
The way we used to configure it does not work with changed I want to
make, specifically we were given SourceFactory with no resolves,
so no DartUriResolver, so no SDK.

R=brianwilkerson@google.com

Change-Id: Ibf798aae1792366cfbe240f9781038568936146d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-28 21:56:45 +00:00
Brian Wilkerson b7364da5fd Fix the computation of completion location in OpType
There was a bug earlier in which we were attempting to use a relevance
table (MethodInvocation_arguments) that was not generated. I thought
the bug was that the table wasn't being generated, so I attempted to
generate the table (in relevance_table_generator). But the table can't
be generated and the real bug was that the wrong contextLocation was
being generated when computing the OpType. So I backed out the earlier
change and updated the generation to generate the right location.

Change-Id: Ifbd2c6c3e11e1e98887108be7eb6d90e90452446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149381
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-28 21:23:01 +00:00
Brian Wilkerson 3fb5f27d05 Extract and enhance the CREATE_CLASS fix
The enhancement is that we can now create a const constructor if the
class to be created is being used as an annotation. We could also do
this if the class were being created from a constructor invocation, but
I didn't do that. This also doesn't handle creating a named constructor,
but I don't think it's any worse than before. If you disagree let me
know.

Change-Id: Idcff7bd0ac8def416b141b49b801f6798548405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148885
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-22 18:50:06 +00:00
Brian Wilkerson b560016446 Fix some issues in the new relevance computations
The code to check the element kind was not being used in a few places
because (a) the generator wasn't always generating a table when it
should and (b) the key for the table wasn't always being set when
creating the OpType. Both of these issues have been mostly addressed.

That required re-generating the element kind tables.

There were several places where context type information wasn't being
used when building suggestions. This has been fixed for all the places
I'm currently aware of.

There were a couple of places where the context type wasn't being
computed where it could have been. I have fixed the places I'm aware of.

Context types were not being computed anywhere because of a bug that
has now been fixed.

There is now one place that computes and caches the context type, which
should improve performance slightly.

I also removed some dead code that I discovered in the process of making
the other changes and cleaned up a couple of places in the code that
were suboptimal.

Change-Id: Ieae8dcc71b986841be3078d6e0b3a653c35384b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148237
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-05-16 17:15:33 +00:00
Konstantin Shcheglov 4e520824f5 Deprecated DartType.isObject
R=brianwilkerson@google.com

Change-Id: If588b23668764b07c99e327281bfeb11c8e31367
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-11 16:14:37 +00:00
Konstantin Shcheglov 9b3f9db65a Switch InheritanceManager3 to computing ClassElement interfaces.
Change-Id: Id9148d1bf3fc369eeabe2b1acc7507c20986a3e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146682
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-06 03:09:03 +00:00
Brian Wilkerson c1e7641d5b Convert six more contributors to use SuggestionBuilder
Change-Id: I06033fb50e546601292200f22e713750dde87465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-05 18:52:27 +00:00
Jaime Wren 38c0fb78b6 Completion bug fix - extended types will now be completable in extension declarations
Bug: https://github.com/dart-lang/sdk/issues/41665
Change-Id: I5e89babc7a52fa833ebd55398fca50b292c710da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-27 19:20:08 +00:00
Brian Wilkerson c980e5d876 Produce a completion location for the argument list in an extension override
Change-Id: I694d77dbba171fb0d4806933ce766c9d411dba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144664
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-04-23 19:30:19 +00:00
Paul Berry 4d4353ded9 Move navigation_dart.dart from analysis_server to analyzer_plugin.
This will allow it to be used by the nnbd_migration package.

Change-Id: Ia628630cf156af7bbfdbe2e104254cf5a609ae91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144467
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-04-23 12:35:39 +00:00
Danny Tuppeny 715361eef2 Change format of IDs for fixes and attach them to generated changes
Having IDs to the change allows them to be key-bound in VS Code (see https://github.com/Dart-Code/Dart-Code/issues/2169).

Changing for format is to make them better match the existing IDs for assists (these will need to be pre-loaded into VS Code to allow users to see them to aid keybinding).

Change-Id: Iedcfaaf9a29d5e8575f1b8394e3db0ff19360872
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143588
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-16 17:35:24 +00:00
Brian Wilkerson 84beb4d31b Implement the element kind feature
In addition to implementing the feature, this CL updates one of the
contributors to use the new feature as a way of testing it. I haven't
looked to see whether it impacts the metrics, but I wouldn't expect much
change anyway because of the small number of completions that are likely
to be effected by this change.

It might be interesting to start thinking about ways to measure the
impact of individual features.

Change-Id: Idd0040a774e5fd9a6e3f6c29d0aa7fd762676fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143622
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-04-16 14:33:24 +00:00
Brian Wilkerson 286501b0f1 Compute the completion location while computing the OpType
The completion location will be used later to help compute relevance
based on the element kind.

Change-Id: I3927bb0137340a81fc90efcbc9c3ecb25ad63542
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143240
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-13 17:06:01 +00:00
Jaime Wren c853f70fea Follow up on recent completion improvement in https://dart-review.googlesource.com/c/sdk/+/142545 to add a test in optype_test.dart
Change-Id: I72ad4a656e332facea7b396604aff765475ad122
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142706
Auto-Submit: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-07 20:56:16 +00:00
Jaime Wren eddc9271ab Suggest type names before names in FieldDeclarations, even when they are documented with dartdoc
Similar to https://dart-review.googlesource.com/c/sdk/+/142545

Change-Id: I217a17324bcfd9efb7e9bd1a53332fd06d1dc024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142705
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-07 20:53:46 +00:00
Jaime Wren faab097e01 Suggest type names before names in TopLevelVariableDeclarations, even when they are documented with dartdoc.
The test test_TopLevelVariableDeclaration_type_after_comment3, fails without the change to optype.dart, the other tests were added simply to have more coverage.

Change-Id: I11512f1a97e72796b6e0656b7555206640e2a8f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142545
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-07 18:07:16 +00:00
Brian Wilkerson 1e93347fc2 Clean up OpTypeTest
This merges the 3 concrete classes into a single class. We were not
really testing Dart 1 behavior, and the extension methods experiment is
enabled by default.

I also renamed several of the tests to conform more closely to the
convention we use.

I did not alter the bodies of any of the tests, so we're testing exactly
the same things after this CL as before.

In future CLs, as I add more information to OpType (for the new relevance
computations), I plan to subdivide the tests based on the type of the
AST node being tested, which will split up the tests and allow for shorter
test names.

Change-Id: I717c5697817d9f96d050318f2f39da85dff23422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142203
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-02 18:28:29 +00:00
Jaime Wren 25c591e0b0 Additional optype constructor declaration tests as well as a minor bug fix in optype.dart.
This is follow up on https://dart-review.googlesource.com/c/sdk/+/142063

Change-Id: I39dcb9cbecf78e12cc364712345693e153110523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142088
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-02 06:11:40 +00:00
Jaime Wren 0c8158c3cd Fix missing type name completions in constructor declarations.
There are 34 instances of this in the package collection.

Change-Id: I43856f0e840ca3f76285948363868927b669caf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-04-01 20:58:28 +00:00
Brian Wilkerson 6f15530536 Enable omit_local_variable_types in analyzer_plugin
Change-Id: I908e15b4820eab0e8375994ce3cebfac332306f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 04:06:49 +00:00
Brian Wilkerson 127d84aa56 Update relevance computations in LocalReferenceContributor
Change-Id: I19baafc28488304d781757c2a2648ec3d3781d15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141361
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-27 18:33:29 +00:00
Konstantin Shcheglov b2acb51d30 Fix for completion in formal parameters of GenericFunctionType.
There was crash:

NoSuchMethodError: The getter 'offset' was called on null.
Receiver: null
Tried calling: offset
at Object.noSuchMethod	(dart:core )
at _OpTypeAstVisitor.visitSimpleFormalParameter	(optype.dart:976 )
at _OpTypeAstVisitor.visitFormalParameterList	(optype.dart:631 )
at FormalParameterListImpl.accept	(ast.dart:4479 )
at DartCompletionRequestImpl.opType	(completion_manager.dart:435 )

R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I0b0ef50e925ad48ca293a7a753b332821b503e5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141320
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-03-27 17:02:34 +00:00
Brian Wilkerson 050c7e1ac7 Sort files in analysis_server_client and analyzer_plugin and add tests to keep them that way
I didn't update the generators to generate sorted output, I just
whitelisted those files for now.

Change-Id: Ia1d233ee978691f15bce06b2556aa3371c54183f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141209
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-27 13:27:17 +00:00
Brian Wilkerson 7d66feb5ff Compute new relevance in LocalConstructorContributor
Change-Id: Ife24a24829fae36b1caef5ab0a55e4c210a063a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141201
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-26 21:50:29 +00:00
Brian Wilkerson d194838578 Add new relevance scores to LibraryElementSuggestionBuilder, which covers both LibraryMemberContributor and CombinatorContributor
This should have tests, but I (or someone else) need to do some data
mining to figure out the correct relevance values and hence the correct
ordering to test for.

Change-Id: I7782d7b7e13ff38a785c445cd0d6fc82a388a6aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141000
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-25 22:49:26 +00:00
Brian Wilkerson df5e6c8e5f Compute new relevances in LibraryPrefixConstributor
Once again, test suggestions are welcome.

Change-Id: I470825a0ef51f555977bdc86192cc38bd718519a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140943
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-25 21:01:16 +00:00
Brian Wilkerson 9e4eb054a4 Add new relevance scores for NamedConstructorContributor
Change-Id: I6e5fd10edf74b44afb766acd675dffd5ef0cb25f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140906
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-25 17:47:42 +00:00
Brian Wilkerson ef56e3a3fc Update relevance of labels
Change-Id: Id862fa2da7969a9dcdb1854f6ffe38a4c122a024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140778
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-24 22:46:07 +00:00
Brian Wilkerson 7e0190a6d7 Add new relevance values for field formal parameter suggestions
Also updated a comment that I missed from the last CL.

Change-Id: Ibfcce19998532c672b9990308cd7b03fd42d14cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140772
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-24 20:46:27 +00:00
Brian Wilkerson 2d0fed35bb Update the ArgListContributor to have new relevance scores
This also includes a new metric computation showing how often function
typed parameters have closures as arguments.

Change-Id: I8999cc3935bcc7514ebba90a8a4d246b2f236c42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140702
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-03-24 17:00:55 +00:00