Commit Graph

177 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 def6f6c86c Don't create linked groups when nothing was written.
In particular, if the type was invalid, so that we cannot write it.

R=brianwilkerson@google.com

Change-Id: I5499e17e2aa3527d21cab050b7fecfd3cd09efc7
Reviewed-on: https://dart-review.googlesource.com/55860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-18 15:54:29 +00:00
Konstantin Shcheglov abb1ee98f7 Move library related operations to DartFileEditBuilderImpl. Initialize enclosing elements into fields lazily.
R=brianwilkerson@google.com

Change-Id: Ic933c9399f2288805e1f450f9d564e174516addc
Reviewed-on: https://dart-review.googlesource.com/55760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 18:41:49 +00:00
Konstantin Shcheglov 62ffedefdd Rewrite writing types to using existing writeXYZ() methods.
Also extract code that ensures imports and writes prefixes into a
separate method.

R=brianwilkerson@google.com

Change-Id: Icd35af19435153bfaebd46f7611823e6a9830d20
Reviewed-on: https://dart-review.googlesource.com/55640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 15:51:27 +00:00
Konstantin Shcheglov 0ad2b1243d Use carbon copy buffer field instead of passing it around.
R=brianwilkerson@google.com

Change-Id: I96d60d3012687c152168032717569c32cf0dc314
Reviewed-on: https://dart-review.googlesource.com/55585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-17 01:40:52 +00:00
Konstantin Shcheglov d91af4625c Fix fix import URIs from file:// URIs on Windows.
This fix the issue we see on bots.

R=brianwilkerson@google.com

Change-Id: I65dfde81a6194a8bbdbf860129d4c19b646ef730
Reviewed-on: https://dart-review.googlesource.com/55521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 20:23:23 +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 757ef3979c Revert "Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled."""
This reverts commit 4089111540.

R=brianwilkerson@google.com

Change-Id: I66297466f8baafe6e070acbcb1776b41f3d9fedc
Reviewed-on: https://dart-review.googlesource.com/55506
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-16 19:43:22 +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
Danny Tuppeny 568e977a35 Update FoldingKinds enum, update specs and increase version number
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ieccfd90ead67a9803744c54db4eec8eea0b0403c
Reviewed-on: https://dart-review.googlesource.com/54920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-14 16:48:48 +00:00
Konstantin Shcheglov bdecb92032 Fix MinimalPlugin to allow its loading in Dart2 VM.
R=brianwilkerson@google.com

Change-Id: I9e52979cee844f32e4d423a7c928c0359f9dd5b2
Reviewed-on: https://dart-review.googlesource.com/54708
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-11 19:47:09 +00:00
Konstantin Shcheglov 964dae472c Issue 30577. Use AST to find position for the first directive.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/30577
Change-Id: If69df5f49228a3b698544dcf82ad0c34c1be84e8
Reviewed-on: https://dart-review.googlesource.com/54307
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-09 06:00:59 +00:00
Konstantin Shcheglov 8515d74332 Add ImportElement.namespace and use it in completion.
R=brianwilkerson@google.com

Change-Id: I58cadf0e3239ad4ae8584d79485f4d9ebda10eba
Reviewed-on: https://dart-review.googlesource.com/54064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-07 21:23:48 +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
Paul Berry 73abd61304 Re-land "Clean up the use of deprecated API in the analyzer_plugin package".
int.tryParse is now available to internal Google users, so it is safe
to land this change now.

This reverts commit 115850ca1d.
Original commit 86ba29265a.

Change-Id: I92c3d19533d3108c06910f21070266953c3a065b
Reviewed-on: https://dart-review.googlesource.com/53244
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-05-01 21:08:04 +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
Konstantin Shcheglov c17ef848d6 Don't try to add new imports before leading comments of another import.
By doing this we tried to fix keeping "// ignore: xyz" correct.
https://github.com/dart-lang/sdk/issues/32432

Unfortunately this breaks a more often case, when there is a license
comment before the first import directive, and there is no reliable
way to decide if a comment is a license or not.

