Commit Graph

25510 Commits

Author SHA1 Message Date
Paul Berry 9d280198a4 Prepare to publish analyzer version 0.35.1.
Change-Id: Ib3d31fa14ec2144a04d95f33bac385f38a47d6a7
Reviewed-on: https://dart-review.googlesource.com/c/92820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-12 19:39:21 +00:00
Konstantin Shcheglov 135abb41f7 Migrate ElementResolverCodeTest from task model.
R=brianwilkerson@google.com

Change-Id: I1494934d56476971518c5e002479def1ba231dd7
Reviewed-on: https://dart-review.googlesource.com/c/92765
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 19:07:53 +00:00
Paul Berry 6d2daa692c Set non_nullable experiments flag during migration tests.
Fixes #35909

Change-Id: I2c92af7a3e2d31cb7fe04b3ccd2b117badeedf35
Reviewed-on: https://dart-review.googlesource.com/c/92760
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 19:04:53 +00:00
Sigmund Cherem c507acfae4 Fix Js-interop factory calls which broke when eliding optional parameters.
The issue derives from the fact that `parameterStructure` has only the preserved parameters,
however the SSA was emitting values for all arguments.

I fixed this by emitting all parameters. I also noticed that the parameter order should
probably be the native-ordering here as well (it doesn't matter for the factory, but it may
matter for other static native calls, if any)

Bug: https://github.com/dart-lang/sdk/issues/35916
Change-Id: I2e93c7f8e3baf5c9285107d23786bb3bf4f3a511
Reviewed-on: https://dart-review.googlesource.com/c/92626
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-02-12 18:53:43 +00:00
Stephen Adams 66c404a26e dart2js: Reduce assert helpers
Change-Id: Ic2ce0e485e3fd27b8f4e92371eb17a076d5192c1
Reviewed-on: https://dart-review.googlesource.com/c/92668
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-02-12 18:34:34 +00:00
Konstantin Shcheglov c812d5a373 Fix available suggestions tests on Windows.
R=brianwilkerson@google.com

Change-Id: Ie96cfe6ee5ed2eaea596a8c2faaf842a0b67a570
Reviewed-on: https://dart-review.googlesource.com/c/92764
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 18:32:33 +00:00
Konstantin Shcheglov 80e85d06ab Fixes for enum constants in available declarations.
R=brianwilkerson@google.com

Change-Id: Ic1ad3846ecf82cdd5f1f0b0d0d5a69b0d5c43d81
Reviewed-on: https://dart-review.googlesource.com/c/92763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 17:43:58 +00:00
Brian Wilkerson 5fe0202b0b Unify MapElement and CollectionElement
Change-Id: Ia1be138d656d07bdf4c11640b79044abbc798986
Reviewed-on: https://dart-review.googlesource.com/c/92762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-12 17:10:58 +00:00
Danny Tuppeny f54650ccaf Add LineInfo to Declaration search results
This allows LSP to translate locations to line/col ranges without re-requesting the LineInfos.

Change-Id: I59fab4d9f9de123deefd02a901ab4cc34ef8c0fb
Reviewed-on: https://dart-review.googlesource.com/c/92680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-12 15:16:45 +00:00
Paul Berry ce91bcb442 Add migration support for named parameters.
Currently assuming that the language team chooses option 2 for
https://github.com/dart-lang/language/issues/156#issuecomment-460525075.

To handle the case where the user does not specify a default value,
and all call sites supply the named parameter, there are two possible
heuristics:

- assumeNullable: mark the parameter as nullable, since the implicit
  default is `null`, even though the implicit default is never used.

- assumeRequired: consider the parameter to be `@required`, ensuring
  that the implicit default will never be used.

I've provisionally chosen `assumeRequired` as the default behavior.

Functionality not yet implemented:

- If `@required` is already present in the source code, this should
  override the heuristic; also it should not be added again.

- If the parameter is already marked as nullable in the source code,
  this should override the heuristic.

- Uses of `@required` should be translated to `required`.

- If `@required` is already present in the source code, and a default
  value is supplied, the default value should be removed.

- If the parameter is used in a way that demonstrates it was intended
  to be non-nullable (i.e. it appears in a place in unconditional
  control flow that would cause an exception to be thrown if it was
  null), this should override the heuristic and cause it to be marked
  as `@required`.

