Commit Graph

1766 Commits

Author SHA1 Message Date
Brian Wilkerson 07895169be Remove code duplication
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2618983003 .
2017-01-06 10:55:55 -08:00
Konstantin Shcheglov e9794e37b5 Call processOptionsForDriver() before creating the driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2615903002 .
2017-01-05 11:10:01 -08:00
Konstantin Shcheglov d9930d86cd processOptionsForDriver() is never called with 'optionsRemoved'.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2612783004 .
2017-01-05 08:47:52 -08:00
Konstantin Shcheglov 9a3b6a09e5 Issue 28261. Add support for implementing generic methods in Quick Fix.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28261

Review-Url: https://codereview.chromium.org/2618653002 .
2017-01-05 08:32:03 -08:00
Konstantin Shcheglov 1e43b4f270 Replace using MockSdk with FolderBasedDartSdk + summaries in AbstractContextTest(s).
It has some performance penalty (about 2-3 seconds in 35 seconds total).

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

Review-Url: https://codereview.chromium.org/2610823004 .
2017-01-04 14:39:24 -08:00
Konstantin Shcheglov 44bab19cb3 Implement 'analysis.analyzedFiles' notification with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2612723002 .
2017-01-04 07:12:47 -08:00
Konstantin Shcheglov 606bdb519f Cache results for priority files in AnalysisDriver.
Remove corresponding caching from Analysis Server.

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

Review-Url: https://codereview.chromium.org/2611523005 .
2017-01-03 17:04:58 -08:00
Konstantin Shcheglov 7e560a612f Enable the new analysis driver by default, use --disable-new-analysis-driver to disable.
R=paulberry@google.com, brianwilkerson@google.com, devoncarew@google.com
BUG=

Review-Url: https://codereview.chromium.org/2606283005 .
2017-01-03 14:50:17 -08:00
Brian Wilkerson bbf45b52e6 Guard against missing enclosing class (issue 28163)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2609833002 .
2017-01-03 07:52:54 -08:00
Brian Wilkerson e1a27c0c60 Rework the replay test to be more correct
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2611593002 .
2017-01-03 07:45:07 -08:00
Konstantin Shcheglov eaca15cd4d Fix analysis.getNavigation with the new analysis driver.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/28125

Review-Url: https://codereview.chromium.org/2582753003 .
2016-12-16 10:52:47 -08:00
Konstantin Shcheglov 7e15a96b1b Use AnalysisOptions.signature as a way to check compatibility.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2577943003 .
2016-12-15 13:01:06 -08:00
Brian Wilkerson 8c946a6b9b Apply error processors in the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2577913002 .
2016-12-14 16:07:06 -08:00
Brian Wilkerson a8e9a1f108 Fix updating source factory in driver (issue 28086)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2571353002 .
2016-12-14 13:08:23 -08:00
Konstantin Shcheglov 52c81e4a78 Fix for detecting lib/src. Sort fixes by relevance.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2572013002 .
2016-12-14 06:57:19 -08:00
Konstantin Shcheglov 3a422bceb7 Implement SearchEngine.searchMemberDeclarations() for the new driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566393003 .
2016-12-13 14:06:15 -08:00
Konstantin Shcheglov 142473b8cb Implement SearchEngine.searchTopLevelDeclarations() for the new driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2572603003 .
2016-12-13 12:11:22 -08:00
Paul Berry cc2b071743 Fix up imports after d8c9645c26.
Review-Url: https://codereview.chromium.org/2567403002 .
2016-12-13 05:15:47 -08:00
Mike Fairhurst d8c9645c26 Reorganize InheritedRefenenceContributor to serve angular completion
Take the parts that I would have simply copied and pasted them into my
own code, and create new public & private methods to serve the new
organization.

Add an option to get the current class's accessors/methods along with
the inherited ones, because that's what I want.

Make opType a public member of DartCompletionRequest

Its used so heavily by so many of the autocomplete targets, it really
doesn't need to be hidden on the Impl.