R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2169
Change-Id: Id5bdf7af48bd0b8748a53f8c5b3eb79ac2d6ae01
Reviewed-on: https://dart-review.googlesource.com/52940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-27 20:59:09 +00:00
Konstantin Shcheglov da49615c2c Don't filter out references to constructors.
Even if we assign to something that wants a different type, we might
chain some property access on it later on, so it is not nice to don't
suggest anything at all. Instead, we should give higher relevance to
compatible types, but keep all the rest with default relevance, as we
did already for everything other than instance creations.

R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/1107
Change-Id: I86c3c5dded4ad4cbbf28a60c0ae2847f07a3373b
Reviewed-on: https://dart-review.googlesource.com/52863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-26 23:43:26 +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
Paul Berry 115850ca1d Revert "Clean up the use of deprecated API in the analyzer_plugin package"
This reverts commit 86ba29265a.

The replacement API (int.tryParse) has only just been introduced and
is not yet avaiable to internal Google users.  I plan to un-do the
commit in about a week once the internal SDK has been updated.

Change-Id: Ic9206231861400d42f4814e4a56bde57ba8705a5
Reviewed-on: https://dart-review.googlesource.com/52822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-04-26 18:48:43 +00:00
Mike Fairhurst 4bf738606b Fix (+test) dangling expression autocompletion for angular
Change-Id: If35f998eb7fe38f21e30bfba3d87c507c07ebc7c
Reviewed-on: https://dart-review.googlesource.com/52522
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-04-24 22:04:13 +00:00
Brian Wilkerson 86ba29265a Clean up the use of deprecated API in the analyzer_plugin package
Change-Id: If63afeea8042814fd87a109aa40a6ed14ea7ee59
Reviewed-on: https://dart-review.googlesource.com/51102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-13 18:32:19 +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 4089111540 Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled.""
This reverts commit e5ed23fdb5.

R=brianwilkerson@google.com

Change-Id: Ida33856e965f06f773025f3c625d6ab3bace80a8
Reviewed-on: https://dart-review.googlesource.com/49280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-03 22:29:09 +00:00
Konstantin Shcheglov e5ed23fdb5 Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled."
This reverts commit a1e4d8e0bf.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Don't do implicit new/const code generation with --preview-dart-2 enabled.
> 
> R=​brianwilkerson@google.com, devoncarew@google.com
> 
> Change-Id: I8a96a5ccceae57c3ed5c1f2e0fd4897a7e99df03
> Reviewed-on: https://dart-review.googlesource.com/48883
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ie3acf0794ed7b8264682e29aaa4bc1516fce6981
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/48900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-30 19:24:46 +00:00
Konstantin Shcheglov a1e4d8e0bf Don't do implicit new/const code generation with --preview-dart-2 enabled.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I8a96a5ccceae57c3ed5c1f2e0fd4897a7e99df03
Reviewed-on: https://dart-review.googlesource.com/48883
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-30 18:07:25 +00:00
danrubel b82e5b4704 Replace code completion usage of token.previous with findPrevious
This CL is the first in a multi-part effort to remove the `previous`
field from the Token class. This first step introduces a new findPrevious
utility method that finds the the token before a given token in a token stream,
and then replaces usages of token.previous with calls to this
new findPrevious utility.

Change-Id: I57de4e542adb5950f1bddd951ff555dd98b19b3b
Reviewed-on: https://dart-review.googlesource.com/48461
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-28 02:27:54 +00:00
Brian Wilkerson d3295ded48 Remove the SORT_MEMBERS refactoring from the spec
Change-Id: Ic8b8135f22d8c3c07d4ded661ac43d2d5105dc3f
Reviewed-on: https://dart-review.googlesource.com/48464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-27 16:37:44 +00:00
Brian Wilkerson be867d5fa4 Update analyzer_plugin to be Dart 2 safe
Change-Id: I0fb4f7274deb92c47518594a1bbcfc39dca5aeff
Reviewed-on: https://dart-review.googlesource.com/47942
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-23 00:19:45 +00:00
Konstantin Shcheglov 6bd38cc912 Analysis Server API for 'Extract Widget' refactoring.
R=brianwilkerson@google.com

