Konstantin Shcheglov
3d69c3c0c4
Restore sync file methods in AnalysisSession.
...
There are clients, like `built_value` that cannot be updated.
Change-Id: I27371018039f22cd7ca2cb82b30ec33469aa6e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-21 23:27:57 +00:00
Danny Tuppeny
094c598703
[analysis_server] Change empty linked edit groups to have placeholder text
...
Change-Id: Id687c4db11a1b43507f61e6d8ff5775ccccc819f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-15 20:03:33 +00:00
Konstantin Shcheglov
41b3e0abcc
Make 'content' required in ResourceProviderMixin.newFile()
...
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-14 17:31:48 +00:00
Danny Tuppeny
b9a7f00a9a
[analysis_server] Add server snippets for classes, and test/groups in test files
...
Change-Id: I72758dba2967c678d96adbc9f7bbd4bd307caf67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-14 16:43:38 +00:00
Konstantin Shcheglov
2184481d93
Replace addProjectFile() with newFile() and explicit waitForSetWithUri().
...
Change-Id: Ie9d9afa66ace10fdb1d8cc5501cb9e777c60fe5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-10 20:08:35 +00:00
Konstantin Shcheglov
1531030b42
Stop using newDotPackagesFile() in analysis_server/.
...
Change-Id: Iaa4e8657ee1d5f115ab62177570aa662494b9d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-09 23:56:15 +00:00
Danny Tuppeny
dd34c92da0
[analysis_server] Add snippets for for/for-in/while/do-while loops
...
Change-Id: Ie9f7a73ddf3e9661b91212cdafb95f34a9994cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Danny Tuppeny <danny@tuppeny.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-09 21:44:05 +00:00
Konstantin Shcheglov
5ffba0a660
Remove unnecessary code for enum constants from AstBuilder, completion.
...
With https://github.com/dart-lang/sdk/issues/48380 fixed, we can simplify.
Change-Id: Ic453fe9e86af2f6cb437ff016a9b3786959b05d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236302
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-09 21:07:44 +00:00
Danny Tuppeny
13a6faf36c
[analysis_server] Add snippets for if, if-else, switch, try-catch
...
Change-Id: I4146cf465817f46ffbec6e32630fd8425dcd0fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-09 21:00:46 +00:00
Konstantin Shcheglov
1693908268
Apply file changes between (not during) other operations.
...
This would be a breaking change, so for now it is disabled, but
the method `applyPendingFileChanges()` can be added, and the clients
will call it to be ready for the switching the flag.
Only clients that call methods like `changeFile` have to await applying
the file changes. Other clients can continue using synchronous
`currentSession`.
Change-Id: I0f8d4cc874f485776f611790f6c80fd7e07c8051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-09 18:16:45 +00:00
Danny Tuppeny
9c0689a887
[analysis_server] Add code snippet for main functions
...
Change-Id: Ie74f92ab321d426897163f7f33b94828c9e0f99a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-08 20:18:04 +00:00
Konstantin Shcheglov
0b7b70b758
Deprecate synchronous methods in AnalysisSession.
...
Change-Id: I9bd3bf2d3d6dbc74ffefde1c06f83e9200b0f552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2022-03-07 18:17:41 +00:00
Konstantin Shcheglov
641255b292
Don't suggest from internal 'dart:' libraries.
...
Change-Id: Idb84a248b14b50fb38ad02e420ad48dea70a6f64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-04 20:17:40 +00:00
Konstantin Shcheglov
30f285efa6
Fix an enum rename test after merge.
...
TBR
Change-Id: Ifb379c1beaab977239070c2bb87f3bedf276c770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235061
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-03 00:46:49 +00:00
Konstantin Shcheglov
7516925fef
Tests for extract and inline methods for enums.
...
Change-Id: I02da04feb4143c7793f17fe627b4c831c8ce98ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234909
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-02 23:28:29 +00:00
Konstantin Shcheglov
79a58d6a7f
Tests for renaming class members in enums.
...
Change-Id: Ie63dbe3606f9601e3052e9d4af85d2a52066b89b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234906
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-02 21:50:09 +00:00
Konstantin Shcheglov
3cf37db274
Use ClassElement.allSupertypes instead of getSuperClasses()
...
Change-Id: I43b8801ba90caa63545571dddfefc4d0cdcfb06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234865
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-02 16:46:09 +00:00
Danny Tuppeny
f5bd632abe
[analysis_server] Ensure imports are always added before other code being inserted in DartFileEditBuilder
...
Change-Id: I390f24ac10f7f061e79c9bfed616e9bcc908d240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234604
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-02 16:37:26 +00:00
Danny Tuppeny
5ae1838569
[analysis_server] Don't insert trailing commas when editing named argument labels
...
Change-Id: I691b19eebd8d01796b5763c066573de52192a8a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-03-01 16:53:38 +00:00
Konstantin Shcheglov
06a34d98d1
Sort members in enums.
...
Change-Id: Ied55e119e24e51042c65ec5bc222bbafbbec6c46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-03-01 01:33:08 +00:00
Danny Tuppeny
0359628ca4
[analysis_server] Handle extensions in convert_getter_to_method
...
Fixes https://github.com/Dart-Code/Dart-Code/issues/3846 .
Change-Id: Ie30eacf38fa7dfe3afb4dc8c25787e86c4e69dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-02-28 15:49:08 +00:00
Konstantin Shcheglov
309941c101
Implement analysis.implemented for enums.
...
Change-Id: I166703b652eb341f18d4b9442acdfc341cd20170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234446
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-25 23:34:32 +00:00
Jens Johansen
514f678199
[parser] Better recovery for extra stuff in enum and using enum as identifier
...
Fixes https://github.com/dart-lang/sdk/issues/48371
Change-Id: I93331485c884c89c179c2fa332f3f975db9507f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234043
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-02-25 09:35:25 +00:00
Danny Tuppeny
62c138bbc4
[analysis_server] Add Flutter snippet for Widget with AnimationController
...
Change-Id: Icea1af510e65bdfbc395089184452ddb91d7446e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-02-23 17:23:42 +00:00
Danny Tuppeny
729b2e5d34
Basic support for folders in MOVE_FILE refactor
...
Change-Id: If960592199526df3dcd7f35c8a2396060b27e46e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-02-23 17:22:42 +00:00
Danny Tuppeny
37ae0d5648
[analysis_server] Add snippet for Flutter StatefulWidget
...
Change-Id: I64e5b34217d7f89b20122573299c2fab2ae3f0b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-02-20 00:24:12 +00:00
Konstantin Shcheglov
f0ae696ee2
Tests for search with named arguments anywhere.
...
Change-Id: I423a92f49981514074a26e1b893dfff06b0e3389
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-19 02:04:28 +00:00
Danny Tuppeny
bf491f87cd
[analysis_server] Add support for snippets in LSP completion
...
Change-Id: Ife64add884c310e4d0b5413ef91665aef2375648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-02-18 19:43:21 +00:00
Konstantin Shcheglov
beddd6f2cd
Rename refactoring for enum constructors.
...
Change-Id: I35fd6ba07b911862c76d58aa7a58d226d2ff050f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-17 02:21:23 +00:00
Konstantin Shcheglov
1a1d3714f5
Remove supportsAvailableSuggestions from AbstractCompletionDriverTest.
...
We always use it for the protocol version 1.
Change-Id: I18558bb76e82bc5c8be7ccb2fca886dc0139b7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-17 02:13:21 +00:00
Konstantin Shcheglov
fe5a580f8e
Pass the context as a single object in class body completion tests.
...
Change-Id: Iec7bc93a150a1dfe4d96ef6c1c87d334db28146a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-17 02:12:40 +00:00
Konstantin Shcheglov
ea4f04f56d
Support completion in enum constant argument list.
...
Change-Id: Id483d6ea3715e567f1d2cc9a2051f615b750a8a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-11 23:07:25 +00:00
Konstantin Shcheglov
582bf2f230
Completion for constructors in enum constants.
...
Change-Id: I3a68db8045d249f7459ec0dbf0fbd9c203fccade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-11 21:41:37 +00:00
Konstantin Shcheglov
8b67b90016
A few tests for completion in class body and similar.
...
Change-Id: Id8749e4c45d26a5e56de31ce0d8b117db60150a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232486
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-11 18:04:57 +00:00
Konstantin Shcheglov
d5269652d8
Remove 'index' from enum classes.
...
Change-Id: I7632aced8cde06c449e694c028d0e7fb2d3312df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232426
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-11 17:35:17 +00:00
Konstantin Shcheglov
4a122c0b5a
Add completion tests inside enum declaration.
...
As we discussed some time ago, it is not clear to me where some
tests should go. Here, I put it into "location" tests, and checked
locations that seem strongly associated with the enum - its header,
its body; including the `WithClause` on the enum.
It is less clear where tests for completion inside the header or
the body of a method inside of an enum should go. I initially
planned to put them into `declaration/enum_test.dart`, but now
starting to doubt. The tests there are currently for using an
enum from outside.
Change-Id: Ife091f82bbb0ad1f26df984be42aa93a78595816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-10 20:26:01 +00:00
Konstantin Shcheglov
96f5385295
Tests for searching enum children in analysis_server.
...
Change-Id: I52b43a606cdac5165aa5ddd6c97741f276c1ebf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-09 19:12:56 +00:00
Konstantin Shcheglov
5198169e1a
Suggest the exception and stack trace as local variables.
...
Change-Id: Icffb93295db3be2e0b83c1ff2dd5dc01f1ce901d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-07 19:49:45 +00:00
Konstantin Shcheglov
52290eba28
Add CompletionSuggestion.libraryUri, keep isNotImported.
...
Change-Id: I1bce246c2d8eaa968a47ae6ba82114592b991a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-04 22:49:10 +00:00
Konstantin Shcheglov
f69d1f887f
Use CompletionSuggestionBuilder, and HasCompletionData to store location independent data.
...
Change-Id: I767bfc1c31b5aebc8f4e27267520f705701e7724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-04 17:33:19 +00:00
Konstantin Shcheglov
ddff5ac88c
Tests for completion in NamedExpression.
...
Change-Id: I5a7ba57a1279797f7e625890a64c42091708f60e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-02-03 22:24:16 +00:00
Konstantin Shcheglov
1b16157413
Switch AbstractCompletionDriverTest to PubPackageAnalysisServerTest.
...
Change-Id: I39e14c746b1b50af12508e6b30785cdd97920c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-31 18:25:54 +00:00
Konstantin Shcheglov
972455663d
Run tests for completion in FieldFormalParameter with both protocols.
...
Change-Id: I0e26e602c5b5fa9e85878cea4a62323e38d6ba91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-31 17:31:54 +00:00
Konstantin Shcheglov
31885cd7e9
Run SuperFormalParameter completion tests with both protocols.
...
Change-Id: I0cc230731b5ca9bbf6a2b32a921f64d6b717e25f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230881
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-29 02:25:53 +00:00
Konstantin Shcheglov
b298b5d4c0
More locations for enum completion tests.
...
Change-Id: I68c302a56279b19c178556454d6f672650b26cab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-28 20:17:32 +00:00
Konstantin Shcheglov
afd8df4d54
Fix for suggesting enum constructors, tests for both protocols.
...
Change-Id: I71721cf0e2c3c772b1662f2abe065837c5405ad2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229950
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-26 00:44:59 +00:00
Konstantin Shcheglov
f58733ef6d
Run CompletionDriver based tests with both protocols.
...
Change-Id: I29132ef8ec7fe9f373b57961338012b6163e6707
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-21 16:36:30 +00:00
Konstantin Shcheglov
47eff41cdb
Issue 48184. Fix suggesting local function returning void in named argument.
...
Bug: https://github.com/dart-lang/sdk/issues/48184
Change-Id: I5f6c8f2443782dec3c75c44cb7baeea8ed8b5e0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229282
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-20 23:45:57 +00:00
Danny Tuppeny
92da2376bc
[analysis_server] Handle override completion before getters
...
Fixes https://github.com/Dart-Code/Dart-Code/issues/3784 .
Change-Id: I422f7758f0ae713a37c4b15672828ada67ce9d65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2022-01-18 16:16:16 +00:00
Danny Tuppeny
650b9627b7
[analysis_server] Rebuild analysis contexts if changes occur between creation and watchers being ready
...
See https://github.com/Dart-Code/Dart-Code/issues/3438 .
Change-Id: I3ca038d8c878b118a465b6f230c62912d63990eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222763
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2022-01-15 00:18:41 +00:00