Commit Graph

132 Commits

Author SHA1 Message Date
Konstantin Shcheglov 757ef3979c Revert "Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled."""
This reverts commit 4089111540.

R=brianwilkerson@google.com

Change-Id: I66297466f8baafe6e070acbcb1776b41f3d9fedc
Reviewed-on: https://dart-review.googlesource.com/55506
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 19:43:22 +00:00
Konstantin Shcheglov 4089111540 Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled.""
This reverts commit e5ed23fdb5.

R=brianwilkerson@google.com

Change-Id: Ida33856e965f06f773025f3c625d6ab3bace80a8
Reviewed-on: https://dart-review.googlesource.com/49280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-03 22:29:09 +00:00
Konstantin Shcheglov e5ed23fdb5 Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled."
This reverts commit a1e4d8e0bf.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Don't do implicit new/const code generation with --preview-dart-2 enabled.
> 
> R=​brianwilkerson@google.com, devoncarew@google.com
> 
> Change-Id: I8a96a5ccceae57c3ed5c1f2e0fd4897a7e99df03
> Reviewed-on: https://dart-review.googlesource.com/48883
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ie3acf0794ed7b8264682e29aaa4bc1516fce6981
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/48900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-30 19:24:46 +00:00
Konstantin Shcheglov a1e4d8e0bf Don't do implicit new/const code generation with --preview-dart-2 enabled.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I8a96a5ccceae57c3ed5c1f2e0fd4897a7e99df03
Reviewed-on: https://dart-review.googlesource.com/48883
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-30 18:07:25 +00:00
Konstantin Shcheglov 50ba330a04 Fix for suggesting both class and its default constructor.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/dart-lang/sdk/issues/32456
Change-Id: Ie4d8b38ad78b1d8ac72f95e71ec29f081d9a9ee8
Reviewed-on: https://dart-review.googlesource.com/45584
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-08 07:27:46 +00:00
Danny Tuppeny 7ca10a7adf Fix file completion for absolute paths on Windows + related tests
Bug: https://github.com/dart-lang/sdk/issues/32226
Bug: https://github.com/dart-lang/sdk/issues/32277
Change-Id: Ie78423dc4a99efd25976b49ec7642362ed61a3c6
Reviewed-on: https://dart-review.googlesource.com/43961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2018-02-27 17:20:49 +00:00
Danny Tuppeny af527dd769 Fix some CompletionDomainHandlerTest tests on Windows
Bug: https://github.com/dart-lang/sdk/issues/32226
Change-Id: If6d0568d0de2268157c916267a0120c5b4295951
Reviewed-on: https://dart-review.googlesource.com/43666
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-26 15:53:37 +00:00
Paul Berry 105b170ddb Roll package test to 0.12.29+1 and stack_trace to 1.9.0
This required some changes to analysis_server, since analysis_server
used to have its own version of pumpEventQueue().  Since
pumpEventQueue() is now provided by the test package, I've removed
analysis_server's version, and I've updated some of the call sites to
pass in "times: 5000" to replicate the old analysis_server behavior.

This also required some changes to analyzer, since the fail() method
is now marked as @alwaysThrows, so no code may follow it without
producing a dead code hint.

Change-Id: Ie5ef3a5cc685c18da02de699e59f63f3bb8865f7
Reviewed-on: https://dart-review.googlesource.com/32683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-07 14:22:23 +00:00
Brian Wilkerson 1d8a5d77c1 Convert more tests to use ResourceProviderMixin
Change-Id: Ia4cce51e33c79c82a989bfda9b8303dfaa72e103
Reviewed-on: https://dart-review.googlesource.com/31880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 00:47:34 +00:00
Brian Wilkerson b3439aa20b Guard against broken code (issue 31023)
Change-Id: I9f53abb1257a3ffc86dc4bf46e2591c7f936d1fe
Reviewed-on: https://dart-review.googlesource.com/11940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-06 17:28:04 +00:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Max Kim 311dd0bb0c Modify autocompletion test case to work with new feature added
Request offset and Length of plugin response must line-up if main Dart autocompletion has suggestions already.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2913903002 .
2017-05-30 17:14:48 -07:00
Brian Wilkerson 013411c10b Allow plugins to provide completions for non-dart files
R=maxkim@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2910463002 .
2017-05-25 10:53:07 -07:00
Brian Wilkerson 7e11a13cf5 Add requestTime to responses
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2890163004 .
2017-05-18 10:32:47 -07:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson 27f9e5e4ce Reverse the sense of the flag to make it easier to find test that need to be converted
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884593003 .
2017-05-15 08:40:40 -07:00
Brian Wilkerson 3085734ef6 Generate common types into a separate library
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2880443006 .
2017-05-13 08:12:14 -07:00
danrubel 98825b4918 improve code completion abort request tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2876793006 .
2017-05-12 13:28:39 -07:00
danrubel 66bb2d618e Remove unused analysisContext from completion request and contributors
Now that the analysis server uses the new analysis driver,
the CompletionRequest analysisContext field is always null.
This change removes that field and much of the unused code.

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

Review-Url: https://codereview.chromium.org/2877653002 .
2017-05-11 09:38:50 -07:00
Brian Wilkerson 3b2c3ae5b2 Add support for built-in plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2874803003 .
2017-05-10 13:31:20 -07:00
Brian Wilkerson 2a4772a537 Remove unnecessary tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2868233003 .
2017-05-10 09:15:36 -07:00
danrubel eb15a4c7c9 add constructor initializer completions
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2869653002 .
2017-05-08 05:52:12 -07:00
Brian Wilkerson e55812a3f2 Unify the server and plugin versions of the generators
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Brian Wilkerson d98d672c16 Add completion support for plugins.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2842243003 .
2017-04-27 10:26:46 -07:00
danrubel 02adcc9614 suggest catch and finally keywords
After a try block that does not have a "catch" block,
suggest the "catch" keyword and nothing else.
After a "catch" block, suggest the "finally" keyword.

