Commit Graph

384 Commits

Author SHA1 Message Date
Ben Konyi b036052077 Reland "[ Service ] Update VM service message to not reference Observatory"
This reverts commit ee5837aa7a.

Updated Intellij plugins have been published which support the new
message.

TEST=CQ

Change-Id: I81f6d878f036991a95cc1f58d3102015e77aa609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237741
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-03-17 23:15:57 +00:00
Danny Tuppeny 094c598703 [analysis_server] Change empty linked edit groups to have placeholder text
Change-Id: Id687c4db11a1b43507f61e6d8ff5775ccccc819f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-15 20:03:33 +00:00
Konstantin Shcheglov 41b3e0abcc Make 'content' required in ResourceProviderMixin.newFile()
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:31:48 +00:00
Konstantin Shcheglov 1d9b85024f Fix merge error for newBuilder() invocation.
Change-Id: If8c470d1d142c27807cb7e9324df369d795930df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236304
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-03-09 19:01:03 +00:00
Konstantin Shcheglov 1693908268 Apply file changes between (not during) other operations.
This would be a breaking change, so for now it is disabled, but
the method `applyPendingFileChanges()` can be added, and the clients
will call it to be ready for the switching the flag.

Only clients that call methods like `changeFile` have to await applying
the file changes. Other clients can continue using synchronous
`currentSession`.

Change-Id: I0f8d4cc874f485776f611790f6c80fd7e07c8051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-09 18:16:45 +00:00
Danny Tuppeny 77c650433f [analysis_server] Add support for empty linked edits
Change-Id: I8e3a57732ecb36712e754549333d551bb0a47e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-09 16:38:25 +00:00
Danny Tuppeny 0501b497bb [analysis_server] Ensure imports are not inserted after exports or between part directives
Change-Id: Id5137f9a9a65cd66124d375ac4c43c6726714255
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-02 22:00:49 +00:00
Danny Tuppeny f5bd632abe [analysis_server] Ensure imports are always added before other code being inserted in DartFileEditBuilder
Change-Id: I390f24ac10f7f061e79c9bfed616e9bcc908d240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234604
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-02 16:37:26 +00:00
Konstantin Shcheglov 27dbfdd6b4 Revert "Copy 'meta' and 'js' packages from pkg/, instead of partial duplicates."
This reverts commit 7395ec9a6a.

Reason for revert: Breaks analyzer tests in google3, breaks linter tests.

Original change's description:
> Copy 'meta' and 'js' packages from pkg/, instead of partial duplicates.
>
> It does not seem to affect timings of running tests, at least locally.
>
> Change-Id: Icc7c86b5fa6deaf18032e701d685911b50e7591e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234683
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ib47fbbc9ff743f5a4ea35504d268ee92c8072ac8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-01 05:13:47 +00:00
Konstantin Shcheglov 7395ec9a6a Copy 'meta' and 'js' packages from pkg/, instead of partial duplicates.
It does not seem to affect timings of running tests, at least locally.

Change-Id: Icc7c86b5fa6deaf18032e701d685911b50e7591e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-01 01:33:17 +00:00
Ben Konyi ee5837aa7a Revert "[ Service ] Update VM service message to not reference Observatory"
This reverts commit f9147d933e.

TEST=N/A

Change-Id: Idef34b70f1066ddf79d02588dfba7caeec443e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234325
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-02-24 18:32:14 +00:00
Ben Konyi f9147d933e [ Service ] Update VM service message to not reference Observatory
See https://github.com/dart-lang/sdk/issues/46756

TEST=Existing

Change-Id: Ib71bf00d667369d7438a4547ae444951ec0979df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233504
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-18 20:53:52 +00:00
Danny Tuppeny 4f9a044418 [analyzer_plugin] Ensure FileEditBuilder updates linked positions correctly
Without this change, any linked edit groups that fall between the offset and offset+length of the new edit are not updated, which means new edits can be inserted that overlap with the linked edit groups instead of pushing them along by the delta.

