Commit Graph

58 Commits

Author SHA1 Message Date
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 34893faa60 Use DartType.getDisplayString() instead of toString().
Change-Id: I982a4fff312593e6788afcbc9200a83793fefb97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-05 07:41:22 +00:00
Brian Wilkerson d1ca36aa83 Enable empty_catches in analysis_server
Change-Id: Ic21556e8118a5b5d3b4a06ed6d3a7002f606f2ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:38:02 +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 b92cd2cb95 Deprecate DartType.displayName, use getDisplayString() instead.
We call it with `withNullability: false` almost everywhere.
My attempt to update all places turned out to be a long chain of
changes. So, instead I will make decisions and updates in separate
CLs, starting with ErrorReporter.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I9d72475577ba2934bed1c06a4808ab620e92a20e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127441
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 22:43:59 +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
Brian Wilkerson 11bdc5ceab Send context messages from server and plugins
Change-Id: I76b5c5697ee660980f3be7d8b3d4b99c2ffa2422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108967
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
2019-07-15 15:27:43 +00:00
pq 52abcd3dd2 apply prefer_equal_for_default_values
Change-Id: I9b6fd3ee18ec834a5db3d0d25455b6db9ea4fbe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108664
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-07-10 19:31:40 +00:00
Brian Wilkerson 30390c6ba1 Prepare to compute the documentation URL for diagnostics
Change-Id: Ib1b7e4887e18b90c1552f3f8501948ee8d8d2c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 16:41:46 +00:00
Brian Wilkerson acb62b97fe Add a default URL for lints
Change-Id: I4dc735cb4982329c6b275f64f2969865e9235c26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97844
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-01 16:54:53 +00:00
Brian Wilkerson 11a148c85e Add the ability to associate a URL with a diagnostic
Change-Id: I06f694311130a36b1db4b4baf2e7d46d999f07b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97554
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-22 13:32:05 +00:00
Brian Wilkerson f0f3f445a7 Add a version of getAncestor that matches by type without a closure
Change-Id: Ib10ab78284466b04b47b6480aded9d3535c79b12
Reviewed-on: https://dart-review.googlesource.com/c/83642
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 20:43:57 +00:00
Danny Tuppeny 04777b58cc Add analysis (publishDiagnostics) and handling of opening/editing/closing files
Change-Id: I6dadf125b1a71c4f321f4ab9a01ff2bbfcbd1d4a
Reviewed-on: https://dart-review.googlesource.com/c/82500
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 08:52:48 +00:00
Brian Wilkerson 87f753dbd3 Replace some declarations of element with declaredElement
Change-Id: Idd62472b16cccaa98749a510197ec8d0f5053cb1
Reviewed-on: https://dart-review.googlesource.com/67820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-02 16:00:36 +00:00
Brian Wilkerson c214c43758 Make LineInfo a public class
Change-Id: I1bc7f5302797374609752ea5293b96c30719b41f
Reviewed-on: https://dart-review.googlesource.com/51101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-13 16:23:47 +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
Konstantin Shcheglov 4d9968b95d Use CompilationUnitElement.lineInfo instead of AnalysisContext.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2692383003 .
2017-02-15 10:06:28 -08:00
Konstantin Shcheglov 0728e4ee70 Implement 'analysis.getErrors' for the new driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566013002 .
2016-12-11 15:27:57 -08:00
Konstantin Shcheglov 73fccff8ea Make SearchMatch an interface, exclude 'context', move implementation.
Also, mostly drop 'fileStamp' in SourceFileEdit.
Only `-1` is kept when the file is a new one, in other cases it' `0`.
As I can see, IDEA cares only about `-1`.
We don't know modification stamps with the new analysis driver.
But we know content hashes.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2518903002 .
2016-11-21 10:05:21 -08:00
Brian Wilkerson 313d236918 Fix offset for URI navigation (issue 27717)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2465393003 .
2016-11-01 12:28:07 -07:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Brian Wilkerson 6c448b6938 Move exception support to its own library
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2328043002 .
2016-09-10 11:04:19 -07:00
Konstantin Shcheglov 43fef756ae Provide LINE_INFO from ResynthesizerResultProvider.
Also, to guarantee that LINE_INFO is computed, we need to replace
context.getLineInfo() with context.computeLineInfo() in the server.
This should be equivalently fast in both summary (from provider) and
non-summary cases (the source should have been scanned and parsed in
order to resolve references to its elements).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2225893003 .
2016-08-09 09:12:24 -07:00
John Messerly 1b9bf0769d fix #26122, classify strong mode errors correctly
StaticTypeWarningCode was being handled, but many warnings with StaticWarningCode also need to be treated as errors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2108823002 .
2016-06-28 14:35:44 -07:00
Brian Wilkerson f819f9fb07 Add hooks for changing priorities of warnings to errors in strong mode
R=leafp@google.com

