Commit Graph

1530 Commits

Author SHA1 Message Date
Konstantin Shcheglov 522eaa9a80 Don't suggest types, getters, etc in 'for (Type ^)'.
Variable names should be suggested there.

It does not work for the moment, I'll need to make changes into
VariableNameContributor. But NOT suggesting all the garbage - for me
thi is 90% of the full solution ;-)

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1960783002 .
2016-05-09 12:30:15 -07:00
Konstantin Shcheglov cf71ab114b Suggest 'is' in 'if (x is^)'.
So, we don't treat is as an expression start, and don't suggest
inappropriate 'while', 'await', etc or identifiers.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1958733002 .
2016-05-06 14:36:43 -07:00
Konstantin Shcheglov 3775d92000 Suggest 'var' and 'final' in intializer of 'for'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1953893004 .
2016-05-06 13:49:48 -07:00
Konstantin Shcheglov b73b82221e Fixes for completing 'for (var v in^)' and 'if (v is^)'.
The 'if (v is)' will require more work - we somehow manage to suggest
'if', 'final', 'switch', 'while', but NOT 'is'. But at least identifiers
are now out.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1956813004 .
2016-05-06 13:17:15 -07:00
Konstantin Shcheglov ada9cf43db Issue 26355. Don't overwrite full index with declarations-only one.
What happens in this case is that when we analyze this project with
many (very small) files, we successfully index first declarations
(on computing RESOLVED_UNIT3) and then RESOLVED_UNIT. But when we attempt
to search, we ask for RESOLVED_UNIT, which is flushed. So, we compute it.
In the process we compute RESOLVED_UNIT3, and the listener in
_setupIndexInvalidation() indexes declarations, and overwrites the full
index.

There are several possible solutions, the simplest one is to not
overwrite any existing index information while indexing declarations.

R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26355

Review URL: https://codereview.chromium.org/1946353004 .
2016-05-05 07:10:14 -07:00
Konstantin Shcheglov fcf97b6c3d Keep directive annotations while sorting.
In one of the previous CLs I sorted unit members and removed the
required @MirrorsUsed annotation.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1938023002 .
2016-05-02 10:09:38 -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
Konstantin Shcheglov 0f0b38dab3 Implement stable resolution of generic types without type arguments to their bounds.
R=brianwilkerson@google.com, leafp@google.com
BUG= https://github.com/dart-lang/sdk/issues/26265

