Skip to content

Commit

Permalink
Version 3.2.0-55.0.dev
Browse files Browse the repository at this point in the history
Merge e5a16ae into dev
  • Loading branch information
Dart CI committed Aug 10, 2023
2 parents ff0c128 + e5a16ae commit b53d910
Show file tree
Hide file tree
Showing 82 changed files with 2,308 additions and 1,054 deletions.
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ vars = {
"mockito_rev": "ff79de69e9ef9e8647bd6008c29c16651c9ac220",
"native_rev": "5a1361b6d98a84f8070c97872e3d3587fc0ba435",
"package_config_rev": "981c49dfec1e3e3e90f336dcd7c225923d2fd321",
"path_rev": "282dd18bd9ae2e265ea40a29b2c637194e9be8b7",
"path_rev": "7c2324bdb4c75a17de8a3d1e6afe8cc0756ef5f9",
"pool_rev": "77001024a16126cc5718e654ea3e57bbf6e7fac3",
"protobuf_rev": "217c0306ee376a8a9c05e72fc90cffab6b60e66a",
"pub_rev": "42819a1e10f803eb7f6296692c5a976e1c647360", # disable rev_sdk_deps.dart
Expand All @@ -185,7 +185,7 @@ vars = {
"vector_math_rev": "88bada3c32ba3f1d53073a003085131d60b09213",
"watcher_rev": "7457413060ed7403b90b01533a61bd959932122e",
"web_socket_channel_rev": "4d1b5438d1bdfc6317bf99fd9d9c6e4edb7e9ec5",
"webdev_rev": "5081dff0952eb7163f98a508d7b2d976c1573c55", # https://github.com/dart-lang/webdev/issues/2172
"webdev_rev": "f8f752cb455935a7dfe626bcb357645c41749725",
"webdriver_rev": "d0f78d004a5ea7bfc8c492639248b0a1b04c1d62",
"webkit_inspection_protocol_rev": "39a3c297ff573635e7936b015ce4f3466e4739d6",
"yaml_rev": "7930148a3d03d7985ce2b53bc5eb2be9c878dab8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ mixin _CallHierarchyUtils on HandlerHelperMixin<AnalysisServer> {
displayName: item.name,
containerName: item.detail,
kind: fromSymbolKind(item.kind),
file: item.uri.toFilePath(),
file: pathContext.fromUri(item.uri),
nameRange: nameRange.result,
codeRange: codeRange.result,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class WorkspaceFoldersHandler
/// Return the result of converting the list of workspace [folders] to file
/// paths.
List<String> _convertWorkspaceFolders(List<WorkspaceFolder> folders) {
return folders.map((wf) => wf.uri.toFilePath()).toList();
return folders.map((wf) => pathContext.fromUri(wf.uri)).toList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class CompletionResolveHandler
// Compute the relative path and then put into a URI so the display
// always uses forward slashes (as a URI) regardless of platform.
? pathContext.toUri(pathContext.relative(
libraryUri.toFilePath(),
pathContext.fromUri(libraryUri),
from: pathContext.dirname(file),
))
: libraryUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class InitializeMessageHandler
// Only file URIs are supported, but there's no way to signal this to
// the LSP client (and certainly not before initialization).
if (uri.isScheme('file')) {
workspacePaths.add(uri.toFilePath());
workspacePaths.add(pathContext.fromUri(uri));
}
}
}
if (rootUri != null) {
if (rootUri.isScheme('file')) {
workspacePaths.add(rootUri.toFilePath());
workspacePaths.add(pathContext.fromUri(rootUri));
}
} else if (rootPath != null) {
workspacePaths.add(rootPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE:
Replace the `..` with `.`.
CompileTimeErrorCode.EXTENSION_OVERRIDE_WITHOUT_ACCESS:
status: noFix
CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER:
status: needsFix
notes: |-
Remove it.
CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION:
status: needsFix
notes: |-
Expand All @@ -648,6 +652,8 @@ CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT:
Offer to delete the invalid member.
CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE:
status: noFix
CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF:
status: noFix
CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT:
status: noFix
CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ class MoveTopLevelToFile extends RefactoringProducer {
return;
}
_initializeFromMembers(members);
var pathContext = refactoringContext.server.resourceProvider.pathContext;
var sourcePath = members.containingFile;
// TODO(dantup): Add refactor-specific validation for incoming arguments.
// Argument is a String URI.
var destinationUri = Uri.parse(commandArguments[0] as String);
var destinationFilePath = destinationUri.toFilePath();
var destinationFilePath = pathContext.fromUri(destinationUri);

var destinationImportUri =
unitResult.session.uriConverter.pathToUri(destinationFilePath);
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/analysis_server/test/integration/analysis/test_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import 'get_library_dependencies_test.dart' as get_library_dependencies_test;
import 'get_navigation_test.dart' as get_navigation_test;
import 'get_reachable_sources_test.dart' as get_reachable_sources_test;
import 'highlights_test.dart' as highlights_test;
import 'hint_sdk_version_async_exported_from_core_test.dart'
as hint_sdk_version_async_exported_from_core_test;
import 'lint_test.dart' as lint_test;
import 'navigation_test.dart' as navigation_test;
import 'occurrences_test.dart' as occurrences_test;
Expand Down Expand Up @@ -44,7 +42,6 @@ void main() {
get_navigation_test.main();
get_reachable_sources_test.main();
highlights_test.main();
hint_sdk_version_async_exported_from_core_test.main();
lint_test.main();
navigation_test.main();
occurrences_test.main();
Expand Down
10 changes: 6 additions & 4 deletions pkg/analysis_server/test/lsp/server_abstract.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ abstract class AbstractLspAnalysisServerTest
String? getCurrentFileContent(Uri uri) {
try {
return server.resourceProvider
.getFile(uri.toFilePath())
.getFile(pathContext.fromUri(uri))
.readAsStringSync();
} catch (_) {
return null;
Expand Down Expand Up @@ -1367,7 +1367,8 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin
return configurationParams.items.map(
(requestedConfig) {
final uri = requestedConfig.scopeUri;
final path = uri != null ? Uri.parse(uri).toFilePath() : null;
final path =
uri != null ? pathContext.fromUri(Uri.parse(uri)) : null;
// Use the config the test provided for this path, or fall back to
// global.
return (folders != null ? folders[path] : null) ?? global;
Expand Down Expand Up @@ -1472,7 +1473,7 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin
/// Formats a path relative to the project root always using forward slashes.
///
/// This is used in the text format for comparing edits.
String relativeUri(Uri uri) => relativePath(uri.toFilePath());
String relativeUri(Uri uri) => relativePath(pathContext.fromUri(uri));

Future<WorkspaceEdit?> rename(
Uri uri,
Expand Down Expand Up @@ -1574,7 +1575,8 @@ mixin LspAnalysisServerTestMixin on LspRequestHelpersMixin
.map((notification) => PublishDiagnosticsParams.fromJson(
notification.params as Map<String, Object?>))
.listen((diagnostics) {
latestDiagnostics[diagnostics.uri.toFilePath()] = diagnostics.diagnostics;
latestDiagnostics[pathContext.fromUri(diagnostics.uri)] =
diagnostics.diagnostics;
});
}

Expand Down
8 changes: 8 additions & 0 deletions pkg/analysis_server/test/lsp/server_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ class ServerTest extends AbstractLspAnalysisServerTest {
);
}

/// The LSP server relies on pathContext.fromUri() handling encoded colons
/// in paths, so verify that works as expected.
Future<void> test_pathContext_fromUri_windows() async {
expect(path.windows.fromUri('file:///C:/foo'), r'C:\foo');
expect(path.windows.fromUri('file:///C%3a/foo'), r'C:\foo');
expect(path.windows.fromUri('file:///C%3A/foo'), r'C:\foo');
}

Future<void> test_shutdown_initialized() async {
await initialize();
final response = await sendShutdown();
Expand Down
Loading

0 comments on commit b53d910

Please sign in to comment.