Commit Graph

64 Commits

Author SHA1 Message Date
Jaime Wren 351d70674d Initial new union of Dart Analysis Fixes, the initial fix is to remove all unused imports in a file.
Change-Id: I259e796b2603234955a1950b2c886e6f08a697bc
Reviewed-on: https://dart-review.googlesource.com/56220
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-24 15:23:40 +00:00
Konstantin Shcheglov 53a51d17db Support for optional ImportPrefixGenerator to generate prefixes for new imports.
Only one import is generated for each library.
If there is already an import for a library, new prefix is not asked.
If a prefix was generated once, it is not possible to force another
import with a different prefix.

R=brianwilkerson@google.com

Change-Id: I1676a1953002060b5e7155ce90abf87b3bfe270e
Reviewed-on: https://dart-review.googlesource.com/55326
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 20:15:03 +00:00
Konstantin Shcheglov d9d7cb12a6 Replace DartFileEditBuilder.importLibraries() with importLibrary().
It now returns the text of the URI that will be actually used, so
we can show it in the quick fix message without computing it separately.

R=brianwilkerson@google.com

Change-Id: I16a455d8f6a3c3e3a9c5779c94d654de32992006
Reviewed-on: https://dart-review.googlesource.com/55501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 18:46:22 +00:00
Konstantin Shcheglov d624b8580a Add DartEditBuilder.writeReference().
R=brianwilkerson@google.com

Change-Id: Id8a09c8c53987af49905a4cf6fa6a11b55dbd90c
Reviewed-on: https://dart-review.googlesource.com/54062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 19:52:48 +00:00
Konstantin Shcheglov 296ab86012 Revert "Add DartEditBuilder.writeTopLevelElementReference()."
This reverts commit 23a1534432.

Reason for revert: a different API is more suitable.

Original change's description:
> Add DartEditBuilder.writeTopLevelElementReference().
> 
> R=​brianwilkerson@google.com, paulberry@google.com
> 
> Change-Id: Ib1511a91a7f021002e4b2f109cebe82b2814985d
> Reviewed-on: https://dart-review.googlesource.com/53687
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia5a8f1976d8ffc21de5672cce3dee73c3297cfcf
Reviewed-on: https://dart-review.googlesource.com/53881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 03:50:28 +00:00
Konstantin Shcheglov 23a1534432 Add DartEditBuilder.writeTopLevelElementReference().
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ib1511a91a7f021002e4b2f109cebe82b2814985d
Reviewed-on: https://dart-review.googlesource.com/53687
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-05-04 16:37:26 +00:00
Konstantin Shcheglov b4a2259b5f Enhance DartEditBuilder.writeConstructorDeclaration() to support parameter/initializer/bodyWriter.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If6be2f3e095ae03355c04ea3f6a8524e478c1552
Reviewed-on: https://dart-review.googlesource.com/52989
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-30 15:56:19 +00:00
Mike Fairhurst f22cdd8def Revert "Change completionTarget.forOffset to accept & wrap dangling AstNodes."
This reverts commit fbfe5691cb.

Reason for revert: Subtle backwards incompatibility, with no obvious win-win fix.

Original change's description:
> Change completionTarget.forOffset to accept & wrap dangling AstNodes.
>
> Deprecate the entryPoint parameter, but still accept it in place of what
> used to be (positionally) compilationUnit.
>
> Detect if we have a compilation unit or not; and in the case we don't,
> add a new protection by asserting that it has no parent (its the root of
> the dangling tree).
>
> Its more of an implementation detail that completion contributors don't
> work well on dangling nodes, so fix it up for clients rather than
> expecting them to do it themselves.
>
> Change-Id: I3e454734e5b515f4e536f7229d541ca8c6aed60c
> Reviewed-on: https://dart-review.googlesource.com/52645
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>

Change-Id: I64a6689f7862fb2d256b348491c79c58ee0fe1a9
Reviewed-on: https://dart-review.googlesource.com/52962
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-04-27 21:23:06 +00:00
Mike Fairhurst fbfe5691cb Change completionTarget.forOffset to accept & wrap dangling AstNodes.
Deprecate the entryPoint parameter, but still accept it in place of what
used to be (positionally) compilationUnit.

