Commit Graph

1021 Commits

Author SHA1 Message Date
John McCutchan dfc35faaf9 Make exclude list also exclude contexts
- Only create a context if the directory/.packages/pubspec.yaml is not excluded.
- Add tests.

Fixes: https://github.com/dart-lang/sdk/issues/23941

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

Review URL: https://codereview.chromium.org//1263443005 .
2015-08-03 13:54:17 -07:00
danrubel 9d5154a1fd include exported library namespace in prefixed import suggestions
Closes #23946

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1263093003 .
2015-08-03 13:52:44 -07:00
Konstantin Shcheglov 64ff591f56 Organize directives implementation.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1266393002 .
2015-08-03 13:49:57 -07:00
Konstantin Shcheglov e5b4713f03 'Import library' and 'Create class' Quick Fixes for unresolved class-like name in list literals.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1269043003 .
2015-08-03 13:03:28 -07:00
Konstantin Shcheglov aa30cad380 Proposal for the 'edit.organizeDirectives' request.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/23921

Review URL: https://codereview.chromium.org//1258563008 .
2015-08-03 07:59:26 -07:00
Brian Wilkerson 24189ea4f9 Make PathFilter use the resource providers path context
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1260443006 .
2015-07-31 10:06:38 -07:00
pq 818229cbae Server options file rename.
Clone of https://codereview.chromium.org/1256113004/ which I couldn't cleanly land...

Review URL: https://codereview.chromium.org//1261203003 .
2015-07-30 16:15:44 -07:00
pq 88b8fb8e1e Server options handling.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//1270593002 .
2015-07-30 12:58:58 -07:00
Paul Berry e93b52a66f Deprecate option "enableNullAwareOperators" in analysis server.
As of analyzer version 0.25.2, this option is no longer needed;
null-aware operators are always enabled.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1255113005 .
2015-07-28 11:31:03 -07:00
Paul Berry f5dab3fd2b Convert ContextManager to recursively watch analysis roots.
Previously ContextManager watched the contents of each context folder
independently; this was redundant in the case where one context folder
was nested inside another.  Also it led to some race conditions, since
we had to examine the contents of a folder in order to determine
whether there should be a context associated with it, but we couldn't
begin watching those files for that context until after the context
was created; this left a small window of time where a change to the
files might go unnoticed.

Note that a minor functional change is introduced: if "pub list"
indicates that the package resolution for a given folder is dependent
upon a file outside that folder, we no longer watch that file for
changes.  This shouldn't be a problem, since in practice "pub list"
always lists exactly two files as dependencies, and both of those
files are inside the folder (pubspec.yaml and pubspec.lock).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1257933002 .
2015-07-26 20:56:43 -07:00
Paul Berry cdfa46faa5 Improve package root tests.
Partially fixes #23909.  Previously, these tests didn't work at all.
Now they verify that the FolderDisposition is based on the correct
package root, but they don't yet verify that the package map is
generated correctly.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1257913002 .
2015-07-26 15:08:58 -07:00
Paul Berry 641284a263 Generalize the dependency tracking mechanism used by ContextManager.
Previously, we tracked "pub list" dependencies using
ContextInfo.packageMapInfo.dependencies, but that mechanism could only
be used for folders that resolved packages using "pub list".  Other
dependencies were tracked ad hoc (such as dependencies on ".packages",
or anti-dependencies* on "pubspec.yaml"); others weren't tracked at
all (such as dependencies on ".analysis_options").

(*In this context, an "anti-dependency" is a dependency on the fact
that a file is absent.  E.g. when we decide not to create a separate
context for a subfolder, it is in part because that subfolder lacks
its own "pubspec.yaml" file.)

