Commit Graph

52 Commits

Author SHA1 Message Date
Konstantin Shcheglov 51950ab881 Add Resource.parent2 that returns non-null Folder, add Folder.isRoot
A bigger version of than https://dart-review.googlesource.com/c/sdk/+/184381
This is breaking change, so we do this in steps.

Change-Id: I0c7212a073b605ade56657036543c604651810c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184581
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 19:09:20 +00:00
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Sam Rawlins 60323ebce9 Analyzer: Add nullability hints to memory_file_system
The migration tool thinks the various parameters are nullable otherwise.

Change-Id: Ie24cf73bfd32ed4d4bade36a9d4fda76e1ca991a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170481
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 11:41:44 +00:00
Mike Fairhurst 000f3135a5 [analyzer] Remove unused dart:async imports
Change-Id: If21c3a30f3bc521586ad01f8f9e241038e7aa7eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161448
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:14:22 +00:00
Konstantin Shcheglov f3936bca67 Add Resource.provider
R=brianwilkerson@google.com

Change-Id: I1d41d46f927e0ca804031a6fdf8148825695636e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158523
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-14 01:49:45 +00:00
Sam Rawlins 648b5e9c68 Use ///-style doc comments in analyzer/lib
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I573cb81dca6462c571bd6bf7bf309a46fd628967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152610
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 17:58:50 +00:00
Brian Wilkerson 68889c97ae Rework the file system tests so that most tests are shared
Change-Id: Ibeee593ebd3e240dca5ac86a50a3179d72c5ba61
Reviewed-on: https://dart-review.googlesource.com/c/86827
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-12-11 13:49:21 +00:00
Konstantin Shcheglov 9c585bf5df Document that ResourceProvider requires absolute, normalized paths, and enforce this.
This allows us to avoid performing normalization, and work with paths
as is. So, this speeds up SourceFactoryImpl.restoreUri() from 7.5% to 3.7%

R=brianwilkerson@google.com

Change-Id: I085f3db40af6543fbb524a82fad48aa051e87937
Reviewed-on: https://dart-review.googlesource.com/77017
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-28 17:18:49 +00:00
Brian Wilkerson 7054d92a02 Remove some classes from the analyzer public API
Change-Id: Ic53a8426818b06f44c2876abd16c789589bf78b5
Reviewed-on: https://dart-review.googlesource.com/52421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-24 15:28:15 +00:00
Konstantin Shcheglov 818c4b5bfd Remove AbsolutePathContext and use package:path instead.
I see however that linter/test/rule_test.dart uses it, but as far as I
can see, that's it. All other usages are from analyzer and
analysis_server.

R=brianwilkerson@google.com