Detect if we have a compilation unit or not; and in the case we don't,
add a new protection by asserting that it has no parent (its the root of
the dangling tree).

Its more of an implementation detail that completion contributors don't
work well on dangling nodes, so fix it up for clients rather than
expecting them to do it themselves.

Change-Id: I3e454734e5b515f4e536f7229d541ca8c6aed60c
Reviewed-on: https://dart-review.googlesource.com/52645
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-04-26 20:32:27 +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
Konstantin Shcheglov 9f0e391e28 Rename writeParameterSource() to writeParameter() and make 'type' optional.
R=brianwilkerson@google.com

Change-Id: I0658a642f5877ba2c3e8e69e173fb9cfba4ef719
Reviewed-on: https://dart-review.googlesource.com/47584
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-21 21:00:19 +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
Konstantin Shcheglov cc3e062578 Set higher relevance for exact type and subtype completions.
Exact type get the largest relevance boost, subtypes a smaller boost,
and the rest has default relevance for its element kind.

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

Bug: https://github.com/flutter/flutter-intellij/issues/998
Change-Id: Ibb38caedc314e9cf476de2116aeb61bcec8c8a08
Reviewed-on: https://dart-review.googlesource.com/43263
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-23 06:05:13 +00:00
Brian Wilkerson 3d183f6999 Add support for selection ranges to ChangeBuilder
Change-Id: Icd4c1bcf2ecb66020a9a7f478a037c478e8a109f
Reviewed-on: https://dart-review.googlesource.com/42024
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-16 19:23:06 +00:00
Konstantin Shcheglov c1d5d843af Add identifiers for Quick Assists.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I07cd18ae38f98793f960a2c7bd971527eaa6d7d6
Reviewed-on: https://dart-review.googlesource.com/40140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-12 20:56:09 +00:00
pq 06614a7b19 Proposed API for optionally building override cc displayText.
Change-Id: Ic3ea3317da1220c7d396348ae93e40ab672ecc59
Reviewed-on: https://dart-review.googlesource.com/40500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-11 18:01:13 +00:00
Konstantin Shcheglov f6febf35b1 Don't write EOLs before/after new class members.
R=brianwilkerson@google.com

Change-Id: Ie70423802985fc762fea2cb55a2936a3e3f3add0
Reviewed-on: https://dart-review.googlesource.com/39851
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-08 00:40:11 +00:00
Brian Wilkerson 740a0e751e Rework part of DartChangeBuilder to deal better with type parameters (issue 31199)
Change-Id: I1946e6070c0dcffaa02f61b9c7f857168a050a27
Reviewed-on: https://dart-review.googlesource.com/38483
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-05 18:21:36 +00:00
Brian Wilkerson 608bf972b0 Add folding support for plugins and update the main tutorial page
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3004733002 .
2017-08-28 08:05:37 -07:00
Brian Wilkerson d1a2a43d54 Add plugin support for occurrences (and fix typo)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3006703002 .
2017-08-28 08:04:42 -07:00
Brian Wilkerson 86918d713b Add SourceRange support to navigation collector
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3002343002 .
2017-08-27 12:31:13 -07:00
Brian Wilkerson dd00fc7750 Add support for highlights notification
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3004613002 .
2017-08-25 09:21:36 -07:00
Brian Wilkerson efd4051c7e Add utilities to support the outline notification
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/3002233002 .
2017-08-24 11:59:06 -07:00
Brian Wilkerson d87fcfd233 Correctly update positions when adding edits before them (issue 30444)
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2997073002 .
2017-08-16 10:29:26 -07:00
Brian Wilkerson 6f81034a73 Initial Kythe support for plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2997833002 .
2017-08-14 08:24:15 -07:00
Paul Berry e2f77056a5 Eliminate dependencies on pkg/front_end.
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).