Fix https://github.com/dart-lang/sdk/issues/27560

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2662973007 .
2017-02-06 12:57:57 -05:00
Dan Rubel f33c3c1676 complete named params in constructors
This add completion suggestions for named parameters
in constructors and factories, and prevents other suggestions
such as type names, identifiers, etc when they are not appropriate.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2671533002 .
2017-02-01 14:36:41 -05:00
Konstantin Shcheglov fc30904a39 Completion with the new analysis driver.
It works for top-levels, fields, locals, prefixed expressions.

Integration is not the most efficient - we resolve the full unit.
It works fine for files with about 1000 lines, about 50-70 ms.

We could slightly improve timing if we prioritize completion over
navigation and highlight notifications, which are currently prepared
and sent before completion.

In giant files like src/dart/element/element.dart, about 8500 lines,
it takes about 400 ms from typing to receiving completion. The theoretical
bottom bound for such files is about 70 ms - time that it required to
parse, create unlinked bundle, ensure that the API signature is the
same, load linked bundles and prepare to resynthesize. On top of this
goes any time required to resolve a single method and completion itself.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2478963002 .
2016-11-06 10:45:46 -08:00
Konstantin Shcheglov 05a86a7495 Remove 'initializeTestEnvironment' from 'analysis_server'.
Also fixes the server_options_test.dart:22 test broken in https://codereview.chromium.org/2394683006/

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2402483002 .
2016-10-06 10:26:17 -07:00
Konstantin Shcheglov de4d8b3a78 Switch analysis_server to use 'package:test'.
I'm changing DEPS in the corresponding analyzer CL.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2394683006 .
2016-10-06 08:47:15 -07:00
Konstantin Shcheglov f8f4228728 Revert "Flush AST results for source outside of the analysis roots."
This reverts commit b115309531.

Revert "Use FlushTargetFilter to pre-filter targets before checking their results."

This reverts commit 2e24662c06.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2298043002 .
2016-08-30 19:55:10 -07:00
Konstantin Shcheglov b115309531 Flush AST results for source outside of the analysis roots.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2271803002 .
2016-08-23 14:53:51 -07:00
Konstantin Shcheglov 7d9d451730 Don't insert additional ':' when changing a named argument name.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2136223004 .
2016-07-12 17:25:55 -07:00
danrubel dbaf0c33b0 show only named argument suggestions - fixes #25198, fixes #23992
R=jwren@google.com

Review URL: https://codereview.chromium.org/1867063003 .
2016-04-08 12:54:31 -04:00
Jaime Wren 84b9a47926 Fix for issue 24555: import/export/part completion improvement.
BUG=https://github.com/dart-lang/sdk/issues/24555
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1860213002 .
2016-04-06 09:52:47 -07:00
Dan Rubel 3b18b656c3 tests to assert completion suggestion replacementLength includes entire URI
https://github.com/dart-lang/sdk/issues/26083

R=jwren@google.com

Review URL: https://codereview.chromium.org/1843513003 .
2016-03-31 12:38:38 -04:00
Brian Wilkerson 338c95be8c Sort the files in analysis_server
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1834423002 .
2016-03-28 18:25:29 -07:00
danrubel 3fc06a4aa7 abort completion request - fixes #24271
This CL aborts completion requests (returns empty list of completions)
if either a newer completion request is received
or the source changes after the completion request was received.

In addition, I wrapped calls to AnalysisFutureHelper computeAsync
in exception handlers so that it will be easier to track async exceptions
back to the code that requested the computations.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1685653002 .
2016-02-10 12:45:53 -05:00
Dan Rubel 99c3be6331 remove old completion API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1536073002 .
2015-12-19 11:09:48 -05:00
Dan Rubel 39d5abb662 remove internal streaming of results, remove obsolete test, cleanup unused code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1538883003 .
2015-12-18 10:52:21 -05:00
Dan Rubel 1adabf4abc remove extraneous classes and cleanup code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1535643004 .
2015-12-18 08:53:39 -05:00
Dan Rubel fbaba56375 move DartCompletionSorter to dart specific contributor
consolidate common test code
remove duplicate test

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1539693002 .
2015-12-17 17:54:29 -05:00
Dan Rubel baf03ebdfe merge completion suggestions based upon relevance
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1536823002 .
2015-12-17 16:22:40 -05:00
Dan Rubel b3fa2629bf remove CompletionCache and obsolete tests, and cleanup imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1533973002 .
2015-12-17 16:00:34 -05:00
Dan Rubel 661cd4e9b9 report invalid param if offset is out of bounds
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1531353002 .
2015-12-17 14:58:14 -05:00
Dan Rubel 5e128e2544 suggest IDENTIFIER not INVOCATION for dartdoc refs
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1530393004 .
2015-12-17 11:00:15 -05:00
Dan Rubel 3bf298760f extract InheritedReferenceContributor from imported reference contributor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1533613004 .
2015-12-16 16:20:53 -05:00
danrubel 8a99902b94 suppress all dart contributor suggestions in comments
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1522003003 .
2015-12-14 18:50:18 -05:00
Dan Rubel 7ad6c0f1f9 extract LibraryPrefixContributor from imported reference contributor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1517693004 .
2015-12-10 22:42:53 -05:00
danrubel dcacf6145b extract LibraryMemberContributor from prefixed element contributor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1507303002 .
2015-12-08 15:10:32 -05:00
Paul Berry de3a1b22c8 Merge remote-tracking branch 'origin/master' into analyzer-breaking-0.27 2015-12-07 07:04:07 -08:00