Commit Graph

207 Commits

Author SHA1 Message Date
Konstantin Shcheglov e18fd7c3e7 Remove the test for getNavigation() and removing the analysis context.
The test times out, because we don't get any answer on our getNavigation().
Technically this happens because we dispose the corresponding instance
of AnalysisDriver, so it is removed from the AnalysisDriverScheduler,
and getResult() never completes.

Which, I think makes sense.
Once the analysis root is removed, the client cannot expect answers.
So, there is no need for the test.

R=brianwilkerson@google.com

Change-Id: I124ac3d6a4a903880c7b8f82cafe692b38c59017
Reviewed-on: https://dart-review.googlesource.com/57903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-06-01 17:41:04 +00:00
Danny Tuppeny 46043004d6 Move folding regions to actual blocks
This puts the region inside the braces; eg. the bit the user would expect to disappear when the region is collapsed.

Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I58b347d2e1582bb4a6a35cf45c17085ea1739816
Reviewed-on: https://dart-review.googlesource.com/54402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-10 07:44:10 +00:00
Danny Tuppeny b73541cffe Add a skeleton for Dart Folding
Only currently adds a single region around Directives.

Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ibde0400c5815c00b1f94bf592d8cc9eb7cb592cf
Reviewed-on: https://dart-review.googlesource.com/54232
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-05-08 16:59:03 +00:00
Konstantin Shcheglov 1b8a3b1045 Implement support for overridden elements that are declared in mixins.
R=brianwilkerson@google.com

Change-Id: I70ca606b23b928481f24d1322cfbd01a9b3d3e5f
Reviewed-on: https://dart-review.googlesource.com/54071
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 21:56:25 +00:00
Brian Wilkerson 3575b810b3 Only add const in a constant context (issue 32819)
Change-Id: Ia149d812d2540fa98d76765ffb8b54fe32ecf010
Reviewed-on: https://dart-review.googlesource.com/50120
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-09 18:11:36 +00:00
Brian Wilkerson 7e53bb0689 Add hint for optional new/const to hover
Change-Id: Id1df68e3446d24bceb96f13c92c721fafa63c859
Reviewed-on: https://dart-review.googlesource.com/48266
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-24 14:54:23 +00:00
Brian Wilkerson ea94e65b43 Make preview-dart-2 imply strong-mode
Change-Id: Ifa230f9e64a538e222557ea471dc728ad3dd01d7
Reviewed-on: https://dart-review.googlesource.com/46300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-03-13 17:15:39 +00:00
Danny Tuppeny 40d7fe87f1 Fix GetErrorsTest on Windows
Bug: https://github.com/dart-lang/sdk/issues/32226
Change-Id: I0636fb61ffdec435e5f84a6c85ae102151a5a609
Reviewed-on: https://dart-review.googlesource.com/43680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-26 15:27:37 +00:00
Danny Tuppeny 89240070b0 Fix AnalysisNotificationAnalyzedFilesTest on Windows
Bug: https://github.com/dart-lang/sdk/issues/32226
Change-Id: I9d8c333f0c5070d932645d34986dc931b0038b61
Reviewed-on: https://dart-review.googlesource.com/43022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-22 17:33:06 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

Closes #32230
https://github.com/dart-lang/sdk/pull/32230

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +00:00
Konstantin Shcheglov a412f24e41 Add tests for highlighting implicit instance creation.
And in general run analysis server tests with `previewDart2 = true`.

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

Change-Id: I063d667e96a46d60d3b10aa1a87b4c7a7d2252e5
Reviewed-on: https://dart-review.googlesource.com/42101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-16 20:52:01 +00:00
Konstantin Shcheglov 6790cc30ef Highlight class names in instance creations as constructors.
This is needed for better highlighting optional new/const. I think the
main reason is that 'new' is highlighed and we knew that this is a
new instance creation. Constructors are also highlighed in the default
color scheme. But class names are not. So, to make code look colorful
again, we need to highlight class names in instance creations.

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

Change-Id: I8fde0b4aa5243e94d7ba575a74d52d31d3b665bb
Reviewed-on: https://dart-review.googlesource.com/42021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 17:50:27 +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 4ecd8f7213 Enable the analysis of pubspec.yaml files in server
Change-Id: I97c66b357d624cdcd6259c099b6421eb87c317c5
Reviewed-on: https://dart-review.googlesource.com/31404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-24 17:20:42 +00:00
Konstantin Shcheglov 1f41c3778c Extract more unit-test like OutlineComputerTest.
R=brianwilkerson@google.com

