Danny Tuppeny
7a16a44aee
[analysis_server] Add support for type inlay hints for dot shorthands
...
Fixes https://github.com/dart-lang/sdk/issues/61841
Change-Id: I0697c9a05639e723aec32e84b1680f72a2241d5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/458300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Kallen Tu <kallentu@google.com >
2025-10-29 12:12:23 -07:00
FMorschel
b668fc8d3f
[DAS] Fixes hover for try/catch error/stack
...
Fixes: https://github.com/dart-lang/sdk/issues/55907
Change-Id: I385483eaf5cba4fbac10b402cdb87ace51e9b020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456400
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Auto-Submit: Felipe Morschel <git@fmorschel.dev >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2025-10-24 21:55:08 -07:00
Danny Tuppeny
a0eb8c5783
[analysis_server] Fix Call Hierarchy target selection for tear-offs
...
This fixes `_findTargetNode` on function tear-offs. Previously it would take the parent node of many `SimpleIdentifiers` which in the case of a tear-off could be some random expression.
Now we only return something other than the `node` in some very specific cases where we're trying to handle constructors (so that the type name is not considered a call for named constructors, but is considered the constructor for unnamed constructors).
Fixes https://github.com/dart-lang/sdk/issues/61736
Change-Id: I815d4dc8e1f1eaadd5ee033abf9731666944e45e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2025-10-23 14:10:32 -07:00
FMorschel
b243e6aae5
[DAS] Fixes semantic token for FunctionType.call
...
Bug: https://github.com/dart-lang/sdk/issues/61319
Change-Id: I4b42c410ff8e901da546d71658e37a5da6a410aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451620
Auto-Submit: Felipe Morschel <git@fmorschel.dev >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2025-10-17 09:47:27 -07:00
Danny Tuppeny
25f86fe0ff
[analysis_server] Fix syntax highlighting for a function's "call" method
...
+ some additional Hover tweaks
See https://github.com/dart-lang/sdk/issues/61319
Change-Id: Ia1ab56ed4f186a820ce1b36402e1c7042ed23068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449802
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-10-07 11:09:38 -07:00
Sam Rawlins
33f664940a
Bump DAS to use Dart SDK 3.9.0
...
Change-Id: I04bc285d822a657adb5573c6de3eb38655ab0fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2025-09-03 12:56:29 -07:00
Konstantin Shcheglov
32124f25a0
API. Deprecate 'VariableDeclaration.declaredElement', use 'VariableDeclaration.declaredFragment'.
...
This makes API consistent.
Bug: https://github.com/dart-lang/sdk/issues/61231
Change-Id: I841dc10cd2ef4b28286d374af26c079dcf69179e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444863
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-08-12 14:30:49 -07:00
Konstantin Shcheglov
6311478193
Elements. Add documentationComment and metadata to Element and Fragment.
...
Bug: https://github.com/dart-lang/sdk/issues/61216
Change-Id: I46ee0dfe2a720d61b3b4576634cf623b8817d0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443149
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-08-01 09:04:47 -07:00
Konstantin Shcheglov
a278738f3c
Elements. Make PropertyAccessorElement.variable non-nullable.
...
The null assert in `PropertyAccessorElementImpl.variable` is safe
because `ElementBuilder` always creates synthetic
`TopLevelVariableFragmentImpl` or `FieldElementImpl` for a getter or
setter. And the other way around, non-synthetic
`TopLevelVariableFragmentImpl` or `FieldElementImpl` when created
associate itself with synthetic getter / setter.
Change-Id: I40e4ce866edffab6c8bcdf6e408bd1bbfbba6581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442246
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-07-25 15:45:02 -07:00
Fedor Shcheglov
f47cc4487b
Remove Xyz2 suffix getters from /analysis
...
Change-Id: I10221b86f63ee8a2d74938ef0438945b43e11f6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441990
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-07-24 05:54:30 -07:00
Danny Tuppeny
6477e0ebae
[analysis_server] Add basic configuration for controlling which inlay hints appear
...
Fixes https://github.com/dart-lang/sdk/issues/60326
Change-Id: Ic3247420ddc23cda6c4e459a6992721ab814f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/440940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2025-07-21 13:30:46 -07:00
Fedor Shcheglov
6a5c577465
Rename / deprecate more getters and methods.
...
* Deprecate `DirectiveUriWithLibrary.library2`, use `library` instead.
* Deprecate `ElementAnnotation.element2`, use `element` instead.
* Deprecate `LibraryImport.prefix2`, use `prefix` instead.
* Deprecate `MultiplyDefinedElement.conflictingElements2`, use `conflictingElements` instead.
* Deprecate `ScopeLookupResult.getter2`, use `getter` instead.
* Deprecate `ScopeLookupResult.setter2`, use `setter` instead.
Change-Id: I523eb21d194b661eed5bcbbfc923e9a7de87c962
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/440361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-07-15 15:10:55 -07:00
Fedor Shcheglov
8cfa901c6e
Rename nameOffset2 to nameOffset
...
Change-Id: I3c8051840122b6046bc89ed48ec329c825607fe5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/440180
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-07-13 20:44:49 -07:00
Fedor Shcheglov
7218145cd2
Deprecate appendToWithoutDelimiters2, correspondingSetter2, unnamedConstructor2, getNamedConstructor2, entryPoint2, exportedLibraries2, getClass2, getEnum2, getMixin2, exportedLibrary2, accessibleExtensions2, importedLibraries2, importedLibrary2, isImplementableIn2, join2, variable3, getter2, setter2, correspondingGetter2, superConstructorParameter2, aliasedElement2, typeParameters2, constantInitializer2, and isNonSubtypableClass2
...
Change-Id: I091804b9f200f525baf3979773dd489e3be17697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439640
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2025-07-09 20:34:14 -07:00
Konstantin Shcheglov
37bce89a04
Elements. Use FragmentImpl.nameEnd instead of nameLength.
...
Change-Id: If02b26cd8e1346aa34c8978dc286499975905a95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439547
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2025-07-09 14:36:53 -07:00
Fedor Shcheglov
933f3da0f7
Deprecate appendToWithoutDelimiters, correspondingSetter2, unnamedConstructor2, getNamedConstructor2, and typeParameters2
...
Change-Id: I42dcff17c5bb0c9d6c3ae55dcdd4df85d83cd076
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2025-07-09 11:13:07 -07:00
Fedor Shcheglov
1a88edceb7
Deprecate redirectedConstructor2, superConstructor2, children2, displayString2, getExtendedDisplayName2, isAccessibleIn2, thisOrAncestorMatching2, thisOrAncestorOfType2, constants2, field2, typeParameters2, children3, asInstanceOf2, instantiateInterfaceToBounds2, and instantiateTypeAliasToBounds2.
...
Change-Id: I82004d5d1c758aae51ec8c97645aa53ed8cc52bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2025-07-09 07:13:51 -07:00
Fedor Shcheglov
247ae2364f
Deprecate Element.name3, use name instead.
...
Change-Id: I24a5e4a519b9f3bf755912f21a5c192edd1dd4ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-07-08 14:13:49 -07:00
Fedor Shcheglov
14de1522e1
Deprecate Fragment.name2, use name instead.
...
Change-Id: Ic0506f50e9dc752b7e8e28f4299426be47407d4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439081
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-07-08 09:17:39 -07:00
Fedor Shcheglov
2242b2b61c
Delete AugmentedExpression and AugmentedInvocation.
...
The current specification no longer includes the `augmented` expression.
It was deprecated in
https://dart-review.googlesource.com/c/sdk/+/438560 .
Change-Id: Icd636cb1511e1d9ffa4dfb61bded1a91599fe09a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438820
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2025-07-07 14:26:45 -07:00
Fedor Shcheglov
ab49c6e912
Deprecate getters and methods within analyzer/lib/src/dart/ast
...
Change-Id: I100b713897275e0a76bca5e669f73786a2a94ab5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-06-30 14:28:51 -07:00
Fedor Shcheglov
ade10f4afb
Deprecate 'Element.library2', use 'library' instead.
...
Deprecate `LibraryElement.loadLibraryFunction2`, use `loadLibraryFunction` instead.
Change-Id: I117fb182e6bb62c1a76b3d578c0a6d4b6f32b9c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435920
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-06-24 17:23:11 -07:00
Fedor Shcheglov
318aeb322b
Deprecate DartType.element3, use element instead.
...
Change-Id: Idef9da09c565a05fa84869f7433df3c24c6fbb5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435521
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-06-24 07:23:11 -07:00
Fedor Shcheglov
22a74f5580
Format analyzer/ and analysis_server/ to dart format.
...
When running cl upload, I noticed that there were a lot of existing format issues, which this fixes.
Change-Id: I01611562c907dbc4151e28eceee4a1f5a51644dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-06-23 10:42:23 -07:00
Fedor Shcheglov
1dc17b9a22
Deprecate Element.nonSynthetic2, use nonSynthetic instead.
...
Change-Id: Ie47d5f1e1fbaa7473747c5b43333a9c0cd689f74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-06-20 08:57:19 -07:00
Brian Wilkerson
d9c681e748
Provide better hovers for super formal parameters
...
Change-Id: I9131eb0ee516e79580f530e6279ec1da08dde7e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434220
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2025-06-11 14:41:38 -07:00
Kallen Tu
beca727904
[analysis_server] Dot shorthands: Syntactic and semantic highlighting.
...
Added additional logic for handling highlighting for dot shorthands.
New semantic tokens and highlights tests passing.
Bug: https://github.com/dart-lang/sdk/issues/59836
Change-Id: I2e242732aade9471675731473532d6d3c6558281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433102
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-06-11 12:16:41 -07:00
Kallen Tu
5a17591682
[analysis_server] Dot shorthands: Hover work and tests.
...
Added some extra logic for handling dot shorthands in hovers. They should show the same information in the hover as if we had added the type in front of `.`.
Added a new line "Declared in:" to show the containing class information.
Bug: https://github.com/dart-lang/sdk/issues/59836 , https://github.com/dart-lang/sdk/issues/60864
Change-Id: If159d53b7c4443d8a8311125ceef66c441d39d4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431944
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2025-06-06 13:35:19 -07:00
Sam Rawlins
47f7c4fb87
analyzer: expose canBeConst and computeConstantValue as public API
...
Work towards https://github.com/dart-lang/sdk/issues/50986
These utilities are used by a handful of lint rules, and the analysis
server, which makes me think they could be offered as public API.
Change-Id: I12415c2b86ca6fb96b03def4a304da73c6fb4cae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430300
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-06-04 11:02:17 -07:00
Konstantin Shcheglov
e724547892
Elements. Deprecate Annotatable.metadata2, use 'metadata' instead.
...
Change-Id: Ic4a7d8f19cb1793031951aadeb340e5dadf4744c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430261
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-05-30 11:09:40 -07:00
Kallen Tu
009a6194b3
[analysis_server] Dot shorthands: Call hierarchy changes and tests.
...
Added work and tests needed for the call hierarchy to handle dot shorthands.
The element locator needed to be updated for the call hierarchy to work, so I updated that too.
Unit tests passing.
Bug: https://github.com/dart-lang/sdk/issues/59836
Change-Id: Id61e6071c5ff008300f7bd25f762a14f22e47595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431701
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-29 13:35:13 -07:00
Danny Tuppeny
d2c0f0ae16
[analysis_server] Support folding try/catch/finally blocks
...
Fixes https://github.com/Dart-Code/Dart-Code/issues/5201
Change-Id: I1790d3aa624d80ad0233216ca650d497f31c632b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431281
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-27 10:45:12 -07:00
FMorschel
5b4dc61717
[DAS] Fixes coloring for record fields access in extension
...
Fixes: https://github.com/dart-lang/sdk/issues/60625
Change-Id: Idce84fbdc9b58b2e91c2e40a058bf466e8d5fb65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426342
Auto-Submit: Felipe Morschel <git@fmorschel.dev >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-16 14:57:15 -07:00
Konstantin Shcheglov
78bc6da66c
Elements. Deprecate InstanceElement.xyz2, use 'xyz' instead.
...
Change-Id: Ie12b7596b70c77fd2f08520a423eeaf3b6978326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-05-16 10:24:25 -07:00
Konstantin Shcheglov
2db49488c1
CodeGen. Generate members of most leaf AstNodeImpl classes.
...
Every declaration annotated with `@generated` was generated. In the
current version there are `2180` such declarations. For comparison,
there are `2167` instances of `@override` in total, and `@generated +
@override` has `1576` instances, so we generate `72%` of all overrides.
The generator automatically formats and sorts `ast.dart` after applying
changes, so the result is nice and clean. We run a separate DAS instance
from the script to do this.
Things to improve in the future:
1. Generate for non-leaf classes.
2. Support for `DoNotGenerate`.
Change-Id: I05e6356c9aac68449d5117ad8fd533735f130c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-05-15 18:05:42 -07:00
Konstantin Shcheglov
05da3e1f22
Elements. Deprecate Element.enclosingElement2, use enclosingElement.
...
Change-Id: I055b1f9dd1c00605d813effcbbadb9cea874129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-05-15 13:47:32 -07:00
FMorschel
0de0d0ecd0
[DAS] Fixes escape characters coloring in interpolation strings
...
Fixes: https://github.com/dart-lang/sdk/issues/60692
Change-Id: If9f310405b424ffb1f15d1bda1db51f59d64e34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428020
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Auto-Submit: Felipe Morschel <git@fmorschel.dev >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2025-05-14 09:37:53 -07:00
Danny Tuppeny
8642ff0108
[analysis_server] Make fix/assists consistently use "initializing formal" instead of "field formal"
...
There was a mix of the term "field formal" and "initializing formal" in fixes and assists. This changes those that used "field formal" to "initializing formal" (which seems to be the term used most here and on the website).
I did not update all places that use this (for example there are many in the analyzer, including classes).
Change-Id: Ia4a1095a756adb35ca7faa8dc06c541abb04bfcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-13 16:24:46 -07:00
Danny Tuppeny
922cdf4b9d
[analysis_server] Add "label" mapping for semantic tokens
...
Fixes https://github.com/Dart-Code/Dart-Code/issues/5505
Change-Id: Iad8b405442c841b215d3697d87b0203bd06c0ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-13 11:51:10 -07:00
Konstantin Shcheglov
7eea262f06
Deprecate NamedType.name2, use 'name' instead.
...
Change-Id: I27725e1530c60a6aa2e197b97e027de1238c964a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-05-12 08:35:59 -07:00
Brian Wilkerson
5d6dc673dc
Make nodeCovering a method on CompilationUnitImpl rather than an extension method
...
This allows us to traverse the children without needing to create lists.
It also allows us to iterate over lists of nodes more efficiently.
Tested against the script that computes fixes for 10,000 diagnostics,
I'm seeing the following result.
Before this CL the average time was 10692.4 ms.
After this CL the average time was 1900.0 ms.
That's just over an 82% improvement.
Change-Id: Ideff745288c8990e9948b22c5204d176af3cac6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426904
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2025-05-07 09:05:52 -07:00
Konstantin Shcheglov
2cf84f8053
Elements. Rename most XyzElementImpl into XyzFragmentImpl.
...
Change-Id: I7902ccedd9d3e9ccde1091eb28aad98591791b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-04-28 08:35:25 -07:00
Konstantin Shcheglov
b2fdd8a345
Elements. Rename XyzElement2 into XyzElement.
...
The CL was done with rename + adding typedef for each class.
Change-Id: Ia25cc581d2e42cf7d12a85a3579af952d5c232ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-04-25 13:27:18 -07:00
Konstantin Shcheglov
49599e06cc
Elements. Deprecated element2.dart library.
...
Change-Id: I2be38df49e6f242d9fe59f34164549da4a0f41b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424683
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2025-04-25 11:23:18 -07:00
Konstantin Shcheglov
a564aef5eb
Elements. Remove ElementLocation.
...
Change-Id: I92b46c19878e4b0e27d2bf5e08b90bbb666df1e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-04-25 09:50:07 -07:00
Sam Rawlins
b0e12e56fd
DAS: Migrate many uses of NodeLocator to nodeCovering
...
Change-Id: I97d4137c2daaa562332a83eec4e11208bb008c38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423081
Auto-Submit: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-04-17 12:38:09 -07:00
Danny Tuppeny
823947b857
[analysis_server] Always show type parameters in LSP type hierarchy, not type arguments
...
The change at 27ba8fce6c (to fix https://github.com/Dart-Code/Dart-Code/issues/4217 ) added type arguments to the LSP Type Hierarchy (before, neither type args or type params were shown).
Showing type arguments seemed reasonable when looking at supertypes, but behaves oddly for subtypes (and also when invoked on a type with arguments), so this partly reverts that and shows type parameters in all cases instead.
This simplified the code a bit and removed the `TypeHierarchyAnchor` class we were round-tripping in order to preserve the type arguments.
Fixes https://github.com/dart-lang/sdk/issues/60549
Change-Id: I4e0e92d4c73712fde7a9526c51699ecdae0f4ab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2025-04-17 11:35:43 -07:00
Sam Rawlins
91e682940c
analyzer: Move coveringNode to public API
...
NodeLocator and NodeLocator2 are being deprecated in favor of this
extension method. We move it to the public API here and start using it
in the analysis_server_plugin package.
Change-Id: I4783bb1f511b798e52b3383dd600b154dccc6d5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2025-04-17 09:41:40 -07:00
Sam Rawlins
5d1f4876ee
DAS: Fix many non_constant_identifier_names violations
...
This lint rule is a core lint rule; we have suppressed it only for
pre-existing code reasons.
There are a few individual files which simply have a consistent pattern
of including underscores in some names, so I add inline ignores there.
Change-Id: I89e6010203868fc10fda12b15353de41881d9b15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416900
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2025-03-20 09:00:06 -07:00
Brian Wilkerson
e8e56ff2f5
Cleanup declarations in server with trailing digits
...
There are still lots of declarations whose name ends in a trailing
digit, but most of them are unrelated to the migration, and some
are required in order to not break internal code.
I'm happy to break this up into smaller CLs if it's hard to review.
Mostly it's just renaming some declarations, although there are one or
two places where I did a little more clean-up.
Change-Id: I50d32316e82e48c6a5a47aec630b4ffee2ead2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410922
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2025-02-23 08:17:36 -08:00