Besides, I want to use InheritedReferenceContributor, which upcasts the
DartCompletionRequest into the Impl in order to grab this field -- but
for a large number of reasons I can't really use
DartCompletionRequestImpl. Therefore I need my own class to implement
DartCompletionRequest and therefore my code will only work with
InheritedReferenceContributor if it doesn't have to look outside the
interface for this information.

Change to enable the angular analysis project to do autocomplete

We don't have CompilationUnits, but we do have dart ASTs, and we want to
find the completion target with the same algorithm. The CompletionTarget
class's functionality doesn't depend on its member compilationUnit not
being null, so that isn't a problem for us. However, in `forOffset()`,
we cannot pass in a null unit, even though its only used to set the
`compilationUnit` member and otherwise only used as an `AstNode` which
we have.

So rather than using `compilationUnit` as the entry point of the
algorithm, add a new `AstNode` parameter to represent the entry point,
and when its null simply use the value of `compilationUnit`.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2565633002 .
2016-12-12 14:29:53 -08:00
Brian Wilkerson 223513c81a Fix bug when packages file changes in new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2570623002 .
2016-12-12 14:03:00 -08:00
Konstantin Shcheglov a5b2e62bda Fix for completion after the closing quote in a directive.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2572513003 .
2016-12-12 13:38:38 -08:00
Konstantin Shcheglov c4ed99acc9 Support for overlay only files in Analysis Server with the new driver.
Do we need this at all?

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

Review-Url: https://codereview.chromium.org/2571593002 .
2016-12-12 13:16:04 -08:00
Konstantin Shcheglov d564b0aaab Send errors notification without delay.
Update 'analysis.updateContent' integration test.

This might be OK from performance POV - errors are cheaper to send than
for example navigation. And this satisfies the goal of 'analyzing'
notification - that new errors are to be expected.

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

Review-Url: https://codereview.chromium.org/2567113003 .
2016-12-12 11:39:47 -08:00
Konstantin Shcheglov 2a7612f103 Implement 'analysis.occurrences' for the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566223002 .
2016-12-12 10:07:19 -08:00
Konstantin Shcheglov a7222ac09d Implement 'analysis.outline' for the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2571513002 .
2016-12-12 09:09:45 -08:00
Konstantin Shcheglov 0728e4ee70 Implement 'analysis.getErrors' for the new driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566013002 .
2016-12-11 15:27:57 -08:00
Konstantin Shcheglov 80e30c4c4e Implement 'analysis.getNavigation' for the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2566883002 .
2016-12-11 15:23:03 -08:00
Brian Wilkerson 86c62a6bad Remove the command-line plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2565993002 .
2016-12-11 10:59:19 -08:00
Konstantin Shcheglov 4fa3413596 Renames and comment tweaks for files.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2569623002 .
2016-12-11 10:11:07 -08:00
Brian Wilkerson a01afcd1d1 Remove the options plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2569603002 .
2016-12-11 08:38:29 -08:00
Brian Wilkerson ebf5fbcd0e Remove references to the linter plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2567863002 .
2016-12-10 10:00:20 -08:00
Konstantin Shcheglov 9ab69ab984 Implement SearchEngine.searchAllSubtypes() with the analysis driver.
Inline getSubClasses().

Add a couple of tests for SearchEngineImpl2 itself.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2564913002 .
2016-12-09 09:32:49 -08:00
Brian Wilkerson c99adefae7 Get some tests running using the analysis driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2562083002 .
2016-12-09 08:32:39 -08:00
Konstantin Shcheglov 685b956840 Set empty namespaces for public/exportNamespace of synthetic libraries.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2556253004 .
2016-12-08 08:15:04 -08:00
Paul Berry ae6fd961a1 Prepare for decoupling analyzer ASTs from element model.
This CL creates top level accessor functions which may be used to map from AST data structures to their corresponding elements and types, and begins using those accessor functions throughout the SDK.  It also adds empty interfaces ResolutionTarget and ResolutionType, which are implemented by Element and DartType respectively.

