Commit Graph

61 Commits

Author SHA1 Message Date
Sam Rawlins 6103487f9e Remove unused imports with shared prefixes
Bug: https://github.com/dart-lang/sdk/issues/38784
Change-Id: I2c5477bbb36b17ad9ac4cf5e9584dd66f66afe1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-21 19:37:34 +00:00
Konstantin Shcheglov 2ec47ad273 Use ElementKind.ENUM for enums.
There was a crash internally, caused by the fact that when we have
duplicate name for class and enum, during linking we put them into
different Reference bucket - @class and @enum, and also inside
the class, the reference to its name is the class.

But when we resolve, we check equality of elements using not
references, but locations. So, we need to make sure that their
kinds are also different, so go into different bucket, and so
not equal.

When they are InterfaceType and equal, we would try to match
type arguments against the wrong number of type parameters and crash.

Change-Id: Iee3f8691adac65d4b0395ceec7fc7250f96afa88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-25 00:20:31 +00:00
Parker Lougheed 47ee7cc316 Remove outdated TODOs related to undesired Element APIs
Change-Id: I7c9bc45ee0e3efd5897da20e8d9555f5c2a1e91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148984
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-26 19:02:25 +00:00
Brian Wilkerson dc37860209 Change the element kind used for relevance computations
We used to be somewhat inconsistent about the choice of element kind for
top-level variables, getters and setters and fields, getters and setters
in classes, mixins and extensions. We no longer use GETTER and SETTER as
kinds, using FIELD and TOP_LEVEL_VARIABLE everywhere. This makes some
cases better and some worse, but improves the overall score across all
the completions in our metrics.

Change-Id: Idd0b10b3afe6023ecf39930b6a09abf28b3232bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148883
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-24 19:21:18 +00:00
Brian Wilkerson cea45271b3 Convert about half of LocalReferenceContributor to use the SuggestionBuilder
I'm planning on converting the rest of the class in the next CL, but
thought that a combined CL would be too large.

Change-Id: Ic18ead8285019791053f696daee0b5182c4740de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145600
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-04-30 16:58:57 +00:00
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson f60536c194 Enable slash_for_doc_comments in analysis_server
Change-Id: Id2734d4c9ce591c5746bb9aa55810c78183db38f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-14 17:17:17 +00:00
Konstantin Shcheglov 850ca2d410 Add Element.getDisplayString(withNullability), use it in analyzer.
R=brianwilkerson@google.com

Change-Id: Ic4924e19612f2a7713f9a3f2059a880ebff9d2db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-01 19:01:14 +00:00
Brian Wilkerson 4043a6fce3 Remove unnecessary uses of new in analysis_server
Other than analysis_options.yaml, all of the changes were from running
dartfix.

Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 19:01:51 +00:00
Konstantin Shcheglov fb362b54a7 Stop using FunctionTypeAliasElement.parameters/returnType in analyzer.
The goal is to stop implementing FunctionTypedElement in
FunctionTypeAliasElement, and keep only TypeParameterizedElement.

For some time we will have to keep implementing TypeDefiningElement, it
is used currently as a marker for top-level declarations.

Change-Id: I0062aaa66861a4d7dd5337eb9a44338ad49f5901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123545
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-30 21:36:33 +00:00
Konstantin Shcheglov 9776e3699f Tests and fixes for searching extensions and extension members.
R=brianwilkerson@google.com

Change-Id: I6fda5fd473f9a215d29024eb315af702a11bce42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112931
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-14 01:36:46 +00:00
Brian Wilkerson af0fa108da Add support for required named parameters
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 19:25:01 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Konstantin Shcheglov da191665aa Issue 34709. Support generic type alias (AKA generic function type alias for now) in outline and completion.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34709
Change-Id: Ic18d98e07ba0cbd231ded27c4c32533ee013632b
Reviewed-on: https://dart-review.googlesource.com/c/84320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-13 21:20:08 +00:00
Konstantin Shcheglov 1bceca91b0 Remove the 'name' constructor parameter from CompilationUnitElementImpl()
It costed us about 1.2% of total analysis time.
The whole information about a unit is available in its Source.

R=brianwilkerson@google.com

Change-Id: Iffa253d1eae1a466c10766f66c6c677e19be124a
Reviewed-on: https://dart-review.googlesource.com/77220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 21:53:24 +00:00
Konstantin Shcheglov 7cf078c05d Index and search for mixins.
R=brianwilkerson@google.com

Change-Id: I5399507dc5a9688ee5944f6554167a6b1e8692b6
Reviewed-on: https://dart-review.googlesource.com/72525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-31 21:38:26 +00:00
Brian Wilkerson 1d159e7c23 Rename annotation testing methods in Element
Change-Id: I0f60b9abd3de350e62d89eac0d690a1db40316b7
Reviewed-on: https://dart-review.googlesource.com/45080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-05 17:23:48 +00:00
Brian Wilkerson 5fd560f96b Add getters to replace ParameterKind
Change-Id: I0886c8d032e963857b8054e894ed3343a235b5c2
Reviewed-on: https://dart-review.googlesource.com/44921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-05 14:22:52 +00:00
pq 3dd7eae4c8 Add @required prefix to required params.
See: https://github.com/flutter/flutter/issues/10219
Change-Id: If8bd55b5a3557f8c49430079b790727f7ba25217
Reviewed-on: https://dart-review.googlesource.com/41924
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-16 00:13:30 +00:00
pq 1399a5f511 Sort required named params in protocol element parameter list.
See: https://github.com/flutter/flutter/issues/10219

