Commit Graph

36 Commits

Author SHA1 Message Date
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Brian Wilkerson ec04c1f335 Remove some unnecessary ignore comments
Change-Id: Iafa4b9c8aa5dc696c5746248a8701b4f6e875979
TEST=Existing tests.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-18 19:58:43 +00:00
Konstantin Shcheglov f1094d5c3a Use newPubspecYamlFile() to create pubspec.yaml files
Change-Id: I181a3f3f14810019731201bf43e27befa7bc5481
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-22 21:32:00 +00:00
Konstantin Shcheglov d9d7324b27 Issue 43777. Update analysis_server/ tests to run when Null Safety is enabled by default in 2.12
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: Ibd1da16b58b8304d6f1d4260615c7049fc5ffe59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169141
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-27 18:19:33 +00:00
Mike Fairhurst 1134a0f17c [analysis_server] Remove unused dart:async imports
Change-Id: I764ee78cb9e31bdb3abaa36ca4754e1fed180311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161447
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:29:52 +00:00
Brian Wilkerson 15fb170ffb Enable the new code completion relevance feature
The new feature will be enabled by default but the option still exists
so that users can disable it if they want/need to.

Change-Id: I9e001b00b5dfe132a6b7bcfdcacd3143fb24f65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156121
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-07-29 17:14:44 +00:00
Konstantin Shcheglov 326f7b4a8f Remove DartSdk.useSummary.
Initial:  https://dart-review.googlesource.com/c/sdk/+/149495
Reverted: https://dart-review.googlesource.com/c/sdk/+/149687
Change-Id: Ibd3f1af1aef83adc35f77cfbda66e07c5ae99922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-03 15:56:41 +00:00
Brian Wilkerson ab73158758 Fix the windows bot and update MockSdk
Fixing the test that's causing the Windows bot to fail required updating
the MockSdk, which cause a lot of other changes. I would have done this
in two separate CLs if I'd known how big this was going to get, but I'm
hoping it isn't too big.

Change-Id: Idee56bab5e73a78ab7857e81177090493aa08b40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151874
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-22 14:34:25 +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
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson ce67d6ae27 Consolidate relevance tests into a single directory
Change-Id: Iee3a3553b17d2e8b3b6f479159e6fe560e44192f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140120
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-19 20:51:38 +00:00
Brian Wilkerson 2a2855c781 Perform new relevance computations for extension members
Sorry for the size of the change.

This started out looking like a fairly simple task of repeating the work
done for type mambers, but it was too similar so I ended up doing some
refactoring in order to share the code.

Along the way I realized that we didn't yet have a feature for demoting
deprecated members, so I added it.

Then I discovered some more places where the old and new logic were
getting intertwined, so I straightened that out as well.

Change-Id: Ic24babd30bbbeeae9709a8019642e497a2ebb65d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139949
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-19 13:34:19 +00:00
Brian Wilkerson 48ac44b0e9 Fix a typo in a comment
Change-Id: I4bbe3a7703cbd954aafd4e53b43649a29617f571
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-14 00:28:28 +00:00
Brian Wilkerson 28309556e6 Add more coverage in the relevance tests
Change-Id: Iadf8c0f0931ba58aaad9aa03087011ea3bc62bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139481
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-13 16:27:51 +00:00
pq 1f9881b63f type member relevance test
Change-Id: Ifbe90c9478add7f1c7b93c1491ca6f08f96e9b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139145
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-03-12 01:16:30 +00:00
Konstantin Shcheglov 83378633e1 Add the attachment with the content of the file being analyzed.
Change-Id: I75b1c61e2d04cd5e03ef4375e97ef3c9f4add874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138384
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-03-10 04:57:20 +00:00
pq 6da009031c add static fields and getters to available suggestions
Fixes: https://github.com/dart-lang/sdk/issues/40699

Change-Id: Id60307de949395c2274cb35ac4d14521b301437d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-20 03:24:35 +00:00
pq fb840da85f update test expectations for changes in available declarations
Updated to keep up with changes to available declarations.

Change-Id: I80405f396e4946ebae93bc9501a68855d45dd3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-19 23:37:35 +00:00
pq 34cdc8112e getter/setter suggestion tests
See: https://github.com/dart-lang/sdk/issues/40689

