Commit Graph

382 Commits

Author SHA1 Message Date
Lasse Reichstein Holst Nielsen 92e52a1874 Remove direct dependencies on package:charcode from SDK.
Change-Id: I9ef36e8a6890a70baac6c18f0be2252dcf5453df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163941
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-20 13:07:53 +00:00
Konstantin Shcheglov aad1a677c0 Deprecate GenericTypeAliasElement
See also https://dart-review.googlesource.com/c/sdk/+/166680

Change-Id: I6018f3bf5796dcc8ab059aab5b29d01e7336581b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-15 16:03:26 +00:00
Konstantin Shcheglov fbfc723de7 Use CompoundAssignmentExpression instead of LHS element/type.
This adds some technical debt in form of using writeOrReadElement in
clients, which can be paid incrementally by migrating these places to
handling assignment like expressions one by one. Doing it all in one
CL was too much. But now the underlaying AST resolution will be
sound.

In the next breaking change we will remove
setAssignmentBackwardCompatibility(), so stop setting elements/types
for assignment targets.

Change-Id: I11626876cfed25653edb0cc18544aba51cef5965
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-14 18:45:08 +00:00
Brian Wilkerson 1fcb032798 Do not generate void when overriding a setter
Bug: https://github.com/dart-lang/sdk/issues/43767
Change-Id: I373793360ffc58f28cb7a58b1b16c360b560ba51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167363
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-13 16:30:08 +00:00
Danny Tuppeny 8b567447dc [Analyzer] Use new NAMED_REQUIRED ParameterKind for signature help
Change-Id: Ia4d23cb51f4e3729e8d40fa5a38dd8b2a8771c03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162006
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-29 07:38:14 +00:00
Mike Fairhurst e4f20f647e [analyzer_plugin] Remove unnecessary dart:async import
Change-Id: I759d4f9b05a21062550f9cbbc2fe56a2f19dfaf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164621
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-28 21:07:08 +00:00
Brian Wilkerson fdf4a1cc47 Fix the production of overrides under null safety
Bug: https://github.com/dart-lang/sdk/issues/43535
Change-Id: I9386d3abed83095e2363ba9b52c111dc93356914
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164260
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-23 22:42:59 +00:00
Brian Wilkerson 69de8fd3d4 Make it possible to write imported names in data-driven fixes
Change-Id: Icc1843a767261180df2b07205faf3f960adf0826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164200
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-23 18:46:09 +00:00
Danny Tuppeny c0c5a7404c [Analyzer] Make newlines in fixes like CreateMissingOverrides consistent on Windows
See https://github.com/Dart-Code/Dart-Code/issues/2766.

Change-Id: Ib1d5f06a9a3667c704e9656b233cc2cce01fa3d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163206
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-17 16:01:10 +00:00
Danny Tuppeny 9181df9d6b [Analyzer] Fix error in LSP go-to-definition when target is in a "part"
Plus unrelated navigation regions (for example in comments, references
outside of the required range would be returned).

Fixes https://github.com/dart-lang/sdk/issues/28799.

Change-Id: I2fce33a3bd2678abfb40e5e9b3e3c5662e4f5608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161948
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-09 18:53:39 +00:00
Danny Tuppeny 4ce8084672 [Analyzer] Avoid error in code range calculation when codeOffset is null
Change-Id: I615bdc21242407af5b375e9eb1f1565be9d79e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161947
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-09-08 16:38:33 +00:00
Danny Tuppeny 31cc6df4fe [Analyzer] Compute code locations for LSP definitions
Change-Id: Id52fefae11b0d779b860cb44e33bc36cc12e55bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161168
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 20:51:27 +00:00
Danny Tuppeny 5112f526cf [Analyzer] Add optional support for codeOffset/codeLength on navigation targets
Change-Id: Ib328c408d590398d30bd341603781f68f2fd1402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161166
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 20:51:27 +00:00
Mike Fairhurst 334d368146 [analyzer_plugin] Remove unused dart:async imports
Change-Id: I079d5f7c1f6c36d4e76ecd41b5d22e4199c1304c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161464
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 18:09:52 +00:00
Brian Wilkerson 61c8053730 Fix computation of OpType in an empty return statement with a semicolon
Change-Id: Id28f0ce01bd4ba2a5185b4d3f407409a6b724a1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159969
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-24 23:30:27 +00:00
Brian Wilkerson 680f3b51ca Suggest named parameter names in a super constructor invocation
Change-Id: Ibe095cab1473aefd3a1067bb0264a115f44c05d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159964
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-24 20:42:07 +00:00
Konstantin Shcheglov cf4d41074e Fix crash when working with directives with invalid URIs.
R=brianwilkerson@google.com

Change-Id: Id8bd5c49269c58404b4a4d3182b77a37fb494c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-22 18:37:51 +00:00
Brian Wilkerson 90b2e5f576 Enhance DartEditBuilder.writeParameter to support the covariant and required keywords
Change-Id: I625196ff5786d9a6029db92809487d79e0e8d710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 14:03:18 +00:00
Brian Wilkerson 4af6831020 Add support for modifying parameters in a data-driven fix
Change-Id: I756df3e665c24cbf5131a0aae1c1526c08a5d172
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 14:56:40 +00:00
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 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
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
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
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 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
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