Change-Id: Ie6b7c349d304785ab6829770ebd3504c0affe8df
Reviewed-on: https://dart-review.googlesource.com/47943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-22 20:25:29 +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
Konstantin Shcheglov 15bf72615d Fix for using isFinal/isConst with type in writeFieldDeclaration().
R=brianwilkerson@google.com

Change-Id: I73ae0f2e714b2820e327e9a9e5a98baf5a2df189
Reviewed-on: https://dart-review.googlesource.com/47560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-21 19:18:56 +00:00
Brian Wilkerson b15860f43a Convert analyzer_plugin tests to pass under preview-dart-2
Change-Id: I4531491524de0e93391a75a3972f249d604f0e2b
Reviewed-on: https://dart-review.googlesource.com/46568
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-15 16:54:59 +00:00
Konstantin Shcheglov e1909cb52a Update Outline protocol - change offset/length, add codeOffset/codeLength.
R=brianwilkerson@google.com

Change-Id: I4b5c03a21254f7c497adc4c043641b18599c5c39
Reviewed-on: https://dart-review.googlesource.com/45764
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-09 01:52:57 +00:00
Brian Wilkerson 602a8c2a7b Clean up usage of deprecated constants
Change-Id: I9005ba6e94529e15d8f7b21322591f4a9dabec47
Reviewed-on: https://dart-review.googlesource.com/45763
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-09 01:02:49 +00:00
Brian Wilkerson f5b5ae86b6 Respect comments when inserting imports (issue 32432)
Change-Id: I163818e60e21ee68bd621b8faa94b7ba9b545bcf
Reviewed-on: https://dart-review.googlesource.com/45526
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-07 20:47:42 +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 215aa21172 Boost completion relevance for more cases.
R=brianwilkerson@google.com

Change-Id: Ib5fe69d3a0d20e29f36575e692a7418b6744ca83
Reviewed-on: https://dart-review.googlesource.com/44281
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-28 19:32:56 +00:00
Konstantin Shcheglov 4cf5b7df12 Boost relevance for compatible types in '==' and switch/case.
Probably less Flutter specific, but still useful.

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

Change-Id: I979e1a0640494a4a6cbedcec90781bc165c94f31
Reviewed-on: https://dart-review.googlesource.com/44000
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-27 17:36:40 +00:00
Mike Fairhurst 75bed68ca2 Handle null unit check for angular plugin in completion
Change-Id: I0dfba8ad20023ddf0248684bc4436e5057ca5f36
Reviewed-on: https://dart-review.googlesource.com/43492
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-23 23:40:47 +00:00
Devon Carew aac3b7a3c1 Address two analyzer warnings.
Change-Id: Idec60e040785b8967c024557f15dc28839287a94
Reviewed-on: https://dart-review.googlesource.com/43540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-02-23 19:42:58 +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
Mike Fairhurst 7fdab0de2c Fix issue autocompleting members on dynamic values in ng plugin.
See angular issue #499 for a stack trace. When autocompleting a member
on dynamic, the member contributor checks to find a member definition
higher up in the tree that should lead to specific members to suggest.

However, in the angular plugin, the ASTs passed in are often fragments.
Account for the case where a node has no parent earlier than expected.

Change-Id: Ib30d9f1aef77241224f604c5994489aa9448b0c2
Reviewed-on: https://dart-review.googlesource.com/42884
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-22 19:19:47 +00:00
Konstantin Shcheglov 0ce1a92d98 Suggest constructors for implicit creation in previewDart2.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/998
Change-Id: I43270f47fb43402d1a9e0f7d9814494ffd83bb5e
Reviewed-on: https://dart-review.googlesource.com/43080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-22 18:03:12 +00:00
Konstantin Shcheglov fcccab9199 Filter constructor completions by required type.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/998
Change-Id: I88eb345bfa7f0a65d135e5fdcb443d5dadd695c5
Reviewed-on: https://dart-review.googlesource.com/42882
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-21 23:12:31 +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