Review URL: https://codereview.chromium.org/1927323002 .
2016-04-29 08:25:55 -07:00
pq 870aa5e4f4 Pubspec-specified analysis configuration (#26359).
Provides support for pubspec-specified analysis configurations.

Context: https://github.com/dart-lang/sdk/issues/26359

TODO:
  * docs
  * CLI support

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1923973004 .
2016-04-28 13:10:45 -07:00
Brian Wilkerson ee8bb2cea9 Add a (public) utility method to clean-up code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1925173002 .
2016-04-28 10:07:32 -07:00
Jaime Wren 1aee4602bc Code completion bug fix, https://github.com/dart-lang/sdk/issues/26342, and test cleanup in variable_name_contributor_test.dart
BUG=https://github.com/dart-lang/sdk/issues/26342
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1924683002 .
2016-04-27 09:26:49 -07:00
Konstantin Shcheglov 78ca9cc10b Fixes for SingleContextManager after experiments with two big codebases.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1926763002 .
2016-04-27 08:46:18 -07:00
Konstantin Shcheglov 5318eca65c Watch analysis roots separately.
The context folder sometimes includes way too much.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1919343002 .
2016-04-26 11:33:50 -07:00
Konstantin Shcheglov c6257ba52b Add Driver.useSingleContextManager to turn on single context manager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1915833007 .
2016-04-26 10:29:48 -07:00
Konstantin Shcheglov 099f227c17 Add test for 'refresh()' and clean up other tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1922743002 .
2016-04-26 07:16:44 -07:00
Konstantin Shcheglov 4cd1d552e4 We don't use path filter in SingleContextManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1916063003 .
2016-04-25 14:31:03 -07:00
Jaime Wren 086026307b Plug VariableNameContributor contributor into completion_plugin.dart
BUG=https://github.com/dart-lang/sdk/issues/24254
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1916213002 .
2016-04-25 14:01:22 -07:00
Konstantin Shcheglov c9068a8692 Listen for changes in the context folder.
I had to convert several static methods into instance ones becuse I'd
like to use PathContext from the ResourceProvider.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1921863002 .
2016-04-25 13:51:47 -07:00
Jaime Wren e01634bd79 Code completion progress part two of fix to https://github.com/dart-lang/sdk/issues/24254, addition of new contributor, variable_name_contributor.dart.
The completions are not yet showing up in either IDE, IntelliJ or Atom.

BUG=https://github.com/dart-lang/sdk/issues/24254
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1916893002 .
2016-04-25 12:51:14 -07:00
Konstantin Shcheglov f892af36d8 Only add files that are match an analyzed files glob.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1922643002 .
2016-04-25 11:44:04 -07:00
Konstantin Shcheglov 44cedebded Support for replacing of the context folder.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1920993002 .
2016-04-25 11:24:43 -07:00
Konstantin Shcheglov 337862bca2 Initial version of SingleContextManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1918893002 .
2016-04-25 08:38:38 -07:00
Jaime Wren 58bf3075a8 Code completion progress part one of fix to https://github.com/dart-lang/sdk/issues/24254, addition of optype.includeVarNameSuggestions
BUG=https://github.com/dart-lang/sdk/issues/24254
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1910263004 .
2016-04-22 11:00:21 -07:00
Brian Wilkerson 166f23e13f Code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1907323002 .
2016-04-22 09:05:01 -07:00
Jaime Wren 9c1c7ed250 Code Completion refactoring, follow up on comment in https://codereview.chromium.org/1908703002/ to cleanup boilerplate.
Also, changed all filters to use one typedef making the all function filters consistent and type checked.

R=danrubel@google.com

Review URL: https://codereview.chromium.org/1911803004 .
2016-04-21 12:19:28 -07:00
Jaime Wren bfb5849f44 Code completion bug fix, don't suggest optional field formal parameters that are already in the constructor
BUG=https://github.com/dart-lang/sdk/issues/26255
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1907723002 .
2016-04-21 10:46:35 -07:00
Jaime Wren cc065a3ad0 Code completion improvement, use type information when suggesting constructors, part 2.
This finishes the work started with https://codereview.chromium.org/1892823003/, by also adding the filter into the local_library_contributor.dart.

BUG=https://github.com/dart-lang/sdk/issues/26254
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1908703002 .
2016-04-21 10:16:06 -07:00
Jaime Wren 55eac4da46 Code Completion API fix of mistake in DartCompletionRequest
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1900373003 .
2016-04-21 10:05:10 -07:00
Konstantin Shcheglov 305f1f538c Pull the 'keyword' property into Token.
So, we can use it without casting to KeywordToken.
This gives small, but noticable performanace boost, about 4% on hot VM.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1909843002 .
2016-04-21 08:23:49 -07:00
Jaime Wren b13f1fe313 Code completion API refactoring: replace resolveExpression(Expression) with resolveContainingExpression(AstNode) and resolveContainingStatement(AstNode)
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1898983004 .
2016-04-20 13:13:14 -07:00
Paul Berry 8f9defbb50 Move InheritanceManager to its own file.
No changes other than code motion.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1903663003 .
2016-04-20 08:58:00 -07:00
Brian Wilkerson f3b177e481 Remove references to and uses of MemberMap
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1893313004 .
2016-04-20 07:40:02 -07:00
Brian Wilkerson 9aa64259dc Revert "Remove MemberMap in favor of HashMap"
Review URL: https://codereview.chromium.org/1898193004 .
2016-04-19 12:20:48 -07:00
Brian Wilkerson fb43f1276c Remove MemberMap in favor of HashMap
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1904433003 .
2016-04-19 11:59:44 -07:00
Jaime Wren 214a201ae5 Code completion improvement, use type information when suggesting constructors
BUG=https://github.com/dart-lang/sdk/issues/26254
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1892823003 .
2016-04-18 12:11:46 -07:00
Brian Wilkerson 3ab253b977 More steps toward making server strong mode clean
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1900503002 .
2016-04-18 07:52:42 -07:00
Brian Wilkerson d680aba415 Move scopes into a separate library
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1888223003 .
2016-04-15 07:38:57 -07:00
Brian Wilkerson 21a1b757c1 Clean up hints after a new hint was introduced
R=jwren@google.com

Review URL: https://codereview.chromium.org/1890973002 .
2016-04-14 13:15:34 -07:00
Jaime Wren 01aaf8629e Code completion improvement: in NamedExpressions (m(someNamedParam: ^)), use type information to sort variables higher in relevance.
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1882243003 .
2016-04-13 16:11:39 -07:00
Jaime Wren 6a29eab2c3 Code completion refactoring in local contributor, have calls to _addLocalSuggestion() split into the different categories of completions so that fitering, see _addLocalSuggestion_includeTypeNameSuggestions(), can occur before the suggestion gets to _addLocalSuggestion()
Take two: can't commit it here: https://codereview.chromium.org/1881153002/

Review URL: https://codereview.chromium.org/1882903002 .
2016-04-13 10:15:50 -07:00
Brian Wilkerson 7bc093bf1c Remove unused field
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1882473004 .
2016-04-12 12:32:42 -07:00
Florian Loitsch 50bdab3841 Steps towards making the convert library strong-mode compliant.
This version has a few deprecated methods. In a future release they will be removed.

See https://codereview.chromium.org/1827803002 for the final patch (once the deprecated methods have been removed).

R=leafp@google.com, lrn@google.com

Committed: https://github.com/dart-lang/sdk/commit/4ab1219bf93a33a2a3d4803e053ccd70ce190371
Reverted: https://github.com/dart-lang/sdk/commit/045a3753665268761508c8053e0ee84372d9ef35

Review URL: https://codereview.chromium.org/1847843002 .
2016-04-12 20:59:21 +02:00
danrubel 657f88d7f0 use type information to filter RHS of "is" expression for imported types
fixes #22357

R=jwren@google.com

Review URL: https://codereview.chromium.org/1876603002 .
2016-04-11 15:57:41 -04:00
Florian Loitsch 045a375366 Revert "Steps towards making the convert library strong-mode compliant."
This reverts commit 4ab1219bf9.

Review URL: https://codereview.chromium.org/1881553002 .
2016-04-11 19:52:57 +02:00
Florian Loitsch 4ab1219bf9 Steps towards making the convert library strong-mode compliant.
This version has a few deprecated methods. In a future release they will be removed.

See https://codereview.chromium.org/1827803002 for the final patch (once the deprecated methods have been removed).

R=leafp@google.com, lrn@google.com

Review URL: https://codereview.chromium.org/1847843002 .
2016-04-11 19:16:04 +02:00
Jaime Wren 8a9403e15c Code completion improvement in the DAS- only suggest completions on the RHS of an as-expression that are proper subtypes of the type of the LHS of the as-expression.
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1872073002 .
2016-04-11 09:59:30 -07:00
Jaime Wren bb62c408bf Fix for issue 22357: use type information on the RHS of is expressions to improve quality of completions.
BUG=https://github.com/dart-lang/sdk/issues/22357
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1871073003 .
2016-04-08 15:16:53 -07:00
danrubel dbaf0c33b0 show only named argument suggestions - fixes #25198, fixes #23992
R=jwren@google.com

Review URL: https://codereview.chromium.org/1867063003 .
2016-04-08 12:54:31 -04:00
Jaime Wren 3c8b0d20f3 Fix for issue 23861: CompletionSuggestion.parameterType are now populated.
BUG=https://github.com/dart-lang/sdk/issues/23861
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1864243002 .
2016-04-07 13:01:53 -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