We use previously added `CompilationUnitElementImpl.macroGeneratedContent`
to access the current combined content.
In order to make this work with current IntelliJ plugin, without
adding new protocols, we store the generated code into a new file,
and locations for macro-generated elements are in this file.
Locations for elements that are not macro-generated are still
in the source file.
We use `ElementLocationProvider` to separate writing to the file
system, and do this only in DAS.
Change-Id: Ib156c67b0bf1f3474eb06584e76aa532abd597d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Fixes https://github.com/dart-lang/sdk/issues/45919
(The bulk fix test is not awesome but the lint doesn't fire multiply in one `==` so overlaps are infeasible.)
Change-Id: I6fec933f0ba62e794c1b71a6ccb255ed92c4887b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209661
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I missed this as part of my previous CL.
Change-Id: I07f2d6a4e0b60433afb39ee1b0a4819147a494aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This saves the ExtensionMemberResolver from having to access the
current scope in order to find out what extensions are available.
This will help prepare for a follow-up CL in which I separate the
"scope lookup" and "type analysis" phases of resolution.
As a side benefit, the analysis server no longer needs to go through
`package:analyzer/src` in order to include extensions in completion
results.
Change-Id: I6098eae219b0f7ef52b7c68f1d64c149d9e66823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is a reland of 9cbc497d0a
Original change's description:
> [analyzer] Use "pub outdated" to get version numbers for pubspec completion
>
> Change-Id: Ic8ef9514946070d590fc4594db4d8474912b40ff
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207760
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: I8acd224c7982312c48039a1cb439323e040b3859
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208324
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This will be used in internal builds to ensure that an exception
occuring during linting fails the build; this should help us be more
confident in the robustness of the linter code.
Change-Id: I4eaa47044b32b45433a67cc919ad047663dc771c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reverts commit 9cbc497d0a.
Reason for revert: Breaks the flutter build
Original change's description:
> [analyzer] Use "pub outdated" to get version numbers for pubspec completion
>
> Change-Id: Ic8ef9514946070d590fc4594db4d8474912b40ff
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207760
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
TBR=brianwilkerson@google.com,danny@tuppeny.com
Change-Id: I78f8658385f3175d07bd453af0f110eff04741ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit c7421d3406.
Reason for revert: breaks Cider in google3
Original change's description:
> Switch Workspace to Packages.
>
> PackageMapUriResolver is still based on Map.
>
> Change-Id: If6ed2d3181129a6605f60dddd8de5783fafa09d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206700
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TBR=scheglov@google.com,brianwilkerson@google.com
Change-Id: Icdd360f226ab70df5b19711e49345c4d66f8d8b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
PackageMapUriResolver is still based on Map.
Change-Id: If6ed2d3181129a6605f60dddd8de5783fafa09d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
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>
So that we don't need to keep `ResolvedUnitResultImpl.unit` nullable.
Change-Id: I498c6a7e53df8e8844ce1cfe5d52c4f2cb58958b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This change is necessary to make `ResolvedUnitResult.unit`
non-nullable.
AnalysisDriver is not API, looking into google3 it seems that there
are no `results` usage outside of analyzer and analysis_server. So,
it should be also de-facto not a breaking change.
I'm somewhat in doubt, maybe add `SomeResult` and use it instead of
`Object` here. This interface should be them implemented by all
other result interfaces, such `SomeFileResult`, `SomeResolvedUnitResult`,
etc.
Change-Id: I2912ed2ddf23753757ff2d85d56193fa411f1225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The function was likely far out of date, and this way we don't need to
update it every time we add a fix.
Change-Id: I02ba3e7eade48cab2d427b3cee7861a2183c462f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This also cleans up the code that prompted the change to use the new
getter (and removes an unnecessary method).
Change-Id: Ie5763822ac82b8cf935b689b6d19aea3298b54ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>