Commit Graph

14 Commits

Author SHA1 Message Date
Konstantin Shcheglov 02db34a691 Elements. Remove most of AugmentableElement, rename to AugmentableFragment.
Change-Id: Ied24bb46b4b4a74cd06c69c5002e0b32edbdf70f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414582
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-11 14:49:59 -07:00
Konstantin Shcheglov 8ff42d9c1b Elements. Remove 'augmentation' and 'augmentationTarget'.
Change-Id: Idc22db2d10ee768179ddf1e2d9ff8e80a7d65f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-10 14:54:20 -07:00
pq 092728e8b5 [CQ] [server] anticipate strict_top_level_inference
Related to https://dart-review.googlesource.com/c/sdk/+/412383

(Note: presubmit required some re-formatting 🤷)


Change-Id: Ib18c7c1c1fceaa0007d804fbcb6397055242fa42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
2025-02-26 17:55:13 -08:00
Sam Rawlins fbf331e0dd DAS: reformat source code with tall-style
Change-Id: I42b4a44fd6a2197e499e8623274b3cd1a4b5556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394003
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 23:04:00 +00:00
Konstantin Shcheglov 67c21f7b67 Migrate from 'import augment' to 'part' in analysis_server/.
Change-Id: Iac57024ab48ed389b4578bc0fb2a2e620533812b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-09-03 19:45:55 +00:00
Konstantin Shcheglov 4c1e63a3c0 Augment. Report DUPLICATE_DEFINITION for enum/extension.
Change-Id: I54dfd33a9d0c630d868b05e9d5403e02cd7cff34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-07-02 20:21:00 +00:00
Danny Tuppeny d328e9c06a [analysis_server] Add highlights/semantic tokens for augmented()
+ tests for fetching semantic tokens for macro-generated sources.

Change-Id: I1811e5fd3eb3f5564a1d6f21348f9650e30eb536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-28 19:39:16 +00:00
Konstantin Shcheglov cc9de33052 Augment. Merge enum values.
Change-Id: I4bac24389449de6403a0c54d897b396650f7b94a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-19 17:32:30 +00:00
Konstantin Shcheglov 9a385638cd Augment. Basic support for enum elements..
Change-Id: I42e7b58f7edaa979740a8e5b6787665c7a79c54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-17 21:53:31 +00:00
Danny Tuppeny 32e593c3e3 [analyzer] Ensure Element.Identifier is unique for augmentations
Augmentations can have duplicated names within a library so this appends `nameOffset` to them (in the same way that local functions and closures do) to keep them unique.

Fixes https://github.com/dart-lang/sdk/issues/55408

Change-Id: I0b482e5a945dfb08c5a3cc0ab2254b386f24dd18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-04-10 17:13:22 +00:00
Danny Tuppeny 1baa0c5fd1 [analysis_server] Add tests for Augmentation/Augmented CodeLenses where there are multiple within a file
I noticed some CodeLenses were not showing up when a file has multiple augmentations/augmenteds of the same element (https://github.com/Dart-Code/Dart-Code/issues/5064). This adds some tests for this, some of which are marked as failing because I think the cause is a bug in `ElementImpl`/`ElementLocation` equality checks.

I've opened https://github.com/dart-lang/sdk/issues/55408 to discuss/track that issue.

Change-Id: I92e463568842367a863f989b2bb4f7f50808e2fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-04-09 17:23:22 +00:00
Konstantin Shcheglov d0e4ef7e6c Parse 'augment library' instead of 'library augment'.
Bug: https://github.com/dart-lang/sdk/issues/55374

Change-Id: I856c21f4b102fa589f5a14c3d28daf64e4112099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361286
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-04-08 20:34:30 +00:00
Danny Tuppeny 260ebec7a0 [analysis_server] Fix additional exception fetching CodeLens for missing/unresolvable files
The original code here was accessing `.result` on the result of `requireResolvedUnit` without checking it was an error. This meant if `requireResolvedUnit` failed, we would throw a new exception ("Value is not a result") instead of returning the original one.

Change-Id: I952edaac555eb4fccfb885f3f3c5bffc26ba0e90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-04-03 18:19:22 +00:00
Danny Tuppeny 8e1751f4ce [analysis_server] Add LSP CodeLenses for "Go to Augmented" and "Go to Augmentation"
These are on by default but can be toggled in the client with the "dart.codeLens" setting, either by disabling entirely:

```
"dart.codeLens": false
```

Or individually

```
"dart.codeLens": {
  "augmented": false,
  "augmentation": false,
}
```

They require a client-provided command to handle the navigation, so this also adds a "commands" section to the client capabilities (in "experimental", because that's the extension point for non-standard LSP) that allows the client to inform the server that it handles such a command (which is documented in the readme and implemented in Dart-Code in https://github.com/Dart-Code/Dart-Code/commit/ebe029c3f9aca724d386b3da10f414f624bc705a).

Change-Id: I91791c9f4aa5957c4ab4b9c0c5bb4fcf8ebeb717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359640
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-03-25 22:32:24 +00:00