This CL migrates the "pub list" dependencies to a more general
mechanism; future CL's will migrate the other ad hoc dependencies to
use the same mechanism.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1258723002 .
2015-07-24 14:52:05 -07:00
Konstantin Shcheglov 14e1cdc86c Fix for 'analysis.getNavigation' implementation.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1260503002 .
2015-07-24 14:27:20 -07:00
Paul Berry 46c284abdf Stop optimizing uses of "pub list".
The use case which made this optimization necessary is now gone, and
it's getting in the way of refactoring ContextManager.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1256793006 .
2015-07-24 10:42:25 -07:00
Paul Berry 7fb62213cf Introduce FolderDisposition class hierarchy for use in ContextManagerCallback.
The new class hierarchy encapsulates the packageUriResolver and
packages parameters that were previously used in the
ContextManagerCallback API.  In a future CL, I intend to use it more
extensively within ContextManagerImpl in order to make the algorithm
for choosing contexts more declarative.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1258473003 .
2015-07-24 06:42:54 -07:00
Paul Berry 391741a2de Clean up bogus codepath in ContextManager._computePackageUriResolver.
This codepath was only exercised during unit tests and race
conditions.  The fact that it was executed during unit tests at all
was due to a bug (see #23909).  The behavior during race conditions
was incorrect (it tried to set up package resolution using a folder
that didn't exist).

This CL fixes the race condition behavior and disables the affected
tests.  In a future CL I will fix the underlying bug that caused the
unit tests to execute incorrectly, and re-enable the tests.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1253803002 .
2015-07-24 06:39:21 -07:00
Paul Berry 37bf862fe4 Get rid of ContextManager._contexts.
This data structure was redundant with the tree of contexts maintained
in ContextManager._rootInfo.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1243063003 .
2015-07-23 11:03:44 -07:00
Paul Berry b3d245d608 Clarify nomenclature of "ancestor" and "root" in context manager.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1249023003 .
2015-07-22 12:53:22 -07:00
Paul Berry 6f6410cd9f Preliminary refactoring work on ContextManager.
- There is now a single virtual ContextInfo representing the root of
  the context tree; this should allow us to reduce the need for
  traversing the _contexts map, and should reduce the number of corner
  cases that need to be handled when creating and destroying contexts,
  since tree roots will never be created nor destroyed.

- We now build the contexts while recursing down the directory tree
  and populate them with files while unwinding the recursion; this is
  more consistent with the data flow (deciding which contexts to build
  depends only on the current directory and directories above it;
  deciding which files to include in a context depends only on the
  current directory and directories below it).

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

Review URL: https://codereview.chromium.org//1243233003 .
2015-07-22 10:34:43 -07:00
Paul Berry e30ebf79e2 Remove redundant context lookups from option-processing code.
This required exposing the ContextInfo class for testing, but I don't think that's a problem because ContextInfo objects can't be reached through the public API of ContextManager.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1251663002 .
2015-07-21 15:06:11 -07:00
Paul Berry b3da0bd138 Move _onContextsChangedController and defaultOptions into AnalysisServer.
This eliminates the need for some ugly casts.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1251563002 .
2015-07-21 11:34:18 -07:00
Paul Berry 128dec84b5 Separate the API's used by ContextManager.
Previously, ContextManager had two API's: one used by analysis server
to tell the ContextManager what to do, and one used by the
ContextManager to make callbacks to analysis server in response to its
requests.  The first API was implemented in the class
AbstractContextManager, which derived from ContextManager, and the
second API was implemented in ServerContextManager, which derived from
AbstractContextManager.

In addition to causing confusion, this made it impossible to provide
an alternate implementation of ContextManager as a plug-in, since the
plug in would have had to re-implement the second API, and that would
have required accessing private implementation details of the
ContextManager.

This CL separates the API's: the first API is specified in
ContextManager and implemented in ContextManagerImpl, and the second
API is specified in ContextManagerCallbacks and implemented in
ServerContextManagerCallbacks.

In the long run I hope to eliminate the ContextManagerCallbacks class
entirely, by having the ContextManager tell its client what to do
using return values rather than callbacks.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1243893002 .
2015-07-21 10:40:57 -07:00
Konstantin Shcheglov c4652486b4 Fix for a copy/paste problem in GET_NAVIGATION_INVALID_FILE.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1243073004 .
2015-07-21 08:46:55 -07:00
Konstantin Shcheglov d5d0017e21 Tweak for navigation for URIs.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1246833002 .
2015-07-20 15:07:00 -07:00
Konstantin Shcheglov a049c5aba0 Update DAS protocol version to 1.9.0
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1241213002 .
2015-07-20 12:24:37 -07:00
Konstantin Shcheglov 55cb93b422 Add '--useAnalysisHighlight2' option to generate version 2 of semantic highlight.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1241193002 .
2015-07-20 10:37:46 -07:00
Brian Wilkerson 15a0f755e8 Improve error messages for invalid requests
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1246573002 .
2015-07-20 10:23:01 -07:00
Brian Wilkerson bc265ebe28 Implement support for watching directories containing implicitly analyzed files
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1244613004 .
2015-07-20 09:04:37 -07:00
Brian Wilkerson 78fb9729fa Concrete implementation of completion request (from new API)
R=danrubel@google.com

Review URL: https://codereview.chromium.org//1242223002 .
2015-07-19 08:37:47 -07:00
pq 05d4206929 Server .packages support.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1242023008 .
2015-07-18 22:18:30 -07:00
Brian Wilkerson c884410865 Remove reference to as-yet-uncommitted file
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1227203011 .
2015-07-17 14:38:21 -07:00
John McCutchan 87e4f68bf5 Drop try block
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1236933007 .
2015-07-17 14:18:37 -07:00
John McCutchan 0300e2e9fd Make analysis_server use ignore patterns from .analysis_options file
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1234293003 .
2015-07-17 14:10:37 -07:00
John McCutchan cb5335dc4a Add a PathFilter to each context in analysis_server
BUG=
R=brianwilkerson@google.com, pquitslund@google.com

Review URL: https://codereview.chromium.org//1238173003 .
2015-07-17 12:42:57 -07:00
Brian Wilkerson 23f96f1916 Renames to move closer to the new API
R=danrubel@google.com

Review URL: https://codereview.chromium.org//1240433008 .
2015-07-17 12:20:02 -07:00
Brian Wilkerson 1dfef4bb0c Ensure that there is a stack trace when reporting a server error
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1232243004 .
2015-07-16 10:36:10 -07:00
Paul Berry 2f6ebaa774 Only send "analysis.analyzedFiles" notification when the set of files changes.
R=jwren@google.com

Review URL: https://codereview.chromium.org//1233003002 .
2015-07-13 15:52:28 -07:00
Brian Wilkerson 2ffa8de794 Add notification of analyzed files
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1232393005 .
2015-07-13 15:07:33 -07:00
Brian Wilkerson 0c6872acef Hook for overriding the ContextManager and some code clean-up (with more to follow)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1223413003 .
2015-07-13 10:20:13 -07:00
Brian Wilkerson 10b7db100f Revert "Update Analysis Server highlight API and implementation."
This reverts commit 739847402b.

Rolling the wire protocol API version forward caused existing clients to break, so we're rolling it back until we can find a backward compatible way of adding the new functionality.

R=paulberry@google.com

Review URL: https://codereview.chromium.org//1236433003 .
2015-07-13 09:49:55 -07:00
Konstantin Shcheglov d7c2f4550b Issue 23640. Implement 'analysis.getNavigation' request.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/23640

Review URL: https://codereview.chromium.org//1232683003 .
2015-07-10 15:31:25 -07:00
Konstantin Shcheglov 739847402b Update Analysis Server highlight API and implementation.
I think this is a good enough compromise between the existing and IDEA granilarity.

Eclipse plugin CL will follow.

(IN)VALID_STRING_ESCAPE are not implemented yet.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1227143003 .
2015-07-09 11:19:44 -07:00
John McCutchan 6ecf960c5e Move SdkExtUriResolver from analysis_server to analyzer so it can be used in analyzer_cli
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1214823003 .
2015-07-08 10:28:19 -07:00
John McCutchan 8e4a96d016 Fix SdkExtUriResolver.restoreAbsolute
BUG=

Review URL: https://codereview.chromium.org//1228643003 .
2015-07-08 10:00:18 -07:00
John McCutchan 598336788d Add support for .sdkext file to analysis server
- Add SdkExtUriResolver which is populated with any dependency provided sdk extensions.
- Adjust AnalysisServer._createSourceFactory to setup a SdkExtUriResolver whenever the roots are set.
- Add unit tests for SdkExtUriResolver.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1213613017 .
2015-07-08 07:51:41 -07:00
Konstantin Shcheglov b62e8fbca9 New Quick Assist - 'Convert to field formal parameter'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1216463004 .
2015-07-07 14:57:43 -07:00
Brian Wilkerson bdfc16a146 Hook for overriding the creation of a package resolver
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1214243005.
2015-07-06 13:06:33 -07:00
Konstantin Shcheglov 7e194d8fb5 Change navigation regions generation for constructors.
In IDEA we use navigation regions for resolution.
And so far all navigation regions are for separate identifiers.
This CL splits single regions like "new A.named()" into separate "A" and "named" regions.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1218183007.
2015-07-06 11:27:19 -07:00
Konstantin Shcheglov 0bb5179b84 Quick Assist for converting field formal parameters into normal parameters and initializers.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1217593006.
2015-07-06 11:19:30 -07:00
Brian Wilkerson dd9fa13157 More GetHandler clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1221703003.
2015-06-30 07:49:32 -07:00