Bug:
Change-Id: Ibdadbd656d6cd85cd01a6a68d425dbd20a0b07ea
Reviewed-on: https://dart-review.googlesource.com/16420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-10-25 04:27:39 +00:00
Devon Carew a5c2256455 Send test element kinds for test outline items.
Bug:
Change-Id: Iebea8d4b9705c726e297722ef1678e1a2cd1ea96
Reviewed-on: https://dart-review.googlesource.com/12841
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-11 17:00:41 +00:00
Devon Carew fd4528fffb Make closing labels slightly less noisy.
Bug:
Change-Id: If916adb1cceab14c9260f288bf59878c6955f3ce
Reviewed-on: https://dart-review.googlesource.com/9000
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-27 18:52:25 +00:00
Brian Wilkerson f6e3e1f549 Add outline support for the test package
Change-Id: Iff938d55082b3b222cf801ea53d4eaf5feb1e094
Reviewed-on: https://dart-review.googlesource.com/6980
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-09-19 18:59:54 +00:00
Devon Carew 2b3b0272c4 Switch to using specific throws calls instead of general throwsA() calls.
Bug:
Change-Id: Id604dca1b8c3060c1d12c9ed0b1493771d2eb0d6
Reviewed-on: https://dart-review.googlesource.com/5883
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2017-09-14 18:04:44 +00:00
Devon Carew b12d010064 Remove the use of deprecated package:test API.
Bug:
Change-Id: I671678117f72efac5efd60d7b4e459dffcce47c6
Reviewed-on: https://dart-review.googlesource.com/5542
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-13 21:55:00 +00:00
Brian Wilkerson 23bcc17a61 Use the NavigationCollector from analyzer_plugin to avoid duplication
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3002253002 .
2017-08-25 07:25:16 -07:00
Danny Tuppeny 0647d9a228 Improvements to analysis server closing labels (#30411)
* Tweak comment that was based on integration test verison.

See #30285

* Include additional 1/2-line spans that end on same lines as >2 line spans.

See #30285

* Add tests to ensure no unwanted closing labels from multiline expressions.

See #30285

* Don't show closing labels for code inside interpolated strings.

See #30285

* Remove unwanted @soloTest.

See #30285

* Make casing of test names consistent.

See #30285

* Add a constructor and make fields final.

See #30285

* Use putIfAbsent for adding to map.

See #30285

* Shorten closing labels constructor.

See #30285

* Run "Sort members" on closing labels files.

See #30285

* Remove unnecessary type annotations.

See #30285
2017-08-11 11:04:34 -07:00
Danny Tuppeny 619f2995ab Implement analysis server closing labels (work-in-progress) (#30372)
* Add empty closing labels computer/visitor and tests.

See #30285

* Add initial implementation and test for closing labels.

See #30285

* Add various tests for analyzer closing labels.

See #30285

* Fail tests if errors occur.

Without this the notifications will never come through and the test will time out. This causes them to fail right away on errors.

See #30285

* Add test and fix for crash that occurred during testing.

See #30285

* Remove unnecessary abs().

See #30285

* Remove question that has been answered (yes).

See #30285

* Remove unnecessary .argumentList on spansManyLines check.

See #30285

* Add test for prefixed import and constructor names.

The behaviour seems like what we want, though need to confirm if this is the best way to do it.

See #30285

* Add additional prefixed tests and another TODO.

See #30285

* Fix method invocations to show full target/name.

See #30285

* Fix constructor invocations to not use toString().

See #30285

* Convert most closing label tests to unit tests.

See #30285
2017-08-09 14:13:47 -07:00
Konstantin Shcheglov b1589bf879 Replace typed_mock with mockito in analysis_server.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2991773002 .
2017-07-26 08:14:25 -07:00
Brian Wilkerson 8bbf373a5e Remove the analysus.reanalyze request from the plugin API
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2988743002 .
2017-07-25 12:10:52 -07:00
Konstantin Shcheglov 939d8aaf6d Issue 30238. Fix for subscribing for a notifications with already cached analysis result.
With the new 'sendCachedToStream' option we can control that whether
cached analysis result is also reported into the 'results' stream when
it is desirable (when we do this to send analysis notifications from
the stream listener). Or not, when it is not desirable, e.g. when we
ask becaue we need the results unit for Quick Assists.

R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/30238

Review-Url: https://codereview.chromium.org/2989633002 .
2017-07-25 10:28:25 -07: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
Konstantin Shcheglov 78f78feaf8 Don't include *.yaml files in 'analysis.analyzedFiles' notification.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review-Url: https://codereview.chromium.org/2980653002 .
2017-07-11 14:19:15 -07:00
Konstantin Shcheglov b3fe985371 Use AnalysisDriver.getCachedResult() for 'implemented' notification.
In general case we cannot use getResult() in this notification.
We generate these notifications after analysis is complete in scheduler.
But if there is no cached result, getResult() will schedule analysis.
So, we might get into a loop.

In practice this worked, because IDEA always makes files priority,
so their results cached, and then subscribes for notifications.
But in general case we need this protection.

This also means that the 'implemented' notification works (and will
work) only for priority files.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2965533002 .
2017-06-29 09:57:20 -07:00
Konstantin Shcheglov 256d6fa704 Remove the stale test for discarding notifications.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2961173002 .
2017-06-28 14:27:38 -07:00
Konstantin Shcheglov 911263f240 Remove the old index.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2963773003 .
2017-06-28 13:44:05 -07:00
Brian Wilkerson 9ddb832e10 Generate constants in server as we do in plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2960073002 .
2017-06-28 08:21:33 -07:00
Brian Wilkerson 55d735911b Remove the unused operations queue
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2957643002 .
2017-06-23 09:04:13 -07:00
Konstantin Shcheglov 9600dab0e0 Enable 'analysis.implemented' with the new analysis driver.
It is not very efficient on large files, but works well enough for small
files. I will work on making it more efficient in following CLs.

R=brianwilkerson@google.com, devoncarew@google.com
BUG= https://github.com/dart-lang/sdk/issues/29113

Review-Url: https://codereview.chromium.org/2942753002 .
2017-06-16 09:13:45 -07:00
Brian Wilkerson a0d7d64f0b Convert more tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936123002 .
2017-06-13 19:38:59 -07:00
Brian Wilkerson 4da8380881 Convert more tests to use the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939803002 .
2017-06-13 12:04:25 -07:00
Brian Wilkerson 1e9ae646ff Clean up some hints
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939723002 .
2017-06-13 09:24:50 -07:00
Brian Wilkerson 67ff4d4c47 Convert more tests to the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933943002 .
2017-06-12 14:10:14 -07:00
Brian Wilkerson 65d05524ce Remove some unnecessary tests for non-driver mode
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2935733003 .
2017-06-12 11:31:09 -07:00
Brian Wilkerson d9749ef0ac Get the highlights test to work with the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2934863002 .
2017-06-12 11:30:24 -07:00
Brian Wilkerson 265ef252ae Write type parameters when writing members (issue 29714)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2909943004 .
2017-05-30 12:19:15 -07:00
Brian Wilkerson 1b4679cacd Clean-up several warnings
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2912883003 .
2017-05-30 09:04:41 -07:00
Brian Wilkerson a7cc00e01a Make server forward getNavigation requests to plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2908633002 .
2017-05-25 14:49:35 -07:00
Brian Wilkerson 7d26ff6d4f Remove some more library directives
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884233004 .
2017-05-17 08:02:08 -07:00
Dan Rubel d566906167 cleanup unused incremental resolution
* remove unused analyzer incremental resolution
* remove unused Token.applyDelta method

Patch Set 1 is the original CL that was landed and reverted
https://codereview.chromium.org/2876993005

Patsh Set 2 contains additional fixes and test changes

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884853002 .
2017-05-16 07:53:17 -04:00
Brian Wilkerson 0b5bee6c66 Fix a failing test (TBR)
Review-Url: https://codereview.chromium.org/2877353003 .
2017-05-15 09:49:22 -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 38143be701 Fix an error to fix the bots (TBR)
Review-Url: https://codereview.chromium.org/2883883003 .
2017-05-15 09:11:12 -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