This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end.  It also updates
pkg/analyzer_plugin to make use of those re-exports.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00
Brian Wilkerson 8a275e6df8 Add utility method to SubscriptionManager
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2983913002 .
2017-07-21 07:24:55 -07:00
Brian Wilkerson 6a7b9f441b Convert DartChangeBuilder to use AnalysisSession
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2969833002 .
2017-07-03 08:41:40 -07:00
Brian Wilkerson aadafd1bd5 Use DartEditBuilder to write types and remove dead code
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2972463003 .
2017-07-01 12:03:44 -07:00
Brian Wilkerson d1bb233f52 Remove timeStamp from the ChangeBuilder API
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2962223002 .
2017-06-29 13:48:46 -07:00
Brian Wilkerson 84dd01904d Missed change to conform to other APIs
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2965453002 .
2017-06-29 06:15:38 -07:00
Brian Wilkerson 7bd9e6c443 Add a mixin for assists similar to that for fixes
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2956353002 .
2017-06-28 11:44:22 -07:00
Brian Wilkerson 6248e7cab2 Add support code to make fixes easier in plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2962903002 .
2017-06-28 10:52:06 -07:00
Brian Wilkerson 4a10003924 Update the plugin API
R=maxkim@google.com, mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2953093002 .
2017-06-23 12:31:00 -07:00
Brian Wilkerson eafc070479 Remove ReplacementRange
R=danrubel@google.com, maxkim@google.com

Review-Url: https://codereview.chromium.org/2946573003 .
2017-06-19 10:15:36 -07:00
Max Kim 382ddb21c3 Refactor: Removed ReplacementRange from test and ReplacementRange from src/. Copied contents of test into lib/utilities and modified test path.
This is needed to expose ReplacementRange outside of test folder for external plugin users to utilize. Reason discussed further in ticket: https://codereview.chromium.org/2934133002/

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

Review-Url: https://codereview.chromium.org/2937093002 .
2017-06-16 11:19:27 -07:00
Max Kim e57d9b608f Change to accommade Angular plugin and finalize removal of dependency to analysis_server
BUG=
R=brianwilkerson@google.com, mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2934133002 .
2017-06-13 16:31:39 -07:00
Brian Wilkerson 1e9ae646ff Clean up some hints
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939723002 .
2017-06-13 09:24:50 -07:00
Brian Wilkerson d824acbf71 Update AssistProcessor to use ChangeBuilder
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928313002 .
2017-06-12 07:28:02 -07:00
pq b502bb6956 Prioritize required name param completions (flutter-intellij#1049).
R=danrubel@google.com

Fixes: https://github.com/flutter/flutter-intellij/issues/1049
Review-Url: https://codereview.chromium.org/2927343002 .
2017-06-09 10:20:16 -07:00
Brian Wilkerson 91b8b495b3 Add support for fixes
R=maxkim@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2923283002 .
2017-06-08 07:53:06 -07:00
Brian Wilkerson 9b0a98fd42 Port a missed piece to remove invalid reference to analysis_server
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2930723002 .
2017-06-07 10:06:33 -07:00
Brian Wilkerson 456f790aa7 Add support for implementing getAssists in plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2924063002 .
2017-06-07 09:19:47 -07:00
Brian Wilkerson 8a724f7093 Port two completion contributors for use by plugins
R=danrubel@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2927663002 .
2017-06-07 09:14:49 -07:00
Brian Wilkerson a8919b8237 Support a short-hand way to create linked edit groups
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928723003 .
2017-06-07 09:07:39 -07:00
Brian Wilkerson 6894364917 Add a mixin to handle analysis.getNavigation requests
R=mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2927603003 .
2017-06-06 14:12:59 -07:00
Brian Wilkerson 691cc1b57a Make navigation support consistent with completion support
R=mfairhurst@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2919293002 .
2017-06-05 12:33:20 -07:00
Brian Wilkerson db7d3d0fe7 Move relevance constants for use in plugins
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2923573002 .
2017-06-05 10:10:56 -07:00
Brian Wilkerson 12398ad917 Add completion support for plugins
R=maxkim@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2918613002 .
2017-06-03 09:44:56 -07:00