Change-Id: If3e60bfa1efa4736f91bb85eb29cd785e933e78c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232099
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-02-16 19:39:40 +00:00
Konstantin Shcheglov d5269652d8 Remove 'index' from enum classes.
Change-Id: I7632aced8cde06c449e694c028d0e7fb2d3312df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232426
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-11 17:35:17 +00:00
Konstantin Shcheglov 4a122c0b5a Add completion tests inside enum declaration.
As we discussed some time ago, it is not clear to me where some
tests should go. Here, I put it into "location" tests, and checked
locations that seem strongly associated with the enum - its header,
its body; including the `WithClause` on the enum.

It is less clear where tests for completion inside the header or
the body of a method inside of an enum should go. I initially
planned to put them into `declaration/enum_test.dart`, but now
starting to doubt. The tests there are currently for using an
enum from outside.

Change-Id: Ife091f82bbb0ad1f26df984be42aa93a78595816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-10 20:26:01 +00:00
Konstantin Shcheglov 52290eba28 Add CompletionSuggestion.libraryUri, keep isNotImported.
Change-Id: I1bce246c2d8eaa968a47ae6ba82114592b991a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-04 22:49:10 +00:00
Konstantin Shcheglov 540c053ca8 Add HighlightRegionType.EXTENSION
Change-Id: I375df19b8ee5f6570fcc7d440b9d71b148bcef73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-26 16:11:59 +00:00
Danny Tuppeny 32b3e18e92 [analysis_server] Insert "required" keyword in created methods/added named parameters
Fixes https://github.com/Dart-Code/Dart-Code/issues/3770.

Change-Id: I954b9bbcac72ffc7a7b6e168214971bf1786872a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228564
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-01-20 17:00:37 +00:00
Konstantin Shcheglov 2170c061b0 Add Element.libraryUri and CompletionSuggestion.isNotImported
Remove libraryUrisToImport and libraryUriToImportIndex.

Change-Id: Iafe27d6fb0c5ce0c623567a0384a4579274b151f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227580
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-11 19:53:14 +00:00
Konstantin Shcheglov 7f07c9d3ff Replace Predicate with Function, remove java_engine.dart
Change-Id: If3ac722f855106c2350c3217c8e7d7ba69dfbaed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-12-12 03:32:31 +00:00
Danny Tuppeny 5064c19938 [analysis_server] Throw if ChangeBuilder.addDartFileEdit is used in a way that would lose edits
Change-Id: Ifee71a7b471512ba74bfbc4be5ce26d86a67da1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-12-09 18:55:34 +00:00
Konstantin Shcheglov 3b89039454 Deprecate Source.isInSystemLibrary
Change-Id: Ifb76cc37e5b0aa86713675cf27086f6ce7625fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220822
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-19 20:30:37 +00:00
Konstantin Shcheglov d6d45d96f8 Deprecate Source.modificationStamp
Change-Id: Id7f361beff1c4e3f9edc743c58cce7888d330c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 19:33:07 +00:00
Konstantin Shcheglov fb05622b3b Deprecate Source.uriKind
We almost can remove it.
Unfortunately surveyor/lib/src/analysis.dart uses it, so we need to
update it first.

Change-Id: I239d24506f99183147bf45744a6f8d66d3eb4f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220826
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-11-19 18:29:07 +00:00
Konstantin Shcheglov 7e6b3d83b8 Mark all Source.encoding implementations deprecated.
Change-Id: If12b9af54def3754a701477241d8364c283921ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 16:03:27 +00:00
Konstantin Shcheglov bb732826fb Stop implementing AnalysisTarget by Source, remove source and librarySource getters.
Change-Id: I3a1d81ea33641156dccc67b1ed486e449741a5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-19 16:02:47 +00:00
Siva Annamalai 8b14aba413 Revert "Reland Support overlapping deletions in quick fixes"
This reverts commit c1d4af3049.

Reason for revert: Broke Flutter, see https://github.com/flutter/flutter/issues/93206 for more details.

Original change's description:
> Reland Support overlapping deletions in quick fixes
>
> This relands both
> - https://dart-review.googlesource.com/c/sdk/+/217280, and
> - https://dart-review.googlesource.com/c/sdk/+/217287
>
> Change-Id: Icd32df8e5bdc64514e4383f2e5625c0b093f862c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219285
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: I282a7ea79777ca257333bb3c4b97d780695df902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219820
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-09 18:05:03 +00:00
Brian Wilkerson c1d4af3049 Reland Support overlapping deletions in quick fixes
This relands both
- https://dart-review.googlesource.com/c/sdk/+/217280, and
- https://dart-review.googlesource.com/c/sdk/+/217287