Change-Id: I9f2ec63787fdb6215e6075ecfcc830ed9942b8b5
Reviewed-on: https://dart-review.googlesource.com/c/92532
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 14:49:14 +00:00
Aske Simon Christensen ed5bdfa227 [CFE] Fix check for unavailable constructors.
To support separate compilation in DDC, the constant evaluator would
leave instantiations through unavailable constructors unevaluated.
These constructors were identified by being in an external library and
having no initializers. This check erroneously triggered on
"const Object()", breaking the bytecode generator.

Change-Id: I73c10982a36086a431e9fbd54d67cbcde90df68e
Reviewed-on: https://dart-review.googlesource.com/c/92721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-02-12 14:26:09 +00:00
Aske Simon Christensen 250f9665fb [CFE] Get constants backend from backend target.
Change-Id: I04286cd38eb45ca38f8335d896c503becad16566
Reviewed-on: https://dart-review.googlesource.com/c/92136
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-12 09:56:57 +00:00
Aske Simon Christensen b7afb22323 [CFE] Eliminate redundant coreTypes parameter.
Change-Id: Ie76a70454ef6dd7e60b916e2820c1d4e78b3e88d
Reviewed-on: https://dart-review.googlesource.com/c/92134
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-02-12 09:56:57 +00:00
Aske Simon Christensen 44681fa98e [CFE] Move DDC specific behavior into ConstantsBackend.
This avoids subclassing the constant evaluator in DDC.

Change-Id: If529761dc3fac474fade925bf0daaff51ad6e71b
Reviewed-on: https://dart-review.googlesource.com/c/92046
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-12 09:56:57 +00:00
Konstantin Shcheglov 02b65ee478 Include 'includedSuggestionRelevanceTags' into completion response.
R=brianwilkerson@google.com

Change-Id: Ib2d26a2f4679c19b8fa889b9fabf80f505eaef28
Reviewed-on: https://dart-review.googlesource.com/c/92625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 01:51:05 +00:00
Konstantin Shcheglov 71e8588399 Include enum constants into available declarations.
R=brianwilkerson@google.com

Change-Id: I86c525981119a77ad8b69878f8134d927f873817
Reviewed-on: https://dart-review.googlesource.com/c/92662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 01:04:34 +00:00
Konstantin Shcheglov 3de72ae066 Added files, when in a context root, should be accessible through getLibraries().
R=brianwilkerson@google.com

Change-Id: I6d36ac4bed51b6e40307d2821780bb3fb08d540d
Reviewed-on: https://dart-review.googlesource.com/c/92624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 21:04:44 +00:00
Konstantin Shcheglov b9bcfb4529 Change IncludedSuggestionRelevanceTag to using 'relevanceBoost'.
Sometimes there is no difference between 'relevance' and 'relevanceBoost',
for example for enum constants. But for primitive constants, there might
be multiple `double` constants, in different libraries with their own
different relevances. And it would be nice to keep relative relevances
of these libraries in primitive type constants.

R=brianwilkerson@google.com

Change-Id: I3641a4709e09f5c5dd979f5ca8df7b0235c708d2
Reviewed-on: https://dart-review.googlesource.com/c/92623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 20:10:29 +00:00
Danny Tuppeny b88d11a9bd Implement LSP workspace/symbol
Change-Id: I4303a146dce9a5a4b40345f7ea8ef8355163337b
Reviewed-on: https://dart-review.googlesource.com/c/92602
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 19:32:52 +00:00
Sam Rawlins 25cefbdad7 Add HintCode.INVALID_VISIBILITY_ANNOTATION. Fixes #35141
Bug: https://github.com/dart-lang/sdk/issues/35141
Change-Id: Ifa8401e4ab772390c94d03a485ed7d07f43aff55
Reviewed-on: https://dart-review.googlesource.com/c/92660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-02-11 19:06:28 +00:00
Paul Berry 640bfb45f8 Mark test as failing due to #35909
Change-Id: I242d87bc7104d0f01af4be4339be451ca2308736
Reviewed-on: https://dart-review.googlesource.com/c/92621
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 17:57:00 +00:00
Konstantin Shcheglov 5f02f3cac2 Remove tests for removed ARGUMENT_LIST suggestions.
It was removed for https://github.com/dart-lang/sdk/issues/25197

