Commit Graph

90 Commits

Author SHA1 Message Date
Konstantin Shcheglov 4366ff1afd Tests and fixes for resolveSymbolicLinksSync()
Change-Id: Ic4266f4ad1f46e405e22986e3660a3889ec7016c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 21:02:04 +00:00
Konstantin Shcheglov ab31c14841 Fixes for MemoryResourceProvider Folder.exists/getChildren() and links.
Bug: https://github.com/dart-lang/sdk/issues/44501
Change-Id: I60a79474111e56ebece3d9df3fe9281f6e3fcc06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186800
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 06:48:29 +00:00
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
Konstantin Shcheglov b4a09d8dec Catch exceptions from File.resolveSymbolicLinksSync()
Bug: https://buganizer.corp.google.com/issues/169040783
Bug: https://github.com/dart-lang/sdk/issues/43497
Change-Id: I5f4c1ffaec4af2d4d3855b9a99c3a78c36401ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-21 18:36:32 +00:00
Konstantin Shcheglov 044d3d5e22 Add MemoryResourceProvider.newLink()
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/43465
Change-Id: I56a33413cc297b1c362b92b60999e3b506d5e139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163264
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-17 22:40:01 +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 041e0dd618 Analyzer: Enforce strict-inference
Change-Id: Iba49bfa7cf10f8a3b1d3be03e73fdca280f0940a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155062
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-22 00:44:55 +00:00
Konstantin Shcheglov f2cbec8010 Check for unnecessary_parenthesis in analyzer.
R=brianwilkerson@google.com

Change-Id: I2e8af156a190b51741d60fdb0217101c15306a79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-08 21:46:16 +00:00
Sam Rawlins 6bf946bbfc analyzer: Always declare return types.
Change-Id: I23d89bb572310a1a8deef8e173630d9bb59c9a50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152708
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 23:54:28 +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
Parker Lougheed 2e89bcfc7d Fix prefer_conditional_assignment lint suggestions
This is a step towards moving towards the 1.9.0 version of pedantic which includes this lint.

Change-Id: I59a8d8d7a2c377a007cc08fdf7eef8c60203466d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148986
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-05-26 17:46:08 +00:00
Konstantin Shcheglov b344a111dc Remove extra await null in analyzer.
R=brianwilkerson@google.com

Change-Id: Idcc04115f618ae7dfcb58a2ab93df538d2b65873
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140887
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-25 15:59:12 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Konstantin Shcheglov eee20b4e60 Fix prefer_equal_for_default_values in analyzer.
Change-Id: Ia72a2ac31d6cf6329c78baad6954ac9595a6c45a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127448
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 00:00:30 +00:00
Todd Volkert 6aee4f390b Make analyzer's File.readAsBytesSync() impls return Uint8List
As part of the rollout plkan for https://github.com/dart-lang/sdk/issues/36900

Bug: dartbug.com/36900
Change-Id: Ic56cc1054ebae5967a1273b19f886a5e41b9460b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103060
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Todd Volkert <tvolkert@google.com>
2019-05-28 15:02:16 +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
Brian Wilkerson 469e1e2e64 Remove unnecessary library directives
Change-Id: I7a157080e4d7fd80d64489a13de4e996b5870930
Reviewed-on: https://dart-review.googlesource.com/c/79474
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 00:44:04 +00:00
Konstantin Shcheglov 85fb1f3de1 Fix Analyzer tests on Windows bot.
R=brianwilkerson@google.com

Change-Id: Ia43513d068a7676e8760efb87631cccd124b3c69
Reviewed-on: https://dart-review.googlesource.com/77265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:02:46 +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 f6d2c2378a Add awaits in async methods to restore previous semantics
Change-Id: I7711cd878a31df0fb0c92572e2256c0a26923640
Reviewed-on: https://dart-review.googlesource.com/59480
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-06-08 19:58:07 +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
Brian Wilkerson e2ee654cd1 Make a method in MempryResourceProvider private
Change-Id: Iae42ab38e3ae379fa015fbbd5c0341f6539996db
Reviewed-on: https://dart-review.googlesource.com/51060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-12 22:04:16 +00:00
Brian Wilkerson 602a8c2a7b Clean up usage of deprecated constants
Change-Id: I9005ba6e94529e15d8f7b21322591f4a9dabec47
Reviewed-on: https://dart-review.googlesource.com/45763
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-09 01:02:49 +00:00
Konstantin Shcheglov 50c964b819 Add option for AnalysisDriver to use KernelDriver and KernelResynthesizer.
Run NonErrorResolverTest_Driver tests with this option enabled.
We fail 163 out of 478 tests, or 35%.

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

