Commit Graph

1448 Commits

Author SHA1 Message Date
Konstantin Shcheglov 4e8e1e2e04 Improve search for constructors and import elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1778363003 .
2016-03-10 14:57:42 -08:00
Konstantin Shcheglov 5271cd3259 Fix for indexing synthetic elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1779233002 .
2016-03-10 10:57:08 -08:00
Brian Wilkerson 83df52b590 Move more behavior out of ContextManagerCallbacks and into ContextManager
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1784523002 .
2016-03-10 08:36:35 -08:00
Brian Wilkerson ec08de7df8 Get more data to track down issue 25884
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1775913005 .
2016-03-10 08:21:40 -08:00
Brian Wilkerson ef1c632679 Clean up some warnings (issue 25964)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1778663006 .
2016-03-09 17:32:49 -08:00
Brian Wilkerson d03381c587 Fix NPE in rename local (issue 25933)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1776743006 .
2016-03-09 17:02:15 -08:00
Konstantin Shcheglov 4d48fa56d0 Listen for context add/remove and unit invalidation to update the index.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1783503004 .
2016-03-09 14:52:19 -08:00
Konstantin Shcheglov 00b6f98166 Separate index objects for each analysis context.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1778113002 .
2016-03-09 13:24:12 -08:00
Brian Slesinsky ae009e0870 Fix regression for import suggestions
Imports weren't being suggested for implicit source files,
for example files from other analysis roots.

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

Review URL: https://codereview.chromium.org/1759333002 .
2016-03-09 12:59:46 -08:00
Konstantin Shcheglov 21ed1750ce Issue 25962. Check for the number of arguments vs. number of required parameters.
Unfortunately I was not able to reproduce the problem.

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

Review URL: https://codereview.chromium.org/1776353003 .
2016-03-09 11:33:01 -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
Konstantin Shcheglov 5b117e9e18 Use the fact that some index lists are sorted.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1776143002 .
2016-03-08 13:43:43 -08:00
Konstantin Shcheglov 3af20476d1 Add AnalysisContext.onResultInvalidated(descriptor).
This method will be used to remove index entries corresponding to
invalidated resolved units.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1776023002 .
2016-03-08 12:55:06 -08:00
Bob Nystrom cb7aa02116 Type check for-in statements.
This does nominal checking on the iterable expression used in a for-in
statement:

1. It must implement Iterable.
2. The type argument to Iterable must be assignable to the variable's
   type.

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

Review URL: https://codereview.chromium.org/1771153002 .
2016-03-08 11:25:49 -08:00
Konstantin Shcheglov b9ee5c20eb Implement SearchEngine.searchMemberReferences().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1768353002 .
2016-03-07 13:41:12 -08:00
Konstantin Shcheglov f2111c2497 Search for direct and indirect subclasses.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1770083002 .
2016-03-07 11:30:44 -08:00
Konstantin Shcheglov 2293a22b7f Implement searchMemberDeclarations() / searchTopLevelDeclarations().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1770953002 .
2016-03-07 11:14:05 -08:00
Konstantin Shcheglov 8dbbb55a2e Implement search for names defined in index.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1771903002 .
2016-03-07 10:40:01 -08:00
Konstantin Shcheglov 28f8a64210 Remove SearchEngine.searchElementDeclarations().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1769063002 .
2016-03-07 09:57:15 -08:00
pq f506639391 Back out ignore quick-fix.
As per, https://github.com/dart-lang/sdk/issues/25926, we'll migrate this behavior to the IDE side.

BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1770733002 .
2016-03-07 09:25:28 -08:00
Konstantin Shcheglov 9f448d00fe Support for searching of libraries, import prefixes and import elements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1767113002 .
2016-03-07 08:34:34 -08:00
Konstantin Shcheglov ec906bf12b Implement search for local elements.
We don't use Index for them, instead of visit coresponding AST subtrees
and add SearchMatch(es).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1760243004 .
2016-03-05 07:50:11 -08:00
Konstantin Shcheglov aa7bea0d6a New SearchEngine implementation - references only.
And only for the elements for which we have information in the index.
References to other kinds of elements - local variables, parameters,
etc can be implemented using AST visitors. To be implemented in next CLs.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1763133002 .
2016-03-04 12:08:04 -08:00
pq 1f0a0b5a5c Quick fix to ignore a specific error (#25915).
See: https://github.com/dart-lang/sdk/issues/25915

BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1764853002 .
2016-03-04 11:11:06 -08:00
Konstantin Shcheglov 6510065262 Check that target of a new constructor is a ClassDeclaration.
For an exception #10 from the list.

Cannot reproduce though.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1757393002 .
2016-03-03 13:19:40 -08:00
Konstantin Shcheglov adcf43968f Ignore not ClassDeclaration target of an unknown method invocation.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1764743002 .
2016-03-03 11:23:32 -08:00
Brian Slesinsky 5831cfb1bb Fix issue where errors aren't reported for a new overlay
A new overlay was not being marked as an explicitly added
source, even if it's within the directory of an analysis
context. As a result, errors were not being reported.

I believe this only happens if there's no underlying file.
Therefore it seems difficult to reproduce in an IDE, but
it comes up in a stress test.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1753083003 .
2016-03-03 10:42:45 -08:00
pq 8cd8d219ca Handle incomplete rule options gracefully.
Net-net: this fixes the case where we get storms of UNDEFINED_LINT_WARNINGs when parsed yaml nodes have null values.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1752183003 .
2016-03-03 09:58:30 -08:00
Konstantin Shcheglov 80531d974d Make SearchMatch usable for the new index - remove the element field.
The 'element' is still accessible, but as a computed property.

In many cases we don't need to know the containing element, and need
only the unit source, or the LibraryElement. So, by computing it on
demand we may save some time and make SearchMatch usable with the
new index - where we don't know the Element.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1764553002 .
2016-03-03 08:40:57 -08:00
Leaf Petersen 7d2976c7d5 Add instantiate method on ParameterizedType and InterfaceType,
and deprecate the old substitute4 in favor of instantiate.

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

Review URL: https://codereview.chromium.org/1758913002 .
2016-03-02 15:06:38 -08:00
Konstantin Shcheglov c9e82c7e67 Fill the new index in Analysis Server.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1749333004 .
2016-03-02 14:00:17 -08:00
Konstantin Shcheglov faf59757c8 Optimize ElementId search, rename the test file.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1755313002 .
2016-03-02 13:02:52 -08:00
Konstantin Shcheglov 6d1bf8b0fa Initial new index implementation.
Only getRelations() is implemented, and maybe not the most performant
implementation yet.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1755263002 .
2016-03-02 12:05:05 -08:00
pq d223676c7f Fix @override quick-fix to respect doc comments.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1751163002 .
2016-03-01 13:01:57 -08:00
Brian Wilkerson 841f8e6cf2 Move shouldFileBeAnalyzed into ContextManager
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1748763002 .
2016-03-01 12:40:56 -08:00
Konstantin Shcheglov e225e619cd Issue 25827. Don't propose to remove the type of an incomplete variable declaration.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25827

Review URL: https://codereview.chromium.org/1753893002 .
2016-03-01 12:20:24 -08:00
pq 6a75757e47 Updated hasFix(...).
Follow-up to: https://codereview.chromium.org/1736383002/

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1741133002 .
2016-03-01 08:32:48 -08:00
Brian Wilkerson 954d61f363 Partially revert notification of package map computation
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1750763002 .
2016-02-29 14:37:00 -08:00
Brian Wilkerson c4d7f41650 Move folderMap from AnalysisContext to ContextManager
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1750683002 .
2016-02-29 14:04:46 -08:00
Brian Wilkerson 4d9aa3edf4 Remove more methods from context manager callbacks
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1741663003 .
2016-02-29 10:43:55 -08:00
pq 549a7a4d00 Quick-fix for annotate_overrides lint (#25416).
An interim approach to shoe lint-awareness into the dart FixProcessor.  Once we have a a shareable processor base class we can migrate these bits into a dedicated LintFixProcessor contributed by the LintServerPlugin.

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

BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1736383002 .
2016-02-26 14:23:05 -08:00
Brian Wilkerson 5c2afc8d09 Start work to remove the context manager callbacks
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1739913003 .
2016-02-26 13:11:46 -08:00
Konstantin Shcheglov 44fc8ec8f3 Make add/remove type Quick Assists less obtrusive.
It is nice to have them until after the variable name, but not OK to
have them on initializers, especially when the initializer has a
closure.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1737563002 .
2016-02-25 08:20:23 -08:00
Dan Rubel 9fe92127e5 update setAnalysisRoots to accept package spec file
As part of addressing https://github.com/dartino/atom-dartino/issues/13,
this CL updates the setAnalysisRoots API to allow package spec files
in the packageRoots map.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1711353003 .
2016-02-19 10:57:16 -05:00
Paul Berry 12a7ccaa52 Don't call deprecated "isPotentiallyMutated..." API from analysis server.
Analysis server's use of this API was just for generating debug status
anyhow.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1711003002 .
2016-02-18 10:20:48 -08:00
Konstantin Shcheglov 026748533f Add @override when implement missing overrides for fields.
This makes the code generated by DAS closer to the code generated by
the IDEA plugin.

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

Review URL: https://codereview.chromium.org/1705283002 .
2016-02-17 13:30:23 -08:00
Brian Slesinsky c578120504 Throw a better exception for a modified analysis cache key
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1698093004 .
2016-02-16 16:26:05 -08:00
Brian Wilkerson 71e7ed86c0 Move scanner out of generated and clean up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1693083004 .
2016-02-14 07:48:44 -08:00
danrubel 6188d18eec rework completion request resolve imports
* rename resolveDirectives --> resolveImports
* rework resolveImports to return list of ImportElement rather than Directive
* new resolveDirectives test
* set priority source during completion tests

This and https://codereview.chromium.org/1685653002/ fixes https://github.com/dart-lang/sdk/issues/25690

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1693933002 .
2016-02-13 23:15:52 -05:00
danrubel 748ad91b64 rework LocalLibraryContributor to resolve referenced units
This is similar reworking code completion import resolution
https://codereview.chromium.org/1693933002/

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1692273003 .
2016-02-13 23:07:51 -05:00