Change-Id: I87837592d4af458583b1710190beee4672ae4cfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136408
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-19 21:19:45 +00:00
pq 75fff78f68 suggest mixins test
Change-Id: I01ee6a020342424fccba3f3f0fbdf5b7d8ffd626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135967
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-14 20:18:17 +00:00
pq a2c65a6ef1 tests for known ranking issues
Change-Id: Ia8fbd127ee95a02f0fb21678353e77f08b01d0a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-14 19:28:42 +00:00
pq f83770e1fe add available suggestions for getters/setters
Fixes: https://github.com/dart-lang/sdk/issues/40626

Change-Id: I765928864c719a4c7202f9bdc768c7a6e4d8e850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135789
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-14 17:42:39 +00:00
pq 9e2d9ecd92 tests for missing getter/setter available suggestions
See: https://github.com/dart-lang/sdk/issues/40626

Change-Id: I3e35b5d7bf849c1afd20b5bd512b7e8b201e2200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135783
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-13 22:46:39 +00:00
pq 867d6537df enum constant and named cons test cases
Verifies that our client algorithm addresses issues seen in IntelliJ (https://github.com/dart-lang/sdk/issues/40620) and worked around in VSCode (https://github.com/Dart-Code/Dart-Code/commit/ea7443dab3378a7a86b3bbe40db6843ab1d05ffd)

Change-Id: I2029d89559625ff666c947186d90484794f6b38b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-13 21:24:48 +00:00
pq d42b7bc15a partition imported/not-imported suggestion sets / de-dup
Change-Id: Iba72b3599e9153e9fac3dd883d7bdb272c25fa65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-13 15:57:28 +00:00
pq a0323c755f convert test path (for windows)
Change-Id: I8abb8605d1161147ae6bbcdb2139767b2ad020a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135621
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-13 13:53:48 +00:00
pq afaeb04137 sanity check project files for errors
Change-Id: Ie530f0aec435440abbcf4a1feb34ee7cb53ebab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-12 21:12:37 +00:00
pq 5fd18be9c5 track analysis errors
Adds analysis error tracking and fixes the enum declaration to not produce a warning.

I'm not happy with `assertNoAnalysisErrors` and would like something more configurable and context-aware but haven't thought it fully through.

Maybe something like:

```
assertNoErrors(
  except: ['unused_import'],
);
```

(And maybe a file and line number?)

Alternatively, we could add ignores to the test sources:

```
import 'a.dart'; // ignore: unused_import
```

and maybe special case the line we're completing on:

```
f(^);
```


Still mulling it all over but your thoughts are welcome!


Change-Id: I1d0c5fbd72c80dde13ae98cb76c3728ab00a12f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135440
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-12 15:42:57 +00:00
pq 42e840c6ae convert all paths
Change-Id: I6d32fd26e9959ad4b880e90a9ca61504d4e9be0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135345
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-11 19:24:44 +00:00
pq b9fbf58e33 filtering on kinds; relevance boosting
Change-Id: I4eaacd5da1b5435b116fdff7c1615e265d5ba96e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135321
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-11 18:42:54 +00:00
pq 30151a6541 wait for SDK suggestions
Change-Id: I7439daff3bf828406520a5a3c061928695258c84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135240
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-11 04:30:31 +00:00
pq 5457012b81 driver test suggestion support
Still some simplifying assumptions but on the path to correct.

Change-Id: I3f0d86fc3152ce3333b9d615ac700b703aa3b071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135205
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-10 23:40:05 +00:00
pq 10f2b8fc76 migrate path specification to driver clients
(Hard-wired paths are making tests harder to write.)

Change-Id: Ifb996e78c18cc8249b9ee0f18e6db52097778d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-10 19:06:25 +00:00
pq 3d97d22fe5 completion driver suggestions
The absolute minimum to see suggestions wired through.

Lots of work to flesh out the client-implemented algorithms.

For reference:

* https://github.com/Dart-Code/Dart-Code/blob/master/src/extension/providers/dart_completion_item_provider.ts
* https://github.com/JetBrains/intellij-plugins/blob/master/Dart/src/com/jetbrains/lang/dart/ide/completion/DartServerCompletionContributor.java

Change-Id: Idc78fca787b095e5b6236481b89ddb21c0ed9c94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134877
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-10 17:07:29 +00:00
pq 8439158668 completion driver wip
Gotta start somewhere.

All subject to revision.  (Names especially.)

This gets us an end-to-end test and a starting point for client algorithm implementations.

Note that this was designed to run outside `test/`.  We should be able to move it out if so desired.

Needless to say any thoughts on any of it are welcome!

Change-Id: Iecf5c7ce854f619aa5677454091ceb68dd45827b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134542
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-06 00:33:10 +00:00