Bug:
Change-Id: Iac6154a14a1357fe239b0140f9f66de792825693
Reviewed-on: https://dart-review.googlesource.com/6340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-18 02:09:14 +00: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
danrubel 4ca5ac929a fix MemoryResourceProvider context on Windows
On Windows, the MemoryResourceProvider.convertPath method
prefixes the path with the C: drive, but the context associated with
the MemoryResourceProvider has a drive letter based upon the underlying
current directory. Most of the time, these two drive letters are the
same, but sometimes, such as on the Windows bot, the current working
directory is on drive E:, rather than drive C:.
This causes package Uris to be mapped to drive E: rather than the
expected drive C:

This CL changes the MemoryResourceProvider constructor
to set the current working directory to C:\ when running on Windows
so that it aligns with MemoryResourceProvider.convertPath.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2714373002 .
2017-02-26 13:30:42 -08:00
danrubel 940fe975a8 Revert "debug MemoryResourceProvider on Windows"
This reverts commit a0ec77e383.

Review-Url: https://codereview.chromium.org/2716153002 .
2017-02-26 08:50:09 -08:00
danrubel a0ec77e383 debug MemoryResourceProvider on Windows
Review-Url: https://codereview.chromium.org/2719793002 .
2017-02-26 08:23:18 -08:00
Konstantin Shcheglov aaaeee5bc4 Make MemoryResourceProvider.convertPath() work with partially posix paths.
So that 'C:\some\path/to/file.dart' -> 'C:\some\path\to\file.dart'.

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

Review URL: https://codereview.chromium.org/2542793003 .
2016-12-01 08:39:44 -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
Brian Wilkerson cc7eeb9611 More test clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2402883002 .
2016-10-09 16:32:07 -07:00
Konstantin Shcheglov d4ebdabf43 MemoryResourceProvider.getFolder() should not create the folder.
But newFolder() should be used to create.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2396423002 .
2016-10-07 10:12:00 -07:00
Brian Wilkerson b83ca4f8dc Fix context comparisons
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2397813002 .
2016-10-05 09:57:53 -07:00
Brian Wilkerson db73915c77 More fixes for testing under windows
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2393663002 .
2016-10-04 13:11:57 -07:00
Brian Wilkerson 154bd389db Fix some failures on the windows bots
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2392793003 .
2016-10-04 08:21:28 -07:00
Brian Wilkerson 29c5c9985e Remove JavaFile.pathContext
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2386123004 .
2016-10-03 19:28:49 -07:00
Brian Wilkerson ef2a3b982c MemoryResourceProvider always uses the current platform
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2391883002 .
2016-10-03 19:24:21 -07:00
Brian Wilkerson 5bd4de469e Clean up warnings and hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2324463006 .
2016-09-09 09:09:59 -07:00
Paul Berry 94309733cd Revert "Remove unnecessary hide clauses"
The `Resource` class wasn't removed from the SDK until version
1.20.0-dev.0.0, which was only recently published.  Reverting this
change to allow people using older SDK releases a little more time to
upgrade.

This reverts commit 2cdafd82c2.

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

Review URL: https://codereview.chromium.org/2299243002 .
2016-09-01 16:08:43 -07:00
Brian Wilkerson 2cdafd82c2 Remove unnecessary hide clauses
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2305453002 .
2016-08-31 16:44:52 -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 910b2ba016 Convert resource providers to use FileSource
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2245133005 .
2016-08-16 20:10:59 -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 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