Change-Id: Icd32df8e5bdc64514e4383f2e5625c0b093f862c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219285
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-11-05 14:20:09 +00:00
Konstantin Shcheglov 9e5d26a31a Fix cast to Expression when completion in a comment token.
By some reason we started getting many of these recently,
showing in crash log.

Change-Id: I6373e8d4b56a32c7d66cc835f1ff6aefb4cd186c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-29 17:33:19 +00:00
Devon Carew e20ffbb3ce Revert "Support overlapping deletions in quick fixes"
This reverts commit ff34b81174.

Reason for revert: This causes a failing test when trying to roll the engine into flutter/flutter. See https://github.com/flutter/flutter/issues/92181 for more context.

Original change's description:
> Support overlapping deletions in quick fixes
>
> I believe that the tests cover the added behavior (and some existing
> behavior), but they aren't complete. I'll add more tests over time, but
> for now the test coverage is strictly better than it used to be.
>
> Change-Id: I8dd228cb2b3c477c28e6d20c6da4a549a30d1afb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217280
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: Ib50418544a2fd30c255ffc118b42c45aded3ae1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217760
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-10-22 00:12:46 +00:00
Konstantin Shcheglov 4487759dd2 Document new DAS completion APIs.
Change-Id: I2ff1f2c494033a62fead7d828d5d875b55eda203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215643
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-21 18:21:35 +00:00
Konstantin Shcheglov 3cd8dfe95b Deprecate MockSdk, switch to createMockSdk().
Change-Id: I512cd93af2f4aeab91f3d739c58c47572f3c4ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217151
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 18:52:15 +00:00
Brian Wilkerson ff34b81174 Support overlapping deletions in quick fixes
I believe that the tests cover the added behavior (and some existing
behavior), but they aren't complete. I'll add more tests over time, but
for now the test coverage is strictly better than it used to be.

Change-Id: I8dd228cb2b3c477c28e6d20c6da4a549a30d1afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217280
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 18:36:23 +00:00
Konstantin Shcheglov 0a8091f908 Change ConstructorElement.displayString to 'Class' or 'Class.constructor'
Change-Id: I0918cd9f97d2ec3af008f5369cbd048fc5137dc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216922
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-10-16 22:28:40 +00:00
Brian Wilkerson a25f41f605 Reorganize the range factory tests in preparation for some bug fixes
No tests were added or removed. I split the original class into three,
and renamed the test methods in the two new classes because the class
name now includes part of the information previously in the method
names. Nothing else changed.

Change-Id: Ie2b980906026b79c0ec24024e14fe328662e4900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216063
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-10-08 20:37:28 +00:00
Paul Berry 757d179380 Update nomenclature in ErrorCode and related classes.
This change standardizes most of the analyzer to refer to problem
messages and correction messages using the names `problemMessage` and
`correctionMessage` (consistent with the naming convention used in the
analyzer and CFE `messages.yaml` files).

Change-Id: I72f078a368c65b346626f560cc721fcff4836452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215151
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-10-04 19:50:37 +00:00
Ahmed Ashour dae0de9755 ChangeBuilder to always write parameters' types for Function
Fixes https://github.com/dart-lang/sdk/issues/29050

Change-Id: I89c0f2dab6d8bcd5af865c6e75022100df1596c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-29 17:02:21 +00:00
Ahmed Ashour a24d875ff6 ChangeBuilder.writeType to handle nullability of Function
Bug: 29050
Change-Id: I2ec8e0a49c626f75ebd1d21adad5d0d63123c54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-17 22:26:09 +00:00
Konstantin Shcheglov 7262decaea Remove WithNonFunctionTypeAliasesMixin and WithNullSafetyMixin from analyzer_plugin tests.
So, consistently with analyzer/, by default enable everything, and
disable with WithoutNullSafetyMixin as necessary.

