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>
For instance members we do this because this is the best that we
know about the result, and any successful override will be more
specific. But static members never can be invoked this way. So, we
don't do recovery for recovery.
Bug: https://github.com/dart-lang/sdk/issues/46472
Change-Id: Ifbd274011e159c3c8ae35d343603c02bb7599d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@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>
This adds support for both declaring an unnamed constructor with the
explicit name, "new", and support for invoking an unnamed constructor
as a named constructor named "new".
The parser will report EXPERIMENT_NOT_ENABLED if the experiment is not
enabled, as the parser takes care around the keyword, "new".
Tearoff support will be separate.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Iaf3af333dd22337b560aa7f4e5811a4cb38b2a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@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 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>
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>