In a future CL, I will change the types stored in the AST to ResolutionTarget and ResolutionType, rather than specific element types; this will decouple the ASTs from the element model.  The presence of the accessor functions will allow clients to continue accessing elements and types in a type-safe way.

R=asgerf@google.com, brianwilkerson@google.com, scheglov@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/2551023005 .
2016-12-07 11:08:14 -08:00
Brian Wilkerson 0ea654a068 Remove the AnalysisOptionsProcessor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2559523005 .
2016-12-07 10:51:33 -08:00
Brian Wilkerson 20baedc660 Reapply "Move the linter core to the analyzer package"
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2559773002 .
2016-12-07 09:57:17 -08:00
Paul Berry 1a172e935b Revert "Move the linter core to the analyzer package"
This reverts commit 6d9d5f53a1, which
was causing analysis server unit tests to fail.

TBR=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2561573003 .
2016-12-07 05:36:46 -08:00
Konstantin Shcheglov 402cd0b646 Implement 'Import Library' Quick Fix for the new analysis driver.
It turned out to be easier than I thought is would be.

The potential problem was to find correspondence between AnalysisResult
and the AnalysisDriver instance to request top-level declarations in.
But if we just include the AnalysisDriver into AnalysisResult, this
solves the problem.

This creates another problem though - now we need to be careful to
not cache an instance of AnalysisResult for a long time.

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

Review URL: https://codereview.chromium.org/2549143007 .
2016-12-06 15:00:53 -08:00
Konstantin Shcheglov 57c3002ede Implement 'Import Library' Quick Fix for project libraries using TopLevelDeclarationInSource.
Only the current implementation is done.

Implementation for the new analysis driver is not linked yet.

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

Review URL: https://codereview.chromium.org/2554113003 .
2016-12-06 14:24:22 -08:00
Brian Wilkerson 6d9d5f53a1 Move the linter core to the analyzer package
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2553203002 .
2016-12-06 09:42:26 -08:00
Konstantin Shcheglov b862410fef Implement search for direct subtypes and enable search.getTypeHierarchy request.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2557543002 .
2016-12-05 14:45:26 -08:00
Konstantin Shcheglov a86fe28658 Send 'analysis.flushResults' on file removal.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2552023002 .
2016-12-05 13:38:21 -08:00
Konstantin Shcheglov 6a9edde070 Issue 27820. Add fix for CompileTimeErrorCode.UNDEFINED_CLASS.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/27820

Review URL: https://codereview.chromium.org/2546993004 .
2016-12-03 14:15:41 -08:00
Brian Wilkerson b81564b623 Add support for generating lints when using the new driver
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2545553007 .
2016-12-03 07:25:42 -08:00
Konstantin Shcheglov c0ac1ca8f4 Report analysis exceptions using the 'exceptions' stream or 'completeError'.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2546213002 .
2016-12-02 14:22:40 -08:00
Konstantin Shcheglov 24ffedcef0 Guard against null in EditDomain.
https://github.com/dart-lang/sdk/issues/27974

Paul, this also should fix the issue you see:
NoSuchMethodError: The getter 'element' was called on null.

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

Review URL: https://codereview.chromium.org/2549883002 .
2016-12-02 13:33:32 -08:00
Brian Wilkerson 06bc6e5d33 Guard against missing token (issue 27963)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2547053002 .
2016-12-02 09:14:18 -08:00
Paul Berry 0c31815f1c Transition analyzer and analysis_server to new astFactory.
This is the same as 1d028eed8d (which
was reverted) except that it doesn't remove the old AST factory
constructors (which broke dev_compiler).  The removal of old AST
factory constructors will be done in a follow-up CL so that if it
unexpectedly breaks any other clients we will be able to revert it
without reverting this CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2536373008 .
2016-12-01 10:56:21 -08:00
Konstantin Shcheglov 2368a59d60 Add libraries in corrections using SourceInfo instance of LibraryElement.
We are not going to have LibraryElement(s) for the new analysis driver.

The current approach: get known library sources, compute their elements,
import these elements does not work well when there is no analysis cache.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2532393008 .
2016-12-01 10:22:48 -08:00