I'm VERY open to other approaches. If you deem this too quick and dirty, consider it a conversation starter! :)

I was also a bit unsure of where best to test this so by all means let me know if it should go elsewhere.

Change-Id: Ic4a271d9db7597ae7ee72f5b60728968202f954e
Reviewed-on: https://dart-review.googlesource.com/38346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-05 17:38:25 +00:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson e55812a3f2 Unify the server and plugin versions of the generators
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Steve Messick 4a2cca3a52 Add getStatementCompletion to the API spec
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2784673003 .
2017-03-30 10:13:21 -07:00
Devon Carew a231501692 Format generated files.
BUG=
R=brianwilkerson@google.com, jacobr@google.com

Review-Url: https://codereview.chromium.org/2765953002 .
2017-03-21 15:54:16 -07:00
Jacob Richman a993294503 Format all analyzer packages
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2753923003 .
2017-03-16 16:11:43 -07:00
pq b17f4b2b5d CompletionSuggestion API for arg list text ranges.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2726923003 .
2017-03-01 16:10:46 -08:00
pq 8e6817f1da New Completion defaultArgumentListString protocol.
BUG=
R=brianwilkerson@google.com

See: https://github.com/flutter/flutter-intellij/issues/553.
Review-Url: https://codereview.chromium.org/2719083003 .
2017-02-27 11:36:30 -08:00
Devon Carew 25dfd0fa80 Deprecate execution.setSubscriptions.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2713513007 .
2017-02-24 11:01:00 -08:00
Devon Carew 9dd2a6d452 Revert "Tweaks to the analyzer_cli."
This reverts commit a7ac08d0e7.

BUG=

Review-Url: https://codereview.chromium.org/2709163005 .
2017-02-23 09:39:25 -08:00
Devon Carew a7ac08d0e7 Tweaks to the analyzer_cli.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2709013005 .
2017-02-23 09:02:49 -08:00
Devon Carew 7f83d9d173 Add a diagnostic.getServerPort analysis server request.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2703033002 .
2017-02-19 15:19:40 -08:00
Brian Wilkerson fb5e367ca5 Update server generator
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2668733002 .
2017-01-31 08:26:10 -08:00
Brian Wilkerson e1a27c0c60 Rework the replay test to be more correct
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2611593002 .
2017-01-03 07:45:07 -08:00
Brian Wilkerson 15663c6148 Generate more type information to make strong mode happy
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2470863002 .
2016-11-01 11:20:44 -07:00
Brian Wilkerson 685e4ff9e1 Revert "Remove unused option in server API"
Review URL: https://codereview.chromium.org/2382033003 .
2016-09-30 10:14:12 -07:00
Brian Wilkerson 2972bd0d6b Remove unused option in server API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2382053002 .
2016-09-30 09:04:38 -07:00
Brian Wilkerson 74686371b3 Add support for getting the sessionId from instrumentation and sending it to the client
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2359233002 .
2016-09-22 10:26:13 -07:00
Konstantin Shcheglov 7343da76ba Issue 27078. Describe RefactoringProblemSeverity values.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27078

Review URL: https://codereview.chromium.org/2312073003 .
2016-09-06 17:46:24 -07:00
Konstantin Shcheglov f4186fb463 Issue 27244. Add 'isDeprecated' to HoverInformation.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27244

Review URL: https://codereview.chromium.org/2310153002 .
2016-09-06 11:31:11 -07:00
pq 270695fc31 Adds PID to server.connected notification (#26744).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2088663004 .

Fixes: https://github.com/dart-lang/sdk/issues/26744.
2016-06-21 16:00:27 -07:00
Brian Wilkerson 7a9b2a3133 Use null aware operators to clean up code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1941793002 .
2016-05-02 08:38:46 -07:00
Brian Wilkerson f9b575e5b3 More strong mode changes to analysis_server
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1855643002 .
2016-04-01 18:00:04 -07:00
Brian Wilkerson cbcb689184 Fix the way generated code is made strong mode clean
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1849973002 .
2016-03-31 13:43:07 -07:00
Brian Wilkerson 301a6a4725 Fix generated server code to be strong mode compliant
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1852473002 .
2016-03-31 10:44:42 -07:00
pq e7e205f00b Add error codes to server protocol (#25958).
See: https://github.com/dart-lang/sdk/issues/25958

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1774913006 .
2016-03-09 10:44:03 -08:00
Dan Rubel 9fe92127e5 update setAnalysisRoots to accept package spec file
As part of addressing https://github.com/dartino/atom-dartino/issues/13,
this CL updates the setAnalysisRoots API to allow package spec files
in the packageRoots map.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1711353003 .
2016-02-19 10:57:16 -05:00
Konstantin Shcheglov 7c5e03435b Deprecate UNIT_TEST_GROUP and UNIT_TEST_TEST.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1570003002 .
2016-01-07 20:03:39 -08:00
Brian Wilkerson 56fe38f0ab Clean up imports in analysis_server and analyzer_cli (and one missed in analyzer)
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1527793003 .
2015-12-14 19:31:46 -08:00
Konstantin Shcheglov e48f962af1 Validate that root paths are absolute and normalized.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25203

Review URL: https://codereview.chromium.org/1511833004 .
2015-12-09 15:05:22 -08:00
Konstantin Shcheglov 1f5973e24e Explicitly specify that FilePath is not just absolute, but also a normalized path.
It was implied, and every client I know of uses absolute and normalized paths.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1506323002 .
2015-12-09 11:30:54 -08:00