Change-Id: I2b82870a4a4ec6f155326d8ee6dc1c1028f84793
Reviewed-on: https://dart-review.googlesource.com/52265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 21:01:06 +00:00
Devon Carew f6f845c879 Fix a completion exception during import suggestions.
BUG=
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2862793002 .
2017-05-04 09:24:18 -07:00
Brian Wilkerson f645c34bb0 Add support for copying directory structures
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2733053002 .
2017-03-06 08:51:40 -08:00
Konstantin Shcheglov 891e709c5f Add File.lengthSync to use it for FileByteStore eviction.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2490023003 .
2016-11-10 13:31:06 -08:00
Konstantin Shcheglov 8a3d8eee67 Add BazelWorkspace and move BazelFileUriResolver to it.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review URL: https://codereview.chromium.org/2393813003 .
2016-10-05 18:08:07 -07:00
Brian Wilkerson 6ccbef94fc Convert analysis server over to use ContextBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2286923002 .
2016-08-29 08:11:53 -07:00
Brian Wilkerson 3a6d80780b Add support for resolving symbolic links
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2270593003 .
2016-08-23 09:39:48 -07:00
Brian Wilkerson 17ffa1e9c0 Add writeAsStringSync (issue 27109)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2265593002 .
2016-08-19 12:17:13 -07:00
Brian Wilkerson c03b85d418 Add a toUri method to Resource
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2165843002 .
2016-07-20 08:53:03 -07:00
Konstantin Shcheglov ed887c09d1 Validate cache consistency asynchronously. Compute modification times of physical files in a separate isolate.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2132073003 .
2016-07-08 15:01:05 -07:00
Jaime Wren b7aff9c72f Initial Bazel file resolver support.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2079873002 .
2016-06-17 14:20:55 -07:00
Jaime Wren 7f244c8d39 Deprecate FileUriResolver and RelativeFileUriResolver in source_io.dart, replace the usages with ResourceUriResolver(PhysicalResourceProvider.INSTANCE).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2060263006 .
2016-06-16 11:14:03 -07:00
Konstantin Shcheglov d2e3078321 Add Resource.delete() method.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2067613002 .
2016-06-13 13:00:06 -07:00
Konstantin Shcheglov cb428694d3 Add Folder.getChildAssumingFile().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2058163002 .
2016-06-10 10:37:43 -07:00
Brian Wilkerson 24d23680d1 Use null-aware operators to clean up the code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1933763002 .
2016-04-29 08:48:12 -07:00
Konstantin Shcheglov 561f6f5bed Add File.renameSync() to virtual file system.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1808213004 .
2016-03-17 12:50:21 -07:00
Konstantin Shcheglov 45711829f6 Add File.readAsBytesSync/writeAsBytesSync() methods.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1811643002 .
2016-03-16 11:21:59 -07:00
pq 9ea17184ad Add @overrides to (a lot of) analyzer.
This gets us roughly half+ way there.  We should defintely consider automating this to speed up the rest.  (Even with the quick-fix it's VERY tedious and slow going.)

Once we've done this in bulk, I'd like to add the  `annotate_overrides` lint to analyzer and server `.analysis_options`.

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

Review URL: https://codereview.chromium.org/1749143003 .
2016-03-01 16:33:20 -08:00
Brian Wilkerson f0d249e269 Clean up package imports and library names
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1513643009 .
2015-12-10 08:11:56 -08:00
Brian Wilkerson 86216e5154 Consistently use implements when one interface inherits from another interface
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1481273002 .
2015-11-30 07:58:10 -08:00
Konstantin Shcheglov f464e2eddb Use AbsolutePathContext in Folder.contains().
This makes MDL analysis about 5% faster, from 5900 samples to 5600 samples.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1444943003 .
2015-11-15 09:33:16 -08:00
Paul Berry 8f2ed2c68d Fix most implementations of UriResolver.restoreAbsolute.
Although it wasn't previously clear in the documentation,
implementations of UriResolver.restoreAbsolute() should only depend on
Source.fullName.  To do otherwise breaks some assumptions made by
analysis server.  This CL fixes all implementations except
SdkExtUriResolver (which has been deferred to issue #24090).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1296653003 .
2015-08-18 11:32:15 -07:00
pq 587697ea02 Ensure actual URIs are properly processed.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1262213002 .
2015-07-29 13:16:15 -07:00
pq f013d3868c Actual URI support for package URI resolution.
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org//1245263002 .
2015-07-21 15:53:56 -07:00
pq 01af0560bb Package map source factory support [FIXED].
A rework of https://codereview.chromium.org/1206323005/ with better handling of the case where a .packages config file is not specified.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1223833008 .
2015-07-07 09:10:54 -07:00
pq bb196a27fc Revert "Package map source factory support."
This reverts commit e3a4ff55d7.

BUG=

Review URL: https://codereview.chromium.org//1228493003.
2015-07-06 11:45:32 -07:00
pq e3a4ff55d7 Package map source factory support.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1206323005.
2015-07-06 11:13:17 -07:00
Lasse R.H. Nielsen f8ce36df55 Add Resource class. Currently unimplemented.
R=herhut@google.com, iposva@google.com

Committed: https://github.com/dart-lang/sdk/commit/2890a7a2a94ff54c7c0050e69c40ca6a60a28474

Review URL: https://codereview.chromium.org//1181663002.
2015-06-26 11:42:02 +02:00
Dan Rubel f550b8d76e add file watching support
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1191933004.
2015-06-20 15:03:14 -04:00
brianwilkerson@google.com 0491a6ff6b More comment clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org//1021723008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44670 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-24 16:06:20 +00:00
scheglov@google.com 5432c74cd6 Add readAsStringSync() to File.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1007233002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44506 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-16 15:01:52 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//975453004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
paulberry@google.com 45b7294eff Don't do folder existence checks when parsing pub list results.
It's just a waste of time since we already to folder existence checks
when resolving package URI's.  Besides, all the folders output by pub
list should always exist except in pathological situations.

Improves total analysis time by about 2%.

R=danrubel@google.com

Review URL: https://codereview.chromium.org//952333002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44137 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 18:28:22 +00:00
scheglov@google.com 279bdb7ec0 Add File.modificationStamp accessor.
Dan, I noticed that you're using createSource().modification stamp to access this information.
So, we need a more direct way to get it.

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

Review URL: https://codereview.chromium.org//940313003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43968 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 18:40:09 +00:00
brianwilkerson@google.com 4468038300 Rework requests in execution domain
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//904733003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43556 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 15:49:44 +00:00
scheglov@google.com b8da9bc651 Format and sort analyzer and analysis_server packages.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//725143004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41792 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 22:23:53 +00:00
brianwilkerson@google.com 0a439dfc90 Add support for cross-session storage
R=paulberry@google.com

Review URL: https://codereview.chromium.org//632353002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40962 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 16:58:18 +00:00
paulberry@google.com 1fec496110 Use _provider.pathContext to convert URIs to files.
This should prevent unit tests from failing on Windows, since unit
tests use a Posix style path context.

TBR=scheglov@google.com

Review URL: https://codereview.chromium.org//461763002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39111 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 22:21:13 +00:00
paulberry@google.com 845775b081 Properly translate file: URIs to paths on Windows.
Uri.path returns the path component of the URI in raw form.  This
works on MacOS and Linux, but on Windows we need for drive letters to
be handled and for '/' to be converted to '\'.  To do this, we have to
use Uri.toFilePath(windows: ...).

This was preventing the index from being able to find source files,
which in turn prevented search.getTypeHierarchy from traversing
subclasses (since it finds subclasses using the index).

BUG=dartbug.com/20436
R=scheglov@google.com

Review URL: https://codereview.chromium.org//464583002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39105 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 21:02:05 +00:00
scheglov@google.com 4392cc42a0 Support for excluded files/folders.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//456893002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39046 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-08 19:42:07 +00:00
scheglov@google.com 8b247578f1 Add Folder.contains(path) and use it in ContextDirectoryManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//444193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38958 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 22:25:04 +00:00