Change-Id: I89079d3c1122a14ad338aa8f0d8008086a1fcb89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213295
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-14 16:57:45 +00:00
Konstantin Shcheglov 06f0ecb8e8 Add more HighlightRegionType.xyz_TEAR_OFF
Change-Id: I357d621439c68b77545bdd01719310c60684e1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212602
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 18:31:03 +00:00
Konstantin Shcheglov 1957af707c Use CONSTRUCTOR_TEAR_OFF for ConstructorReference highlighting.
Change-Id: Iee9731ef6e273ae89bc5328d6941aa8ddd530562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-07 16:08:02 +00:00
Brian Wilkerson df964d1c1a Fix a bug in OpType that caused it to compute the wrong completion location
Looking atanges to the tests I wasn't sure whether this was a good change
to make, but the metrics improve for both locations as a result:

CompilationUnit_declaration                   64.159  |     58.277     -5.882
CompilationUnit_directive                   Infinity  |     88.826  -Infinity

The tests mostly cover the case where insertion is between the two, and in
those cases we might want a blend of the two because it's impossible to know
whether the user is adding a directive after the last directive or adding
a declarartion before the first declaration. But that's a topic for a
different CL.

Change-Id: I2b82209ab77796d0bc8b9fc4a7c0ab91293c3746
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-08-25 00:45:35 +00:00
Brian Wilkerson 9db372e6f4 Make Location.endLine and Location.endColumn optional fields in the protocol
In https://dart-review.googlesource.com/c/sdk/+/191862 we added two new
required fields to `Location`. Unfortunately this was a breaking change
because plugins using an older version of the `analyzer_plugin` produce
location objects without those fields, leading to deserialization failures.

This CL makes those fields optional in order to fix the deserialization
issue.

Unfortunately, the `analyzer_plugin` package was published after the
required fields were added. Making them optional is a breaking change
because the constructor parameters go from being positional to being
named parameters.

We also neglected to update the version number of the protocol as part
of the previous CL. Technically this is also a breaking change for clients
of the analysis server, but given that they had no way to test to see
whether these fields existed they would need to have been written as if
the fields were optional in order to reference them at all, so I think
that from a practical standpoint it isn't a breaking change. That does,
however, raise the question of whether we should increment the version
numbers as part of this CL.

Change-Id: I35fc1f8e950669a3d8dd33cee6b81890261b5c47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206942
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-07-15 17:35:55 +00:00
Konstantin Shcheglov 79327c9f05 Make ResolvedUnitResult.content/unit non-nullable.
Change-Id: Ia79567d248f2c91290bfdf8204ea7e9f3dc85fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206668
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-14 02:33:10 +00:00
Konstantin Shcheglov cac96f7f8d Rename AnalysisSession.getXyz2() into getXyz().
Change-Id: Ia76aafc6a1190dcdca026097c364270389f2860a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206565
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-12 22:42:58 +00:00
Konstantin Shcheglov b3fb8c55e5 Fix AbstractYamlChangeBuilderTest on Windows.
TBR

Change-Id: Iade698221c78f0f1838e67f0e2fb6bff3a8f812e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206564
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-07-12 18:14:13 +00:00
Brian Wilkerson 3207a318a4 Create YamlChangeBuilder as a place to support structured edits of a yaml file
Change-Id: I2206b7924d3dad88eab70c60cf279fa1b706420b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206101
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-07-07 14:54:00 +00:00
Konstantin Shcheglov 394cff2758 Deprecate CompilationUnitElement.types, use classes instead.
Change-Id: Iffdc077d24f2387956953fd8b479d782f5217441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202729
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-06-07 22:04:13 +00:00
Brian Wilkerson cf5a9c4250 Suggest functions with a void return type in an expression function body when the parent closure returns void
Change-Id: I1cedcba4a486c886a5670283c988f66887199213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202141
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-06-02 22:44:44 +00:00
Danny Tuppeny d3082bcb3e [analyzer] Add folding regions for parameters
Fixes https://github.com/Dart-Code/Dart-Code/issues/1201.

Change-Id: I2865337861397ae15d2c4515b009fa22c678b5b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201182
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-24 17:13:35 +00:00