Review URL: https://codereview.chromium.org/1861363002 .
2016-04-06 13:06:29 -07:00
Brian Wilkerson 7d72c6e1f5 Deprecate the generated AST library and clean up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1788223002 .
2016-03-12 08:50:48 -08: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
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
pq 62656833d4 Wraps up the server-side of the 'Allow a user to configure which hints are "fatal"' ask (#24452).
* migrates error filtering from a predicate to a process that can customize severities.
* moves filtering/processing from the `dart` task into the `getErrors` request and the errors notification.

See: https://github.com/dart-lang/sdk/issues/24452

(Pending a thumbs-up, support for CLI to follow.)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1517723002 .
2015-12-10 13:35:11 -08:00
danrubel 55a8740ba1 extract named constructor suggestions from prefixed element contributor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1507633002 .
2015-12-07 11:58:39 -05:00
Konstantin Shcheglov 78da03cd97 Extract protocol_dart.dart APIs.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1398333002 .
2015-10-12 06:58:34 -07:00
Brian Wilkerson 9ad256cf18 Move the wire protocol support into the public API
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1398293002 .
2015-10-11 07:34:28 -07:00
pq 8697392367 AnalysisError hasFix attr (Implements #23874).
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1385523002 .
2015-10-05 09:46:17 -07:00
Konstantin Shcheglov 6bab7d9cbc Use Element.nameLength where possible.
...or don't use it when there is a better alternative.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1372673003 .
2015-09-25 15:03:46 -07:00
Konstantin Shcheglov b15a031276 Navigation extension point.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1303033010 .
2015-09-01 13:06:25 -07:00
Brian Wilkerson 4bd6b4b048 Fix display of parameter lists in servers Element structure (issue 24194)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1313113002 .
2015-08-25 09:23:26 -07:00
danrubel bf05b75f43 update suggestion element return type to have type param
cleanup loadLibrary suggestion to have correct element

dartbug.com/23905

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1260593005 .
2015-08-04 22:08:55 -07:00
Dan Rubel 4224b9c049 fix ENUM_CONSTANT suggestions
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1157283004
2015-06-04 18:01:06 -04:00
danrubel 0e39092fd0 add enum suggestions
and update LocalDeclarationVisitor to visit enum declarations

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1157113004
2015-06-01 12:10:46 -04:00
Paul Berry 535394c265 Remove debugging print statements.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1149063005
2015-05-27 20:24:06 -07:00
scheglov@google.com f058a6ad33 Tweaks for using task model in Editor.
It works in general, bug currently it is buggy and slow.

Notes:

1. Implicit dependencies backfire.
   If the cache size is not big enough and we end up flushing some CU, then recreating it, it looses its LibraryElement.
   We need an explicit dependency on it.

2. If the cache size is not big enough, this still may cause an infinite analysis cycle.

3. We need to implement activating / deactivating cache partitions to change cache size.

4. Probably we need to set LineInfo into ChangeNotice always.

5. There are bugs in type hierarchy.

6. Semantic highlighting takes too long to display.

7. Overlay changes are not used.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45811 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 15:04:50 +00:00
scheglov@google.com ed26cdbf05 Remove old debug output.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45025 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 18:40:00 +00:00
scheglov@google.com 2e77fcdd11 Add an optional 'typeParameters' to Element.
Also use it in Editor, e.g. in Outline.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44349 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 22:02:44 +00:00
brianwilkerson@google.com cd58e290c4 Reformat
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44151 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 22:43:12 +00:00
danrubel@google.com 01a1ea75b8 fix function type alias conversion to protocol element
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42850 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 01:58:15 +00:00
danrubel@google.com 14a97cafed suggest fields rather than synthetic getters
and return dynamic returnType rather than null

BUG=dartbug.com/21679
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42786 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 19:02:47 +00:00
scheglov@google.com 8c99b69287 Log more information to debug 'null' location for constructor.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21842

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42463 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-18 18:52:34 +00:00
scheglov@google.com e73e5faaad Getters should not have parameters.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42183 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 21:04:44 +00:00