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
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
Sam Rawlins
eb03a1673d
DAS: Use Diagnostic in place of deprecated AnalysisError
...
Work towards https://github.com/dart-lang/sdk/issues/60635
Change-Id: I0107a65580bc41d769c2a384319225b256df2fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2025-05-05 09:35:18 -07:00
Sam Rawlins
4ef2725654
Add an analyzer_testing package
...
We intend to publish and maintain this as a set of testing-related
utilities for the analyzer packages and for analyzer plugins.
Work towards https://github.com/dart-lang/sdk/issues/55660
See the doc: https://docs.google.com/document/d/1jRtd8B1ijPAP6Pz89HRnyIZXw2VMjaZx0vRZTpoNO84/edit?tab=t.0#heading=h.2sz41a544qhi
Change-Id: I2764b1357a932fa955060b26d78038997eaa9536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425080
Reviewed-by: Slava Egorov <vegorov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2025-05-02 06:58:49 -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
Danny Tuppeny
216eb0bef0
[analysis_server] Migrate some tests from indexOf() to TestCode.parse()
...
See https://github.com/dart-lang/sdk/issues/60234
Change-Id: Ia5c110b40088982368512688195d70c2b51a2d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2025-04-08 09:59:44 -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
5454e70ce2
[migration] Rename utilities in protocol_dart.dart
...
Change-Id: I90c06dffcac98bc8ec6bb2a982a6825157eda56d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407620
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2025-02-03 16:32:40 -08:00
Konstantin Shcheglov
8eb24f0724
Elements. Make 'get library2' non-nullable in more places.
...
Change-Id: I0f9a27ce61367826fb1a1af3969cef0014639a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398740
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-12-04 20:13:12 +00:00
Keerti Parthasarathy
44a8f14932
[Elements.migrate] Migrate FeatureComputer
...
Change-Id: Iff5c9cffd676464454460ca2a51cdd7cd0e1d507
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397040
Commit-Queue: Keerti Parthasarathy <keertip@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-11-22 22:21:29 +00:00
Konstantin Shcheglov
359aa743ff
Elements. Add LibraryElement2.uri
...
We used it often enough, and the question "what is the URI of the library" makes sense.
Change-Id: I58baebd7b32154ae7a2f90770e4edcade8a49a63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-11-15 21:52:00 +00:00
Sam Rawlins
73443c8603
DAS: Generated protocol 'enums' can be real enums
...
File sizes are reduced:
```
analysis_server_client's protocol_common.dart - 132k -> 102k (-23%)
analysis_server_client's protocol_generated.dart - 453k -> 433k (- 4%)
analysis_server's protocol_generated.dart - 528k -> 509k (- 3%)
analyzer_plugin's protocol_common.dart - 139k -> 108k (-22%)
```
Change-Id: I8018f1d09e053c9d3df340ba31cdb07cbd29acf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-11-07 17:27:18 +00: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
3af9430ebf
Elements. Separate Element2.name from Element.name by renaming to 'name3'.
...
They were intersecting at ElementImpl and Member(s).
This will unblock updating implementations to make them nullable.
Change-Id: Ic9907eaa0ef08c096839f212668fa1e3d92bbf3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391540
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-10-23 15:53:40 +00:00
Konstantin Shcheglov
15ab56922e
Elements. Make more Element2.name nullable.
...
For example `MethodElement2.name`, for code:
```
class A {
() {}
}
```
Change-Id: Id023d6641d2d3685bf8e2d381aab055365e687d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391207
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-10-22 17:16:29 +00:00
Brian Wilkerson
83dc895d18
Migrate the remaining files in server's tools directory
...
Change-Id: I8388cde7fc9f7904324b41a3fff31cec88e42a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390804
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-18 17:03:00 +00:00
pq
fe66b2d525
[cq] move flutter extension to analyzer
...
Making this available in analyzer will allow me to de-dup a bunch of similar logic in the linter...
Change-Id: Id9991eb3b3a11fed4eff596302beffb814ba86bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-16 17:24:56 +00:00
Konstantin Shcheglov
8de1422a0e
Parts. Deprecate Element.enclosingElement, use enclosingElement3.
...
Change-Id: Iadc4ed02d4bda3b882e65dc6f4d263a6a938e0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-09-01 18:50:29 +00:00
Danny Tuppeny
916272331b
[analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods
...
This avoids accidentally using the converter when talking to plugins, (at least for now) URIs are never expected, and file paths should always be used regardless of which mode the server is in.
This unfortunately touches a _lot_ of code, so I've pushed in many separate patch sets to Gerrit.
Fixes https://github.com/Dart-Code/Dart-Code/issues/5156
Change-Id: I312c3e2cbc35a05a078aaa0138aec7288b3c7dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373745
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-07-02 14:15:11 +00:00
Brian Wilkerson
b0dabf03da
Fix a bug in the completion metrics tool
...
Change-Id: I890fbc5ca722f839b7e375ba4fbc41700c629566
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372521
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Keerti Parthasarathy <keertip@google.com >
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
2024-06-20 18:10:59 +00:00
Brian Wilkerson
45835b0933
Use the max number of suggestions to limit the number of candidate suggestions being retained
...
Change-Id: I4a60569fb4efe4af576b9adbb375c6e2e0b1727c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370720
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
2024-06-11 17:03:05 +00:00
Konstantin Shcheglov
017bed7b9a
CQ. Enable unnecessary_final in analysis_server/
...
Change-Id: Ieb62a1c774a5e8f5a22deaa8e8e5fff6f9f849dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-05-16 21:20:28 +00:00
Konstantin Shcheglov
5c07c89a35
Enable 'unnecessary_final' in analysis_server/.
...
Change-Id: I71ee934b915d4aff924cf5925f87bcc9adc6c015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-04-16 20:04:15 +00:00
Sam Rawlins
cda4f034ed
DAS: Extract static code from static class Flutter.
...
Most methods are refactored as extension methods. Some unused ones are deleted.
Some are inlined into their call sites.
Change-Id: I47826fd3241db86526efa2ee410990a0fc7be702
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-04-12 19:28:54 +00:00
Konstantin Shcheglov
5543d88289
AE. Deprecate OnClause, use MixinOnClause instead.
...
Change-Id: I938a1ff4046851c46c6ae4cebdff25e05e88300f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-04-02 23:02:22 +00:00
Konstantin Shcheglov
c5f876b7aa
Augment. Use ExtensionOnClause in ExtensionDeclaration, make it optional.
...
Change-Id: I696ffd0b8e8f3bf9017b583d480313ec7c7753f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-04-02 16:12:00 +00:00
Konstantin Shcheglov
22873be577
Completion. Benchmark for continuously asking completions.
...
Useful to focus on measuring performance of computing suggestions
only, without any overhead of resolution, protocol conversion, etc.
To be run as is, or with `--observe:xxxx` to see what to optimize.
You need to supply your own Flutter checkout.
Change-Id: Ie143b4ec9c24e05a0de2a14c1b8f0e1c20ef3a8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358222
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-03-18 22:56:10 +00:00
Konstantin Shcheglov
d918ac16b3
Completion. Cache 'inConstantContext' value.
...
For package:collection, computing measures.
Before: 0:01:00.236000
After: 0:00:55.977000
So, about 7% faster.
I think this translates into actual completion speed up.
Change-Id: I45f0c0186d5988e6e1b043d465030668cd61335b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357982
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-03-15 20:38:36 +00:00
Konstantin Shcheglov
94abcc81ab
Completion. Use CompletionSuggestionBuilder in completion metrics, faster.
...
For sdk/pkg/analyzer_cli
Before: 0:01:32.542000
After: 0:00:33.254000
So, about 3 times faster.
Change-Id: I8eae44eeefd5624f88a42fe37b8ae1c29427ee49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356310
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-03-15 19:08:23 +00:00
Konstantin Shcheglov
8705a06e21
Completion. Remove localVariableDistance(), and usage in RelevanceDataCollector.
...
Change-Id: I4ad00d1820fa996dac0abdb13649418a2fa97ed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-03-07 22:04:18 +00:00
Konstantin Shcheglov
8968e5500a
CQ. Enable avoid_redundant_argument_values in analysis_server/
...
Change-Id: If9c09f81bdbac890553573a8491ca27cb4f22dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353805
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-02-26 19:51:41 +00:00
Konstantin Shcheglov
14a1045f16
Legacy. Deprecate 'withNullability' in getDisplayString() methods.
...
Change-Id: I688f230f4189cd1fc600e4d34f07f339111c382d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350645
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-02-07 01:25:38 +00:00
Sam Rawlins
aad9e57674
Revert "Revert "[analyzer] new warning for nullable '==' parameter type""
...
This reverts commit 885457e1d3 .
[analyzer] new warning for nullable '==' parameter type
This rule checks that a parameter to an `operator ==` implementation has
a non-nullable type.
I intentionally did not enforce, in this rule, that the parameter is
exactly `Object`. It is legal to narrow the parameter type to a
different non-nullable type, like `int`. I can't imagine doing it, but
it seems to be unrelated to whether the type should be nullable or not.
Fixes https://github.com/dart-lang/linter/issues/3441
Replaces https://github.com/dart-lang/linter/pull/3923
Change-Id: Ic0be2bfebaf59b0336e9a3a58e5b7f5359eb8646
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Stephen Adams <sra@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2023-12-14 23:58:12 +00:00
Sam Rawlins
eeb3ecb599
analyzer: Convert Flutter (utilities) into a static class.
...
This was a utility class with absolutely zero state. It almost protected
against unnecessary instantiation by providing a static `instance`
member, but the constructor was still public. Also, the instance was
passed around various objects as an instance field, even allowing for
the static instance to be nullable in a few cases. All of this can be
prevented by making the class `abstract final`, with all of its members
static.
(An argument can be made that all of the code in here could be made
top-level functions, but I'll leave that for a later refactoring, if it
is desired. Also the functions could be made into extension methods, but
many of them rely on promotion of a parameter, so until we get `this`
promotion in extensions, I won't advocate for that change.)
The main reason I was looking at this was to get Flutter out of `_AbstractCorrectionProducer`, so that we don't have to drag the flutter utils into analyzer_plugin (we still can if we want to, but we won't _have_ to).
I also modernized the code, following Effective Dart:
* https://dart.dev/effective-dart/documentation#do-start-doc-comments-with-a-single-sentence-summary
* https://dart.dev/effective-dart/documentation#do-separate-the-first-sentence-of-a-doc-comment-into-its-own-paragraph
* https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs
* https://dart.dev/effective-dart/documentation#prefer-starting-a-boolean-variable-or-property-comment-with-whether-followed-by-a-noun-or-gerund-phrase
Change-Id: I0d1896ae2d45a31e00f8a824e92d173469cc7eea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2023-12-07 02:03:26 +00:00
pq
440ea59ee0
enable flutter_style_todos in server
...
Change-Id: I4921d538e1498e66c8cab2d84dfcad21d1a7b555
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335952
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2023-11-14 21:08:12 +00:00
Brian Wilkerson
4963955276
Finish converting the KeywordContributor
...
Change-Id: Ifa5100c6458f1a91f492223b261bcd53f23e847f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-09-25 22:07:56 +00:00
Danny Tuppeny
ec0dc8fe55
[analysis_server] Handle annotations + default to new protocol for completion metrics tool
...
Change-Id: I57c8f077ccc853ae7ece44c776e16e0f30401a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2023-09-13 17:47:35 +00:00
Konstantin Shcheglov
508a293029
Revert a few not published API changes.
...
Change-Id: I093c3d3f6e221cfe874e82b598f52087670ce24e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318020
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-08-04 19:21:58 +00:00
Konstantin Shcheglov
8828fee865
Deprecate ExecutableElement.returnType, use returnType2 instead.
...
Change-Id: Ibd29c3fbec0439236c2cf45c57f820c45427df9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311932
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-06-29 23:16:59 +00:00
Konstantin Shcheglov
fae9e418ea
Deprecate Element.enclosingElement, use enclosingElement2 instead.
...
Change-Id: I78edb6d433949eb8bd86f397fb873a078edf9fc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-06-29 19:45:19 +00:00
Konstantin Shcheglov
38546e90ab
Pre-fix unreachable_from_main for instance members.
...
https://github.com/dart-lang/linter/pull/4441
Change-Id: I55afa6b7d78bc1114ce97c1b5bebcf7a8bca5b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307975
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-06-09 22:39:27 +00:00
Konstantin Shcheglov
4d6f49b1cd
Update ExtensionOverride to use ImportPrefixReference and name token.
...
Change-Id: Ifc5852c775a95908992d33a7949b4f4bea396d66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-05-05 15:42:36 +00:00
Konstantin Shcheglov
ec330b47de
Deprecate 'DartType.isDynamic', use 'is DynamicType' instead.
...
Change-Id: Ia3660a0d38f01a590dd3e034f40dbdb5a432638a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300042
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-05-01 16:09:08 +00:00
Konstantin Shcheglov
4756d077ed
Update NamedType to use ImportPrefixReference and name token.
...
Using Identifier expression inside NamedType does not make sense.
Change-Id: I4a61d2b472fd66fb7c5e6e92a80cccb391b06d49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-04-28 17:31:46 +00:00
Konstantin Shcheglov
dc34fe9f86
Deprecate IfElement/IfStatement.condition, use 'expression'.
...
Change-Id: If43b4b71a21fd256ce8d1367d4b233e1cff764b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296122
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2023-04-19 17:17:28 +00:00
Sam Rawlins
7d6ab9bdfd
Allow dead code in completion_metrics script.
...
Change-Id: I16751bcbb25f09c3a897de82c06ab424abcfcf1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2023-04-04 23:15:31 +00:00
Konstantin Shcheglov
5ecf6db857
Deprecate 'DartType.isVoid', use 'is VoidType' instead.
...
Maybe? With an explicit type check we don't try to make an impression
that anything more happens here, e.g. for type parameters.
Similarly, for https://github.com/dart-lang/sdk/issues/36697 we would need to introduce `InvalidType`, which is not `DynamicType`. And so, `DartType.isDynamic` should not return `true` for `InvalidType`, it is not a property that various types may have, and should be replaced with explicit `is DynamicType`.
We also have `UnknownInferredType`, but it should never leak to clients.
Change-Id: I302b06355143d97bb52922c805dbad585a522e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-03-14 18:50:33 +00:00
pq
ad2da86f18
linter 1.33.0 rc
...
Some notes.
* There are a number of tests that should get decoupled from the linter being pulled into `DEPS`. Instead of depending on the state of lints there, we should update the tests instead to use a more hermetic environment. (See for example `options_rule_validator_test.dart` for how that might look.)
Downstream (blocking) fixes:
* https://github.com/flutter/flutter/pull/119736
* https://github.com/flutter/gallery/pull/878
Change-Id: I5671b0abde3eeda75513abaaf9fef3bcd5115f9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280054
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2023-02-07 20:56:35 +00:00
Jens Johansen
e4f0882709
[analyzer] Speedup some completion queries
...
When getting completions, some of the "contributers" basically do a
walk of the AST and almost add everything they see, and the list
is then later pruned based on the user query.
This CL introduces a "first pruning" (a copy of the first part of what
is done in the subsequent pruning) so only the things has could match
the user query is added.
Benchmarks for this:
Notes:
- All of these numbers are with the timeout increased a lot (to a
point where there effectivley isn't any timeout).
- I have an external project too, but only in Android Studio as it's
a Flutter project and my VSCode then uses the dart included in
flutter. I don't know how to make it not do that.
Summary:
Android Studio, bin/server.dart --- `print(CallHierarchyK^);`
Difference at 95.0% confidence
-46.45 +/- 10.0349
-45.7861% +/- 9.8915%
(Student's t, pooled s = 15.6785)
Android Studio, bin/server.dart --- `starter.^;`
No difference proven at 95.0% confidence
Android Studio, Other project --- `print(Cryptm^);`
Difference at 95.0% confidence
-90.3 +/- 10.9506
-58.0894% +/- 7.04448%
(Student's t, pooled s = 17.1092)
VSCode, bin/server.dart --- `print(CallHierarchyK^);`
Difference at 95.0% confidence
-61.45 +/- 5.41501
-51.4226% +/- 4.53139%
(Student's t, pooled s = 8.46036)
VSCode, bin/server.dart --- `starter.^;`
Difference at 95.0% confidence
6.4 +/- 5.08317
15.4217% +/- 12.2486%
(Student's t, pooled s = 7.94189)
So for several queries it's ~50% faster. For a single one it slightly slower.
Raw numbers:
BEFORE:
Android Studio, bin/server.dart --- `print(CallHierarchyK^);`
90 ms
88 ms
89 ms
85 ms
139 ms
92 ms
86 ms
101 ms
87 ms
84 ms
112 ms
110 ms
128 ms
99 ms
99 ms
104 ms
98 ms
88 ms
106 ms
144 ms
Android Studio, bin/server.dart --- `starter.^;`
38 ms
38 ms
34 ms
30 ms
35 ms
34 ms
29 ms
31 ms
35 ms
60 ms
53 ms
37 ms
54 ms
31 ms
51 ms
33 ms
39 ms
68 ms
75 ms
91 ms
Android Studio, Other project --- `print(Cryptm^);`
150 ms
146 ms
142 ms
138 ms
150 ms
213 ms
147 ms
143 ms
149 ms
147 ms
153 ms
147 ms
136 ms
151 ms
151 ms
186 ms
160 ms
153 ms
150 ms
197 ms
VSCode, bin/server.dart --- `print(CallHierarchyK^);`
122 ms
113 ms
115 ms
118 ms
124 ms
116 ms
116 ms
114 ms
118 ms
125 ms
130 ms
117 ms
104 ms
119 ms
121 ms
120 ms
127 ms
123 ms
117 ms
131 ms
VSCode, bin/server.dart --- `starter.^;`
38 ms
45 ms
35 ms
37 ms
37 ms
59 ms
39 ms
38 ms
37 ms
44 ms
41 ms
41 ms
43 ms
41 ms
39 ms
40 ms
42 ms
43 ms
49 ms
42 ms
WITH CL:
Android Studio, bin/server.dart --- `print(CallHierarchyK^);`
65 ms
59 ms
41 ms
41 ms
70 ms
38 ms
56 ms
66 ms
64 ms
44 ms
47 ms
56 ms
46 ms
38 ms
46 ms
64 ms
57 ms
44 ms
69 ms
89 ms
Android Studio, bin/server.dart --- `starter.^;`
36 ms
36 ms
38 ms
35 ms
37 ms
43 ms
32 ms
30 ms
34 ms
39 ms
32 ms
40 ms
35 ms
34 ms
35 ms
39 ms
46 ms
54 ms
56 ms
78 ms
Android Studio, Other project --- `print(Cryptm^);`
59 ms
63 ms
61 ms
80 ms
98 ms
56 ms
60 ms
61 ms
57 ms
61 ms
57 ms
61 ms
59 ms
59 ms
57 ms
64 ms
60 ms
65 ms
58 ms
107 ms
VSCode, bin/server.dart --- `print(CallHierarchyK^);`
55 ms
54 ms
50 ms
47 ms
59 ms
55 ms
53 ms
53 ms
67 ms
67 ms
54 ms
54 ms
50 ms
62 ms
54 ms
54 ms
56 ms
59 ms
63 ms
95 ms
VSCode, bin/server.dart --- `starter.^;`
57 ms
41 ms
57 ms
40 ms
45 ms
47 ms
40 ms
44 ms
43 ms
43 ms
41 ms
40 ms
42 ms
49 ms
40 ms
46 ms
57 ms
49 ms
81 ms
56 ms
https://github.com/flutter/flutter-intellij/issues/6470
Change-Id: I1e34ce04774cafcb47f4e8590b990400a7b0f0ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279389
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2023-01-27 08:27:48 +00:00