This CL though does not remove it everywhere though.
There are 41 other references in tests, doing:
assertNoSuggestions(kind: CompletionSuggestionKind.ARGUMENT_LIST);

Maybe we should remove these as well?

R=brianwilkerson@google.com

Change-Id: I812a2d6900e8430e5808a5a5cd8285b32d1517d6
Reviewed-on: https://dart-review.googlesource.com/c/92620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 17:55:00 +00:00
Mike Fairhurst a988ed06bd [analyzer] Fix off-by-one-error in experiments
Change-Id: I5c9710c7e6ea737b68f8c694ba6cde1690b74d2a
Reviewed-on: https://dart-review.googlesource.com/c/92566
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-11 16:16:29 +00:00
Jens Johansen 5e48ccb808 Give more context when initializing from dill fails
Previously, if failing when trying to load from a dill it would say
something like

Warning: Tried to initialize from a previous compilation
(build/app.dill), but couldn't. Error message was
'NoSuchMethodError: The method 'getReference' was called on null.
Receiver: null
Tried calling: getReference()'. This might be a bug.
The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Which really doesn't give us a lot to go on.

This CL changes that to also give us a little go to on, and report
something like

Warning: Tried to initialize from a previous compilation
(org-dartlang-test:///initializeFrom.dill), but couldn't.
Error message was 'NoSuchMethodError: The method 'getReference' was
called on null.
Receiver: null
Tried calling: getReference()'. Stacktrace included '#0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1      BinaryBuilder.readLibraryReference (package:kernel/binary/ast_from_binary.dart:692:9)
#2      BinaryBuilder.readLibraryDependency (package:kernel/binary/ast_from_binary.dart:837:25)
#3      BinaryBuilder._readLibraryDependencies (package:kernel/binary/ast_from_binary.dart:829:33)
#4      BinaryBuilder.readLibrary (package:kernel/binary/ast_from_binary.dart:803:5)
#5      BinaryBuilder._readOneComponent (package:kernel/binary/ast_from_binary.dart:634:7)
#6      BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:441:7)
#7      IncrementalCompiler.initializeFromDill (package:front_end/src/fasta/incremental_compiler.dart:395:14)
<asynchronous suspension>
#8      IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:126:23)
<asynchronous suspension>
#9      CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:46)
#10     new Future.sync (dart:async/future.dart:224:31)
#11     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:19)
#12     _rootRun (dart:async/zone.dart:1124:13)
#13     _CustomZone.run (dart:async/zone.dart:1021:19)
#14     _runZoned (dart:async/zone.dart:1516:10)
#15     runZoned (dart:async/zone.dart:1463:12)
#16     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#17     IncrementalCompiler.computeDelta (package:front_end/src/fasta/incremental_compiler.dart:108:20)
<asynchronous suspension>
#18     initializedCompile (file:///usr/local/google/home/jensj/code/dart-sdk/sdk/pkg/front_end/test/incremental_load_from_dill_test.dart:397:51)
<asynchronous suspension>
#19     basicTest (file:///usr/local/google/home/jensj/code/dart-sdk/sdk/pkg/front_end/test/incremental_load_from_dill_test.dart:167:34)
<asynchronous suspension>
#20     RunCompilations.run (file:///usr/local/google/home/jensj/code/dart-sdk/sdk/pkg/front_end/test/incremental_load_from_dill_test.dart:101:15)
<asynchronous suspension>
#21     ChainContext.run.doStep.<anonymous closure> (package:testing/src/chain.dart:180:33)
<asynchronous suspension>
#22     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#23     _rootRun (dart:async/zone.dart:1120:38)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#26     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#27     _rootRun (dart:async/zone.dart:1124:13)
#28     _CustomZone.run (dart:async/zone.dart:1021:19)
#29     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#30     Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#31     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#32     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#33     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
'. This might be a bug. The Dart team would greatly appreciate if you would take a moment to report this problem at http://dartbug.com/new.

which will hopefully allow us to actually debug any such reports.

Change-Id: I13bdd4f96c1e4bb2dcce91e533442b48c87c9e0c
Reviewed-on: https://dart-review.googlesource.com/c/85348
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-11 09:58:40 +00:00
Brian Wilkerson a5c53b03cd Convert more doc comments from block to line style
Change-Id: I62fe9b25fb91518bd054c41688bdff0effbe830b
Reviewed-on: https://dart-review.googlesource.com/c/92540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 06:35:32 +00:00
Konstantin Shcheglov fdfe40ea95 Compute 'executableElement' and 'parameterElement' in CompletionTarget.
R=brianwilkerson@google.com

Change-Id: I58904548a034cf927d9205bdbba3be9014c49328
Reviewed-on: https://dart-review.googlesource.com/c/92539
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 06:08:00 +00:00
Brian Wilkerson 36a31879da Preserve indentation when converting documentation from block to line
Change-Id: I2528b73aaea23d85c397d2199b6f5f9706809c3c
Reviewed-on: https://dart-review.googlesource.com/c/92536
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 01:31:59 +00:00
Brian Wilkerson 6875b9b26b Do not convert empty function bodies to async (issue 35899)
Change-Id: Ie08504aa927b27f45cc6c02089cc679e3b9d2376
Reviewed-on: https://dart-review.googlesource.com/c/92537
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 01:31:52 +00:00
Brian Wilkerson 00ee3159e5 Convert interfaces to use implements not extends
Change-Id: Ia49fb8aefe7eb096ab8c8365a77337155c3c473a
Reviewed-on: https://dart-review.googlesource.com/c/92535
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-10 19:31:27 +00:00
Brian Wilkerson 0a2672453f Split out several more hint tests
Change-Id: I6483656ca2ac9c7cfa00249cf37ccbb78758ffb6
Reviewed-on: https://dart-review.googlesource.com/c/92533
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-10 18:51:22 +00:00
Konstantin Shcheglov a49f7f1d44 Remove FunctionTypeAlias in _isFunctionalParameter().
It is not a type, but a node.

R=brianwilkerson@google.com

Change-Id: I603e958dda3c2486285a57bc23f2fd37491105f4
Reviewed-on: https://dart-review.googlesource.com/c/92528
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 17:11:18 +00:00
Konstantin Shcheglov 5f2d651d94 Move FindElement to analyzer/src/test_utilities/.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I3f376728ffe7fa49f50b8265359d637fca07ca57
Reviewed-on: https://dart-review.googlesource.com/c/92530
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 16:44:38 +00:00
Paul Berry 7cec1b03b6 Add missing awaits to migration tests.
Change-Id: Id7f4d5f063ba7253f5e8bd7abcf60a53fe7538af
Reviewed-on: https://dart-review.googlesource.com/c/92529
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 03:27:49 +00:00
Paul Berry b3ee960092 Stop indirecting through VariableRecorder/VariableRepostitory to create constraint variables.
The indirection wasn't adding any value.

Change-Id: I1c1b41a55b5cee37f75c30c3fa6ebfe56083ed56
Reviewed-on: https://dart-review.googlesource.com/c/92526
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-10 01:45:20 +00:00
Mike Fairhurst 5f79c9f4d1 Move UNCHECKED_NULL to error verifier.
Main risk in this CL is that it deviates from the void work which I'm confident is exhaustive.

Particularly, operators on void are caught by the resolver as a special kind of missing method, hopefully I put all the syntactic checks in at all the necessary places.

I also hardcoded "toString()," "hashCode." I previously had hardcoded to allow "==" checks, however, the code in ErrorVerifier was tripping over that. So now it should be good.


Change-Id: I56abb0219feb7aa143159694b688be15ba29015c
Reviewed-on: https://dart-review.googlesource.com/c/92063
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 23:26:49 +00:00
Konstantin Shcheglov 090ba0a520 Fix FUNCTION_TYPE_ALIAS test, provide the name for the named parameter.
R=brianwilkerson@google.com

Change-Id: Ief40a5d51d40f254b7398d679197fc5a9912c657
Reviewed-on: https://dart-review.googlesource.com/c/92524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 22:26:59 +00:00
Konstantin Shcheglov d5038fc976 Stop using FileContentOverlay in RuntimeCompletionComputer and AbstractContextTest.
RuntimeCompletionComputer still is not good to work with AnalysisSession,
but now does not use the deprecated API.

R=brianwilkerson@google.com

Change-Id: I07f5e496c6f268c4d213ebb3794fa214b437f21e
Reviewed-on: https://dart-review.googlesource.com/c/92525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 22:26:19 +00:00
Paul Berry ad3adb6285 Move nullability migration algorithm into analysis server.
Change-Id: Ie240b42cab37e3f5adce8633d368fcf6667b3a37
Reviewed-on: https://dart-review.googlesource.com/c/92522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-09 19:01:14 +00:00
Paul Berry 9103baf31c Move find_node into test_utilities so that it can be re-used in analysis server tests.
Change-Id: I9a302944ccc96b04a64508cc1f71498056f150bf
Reviewed-on: https://dart-review.googlesource.com/c/92521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 19:01:14 +00:00
Brian Wilkerson 5787f08619 Clean up some hints in server and analyzer
Change-Id: Ia6bb5e4e4e398dbed29fe6649c490a88d4e0a406
Reviewed-on: https://dart-review.googlesource.com/c/92523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 17:58:44 +00:00
Konstantin Shcheglov 5f3ed76854 Issue 3172. When adding a required argument, create a linked group for the default value.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3172
Change-Id: I991b7d6a1094691d2a005786cb5bbc507a1004c9
Reviewed-on: https://dart-review.googlesource.com/c/92520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 17:30:35 +00:00
Konstantin Shcheglov 6f6bed94fd Replace TypeMatcher with isXyzElement.
R=brianwilkerson@google.com

Change-Id: Ibe6d4aa5c5c5e1b692fb527fcd0347a84783b19d
Reviewed-on: https://dart-review.googlesource.com/c/92444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 23:39:48 +00:00
pq 18b5d66966 pass analysis options to linter contexts
Adds an analysis options backpointer to linter contexts.  With this, lint rules can
query options and conditionally support enabled language experiments.



Change-Id: I35dbfd112ed5f149dcc17b17b2edaf7420b38090
Reviewed-on: https://dart-review.googlesource.com/c/92460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-02-08 23:38:58 +00:00
Konstantin Shcheglov 2bab9eab49 Guard against empty URIs.
Particularly, against empty `part` URIs, because this would cause us
to think that the library includes a part, which URI is... the library
itself, because `resolveUri(uri, '') === uri`.

R=brianwilkerson@google.com

Change-Id: Ie6bf0279c467b00d9b5540697e866d0e619d49b0
Reviewed-on: https://dart-review.googlesource.com/c/92443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 23:07:50 +00:00
Konstantin Shcheglov e6bc1d317a Break AvailableDeclarationsTest into several test classes.
R=brianwilkerson@google.com

Change-Id: I987fb062853beb61a54cfd9dafb10e175142d93f
Reviewed-on: https://dart-review.googlesource.com/c/92442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 21:21:06 +00:00
Konstantin Shcheglov 61ae86bce2 Add relevance tags to available declarations.
R=brianwilkerson@google.com

Change-Id: Ifa0fef7f9e572368c857fe972e007483782f119e
Reviewed-on: https://dart-review.googlesource.com/c/92405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:56:36 +00:00
Konstantin Shcheglov 6b0baad623 Track definitely nullable and non-nullable variables.
This CL also contains changes from another CL.
Add missing generics in FlowAnalysis.
I can wait until that CL lands, and rebase, if it helps.

This CL also switches to a different approach to handle try / finally,
using two parallel states instead of 'restrict'.

R=paulberry@google.com

Change-Id: I1ca5bed3b4362cb3bdca5abf36c849c59538e57e
Reviewed-on: https://dart-review.googlesource.com/c/92246
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:54:16 +00:00
Konstantin Shcheglov 67c5923cce Enhance protocol to allow changing relevance of individual suggesions.
R=brianwilkerson@google.com

Change-Id: I3f3d256fcdc4d41c527bbc03fb71800583a264f7
Reviewed-on: https://dart-review.googlesource.com/c/92382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
2019-02-08 19:25:05 +00:00
Paul Berry afe37d7fe0 Add migration support for named parameters (with and without default values).
At this point the migration tool is beginning to make assumptions
about decisions the language team hasn't made yet, so I've created a
class to document those assumptions and allow us to test variants.

Change-Id: I4638d7f534cfa2dbd8460277351045c370377ff8
Reviewed-on: https://dart-review.googlesource.com/c/92394
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-08 17:47:55 +00:00
Konstantin Shcheglov 69d0411768 Fix exception when completion is requested not in a Dart file.
R=brianwilkerson@google.com

Change-Id: I3b24631dd4dec7124b7be13cc0618c289985476c
Reviewed-on: https://dart-review.googlesource.com/c/92389
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 17:10:45 +00:00