Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into Flutter-3.10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse authored Jul 13, 2023
2 parents 1ca855c + 9f72876 commit 01a2aba
Show file tree
Hide file tree
Showing 19 changed files with 746 additions and 1,410 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ to generate Dart code. To install, please run:
$ dart pub global activate protoc_plugin
```

## Initialise Flutter
## Initialize Flutter

The Flutter SDK needs to be downloaded and setup.

Expand Down
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ analyzer:
exclude:
- doc/generated/**
- flutter-sdks/**
# TODO(https://github.com/dart-lang/dart-pad/issues/1712): This seems to be
# hiding ~2 dozen legitimate analysis issues.
- lib/src/protos/**
- local_pub_cache/**
- project_templates/**
errors:
Expand Down
17 changes: 10 additions & 7 deletions lib/src/analysis_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,22 @@ abstract class AnalysisServerWrapper {
final issues = errors.map((error) {
final issue = proto.AnalysisIssue()
..kind = error.severity.toLowerCase()
..code = error.code.toLowerCase()
..line = error.location.startLine
..column = error.location.startColumn
..message = utils.normalizeFilePaths(error.message)
..sourceName = path.basename(error.location.file)
..hasFixes = error.hasFix ?? false
..charStart = error.location.offset
..charLength = error.location.length
..diagnosticMessages.addAll(error.contextMessages?.map((m) =>
proto.DiagnosticMessage(
message: utils.normalizeFilePaths(m.message),
line: m.location.startLine,
charStart: m.location.offset,
charLength: m.location.length)) ??
[]);
..diagnosticMessages.addAll(
error.contextMessages?.map((m) => proto.DiagnosticMessage()
..message = utils.normalizeFilePaths(m.message)
..line = m.location.startLine
..charStart = m.location.offset
..charLength = m.location.length) ??
[],
);

if (error.url != null) {
issue.url = error.url!;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/common_server_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class CommonServerImpl {
Future<proto.VersionResponse> version(proto.VersionRequest _) {
final packageVersions = getPackageVersions();
final packageInfos = [
for (var packageName in packageVersions.keys)
for (final packageName in packageVersions.keys)
proto.PackageInfo()
..name = packageName
..version = packageVersions[packageName]!
Expand Down
4 changes: 2 additions & 2 deletions lib/src/compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Compiler {
sourcesFileList: files.keys.toList(), devMode: _sdk.devMode);
if (unsupportedImports.isNotEmpty) {
return CompilationResults(problems: [
for (var import in unsupportedImports)
for (final import in unsupportedImports)
CompilationProblem._('unsupported import: ${import.uri.stringValue}'),
]);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ class Compiler {
sourcesFileList: files.keys.toList(), devMode: _sdk.devMode);
if (unsupportedImports.isNotEmpty) {
return DDCCompilationResults.failed([
for (var import in unsupportedImports)
for (final import in unsupportedImports)
CompilationProblem._('unsupported import: ${import.uri.stringValue}'),
]);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/project_creator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ProjectCreator {

final String _templatesPath;

/// The Dart Language Version to use for code using null safety.
/// The Dart language version to use.
final String _dartLanguageVersion;

final File _dependenciesFile;
Expand Down Expand Up @@ -180,7 +180,7 @@ ${_sdk.experiments.map((experiment) => ' - $experiment').join('\n')}
final allVersions =
parsePubDependenciesFile(dependenciesFile: _dependenciesFile);
final result = {
for (var package in packages) package: allVersions[package] ?? 'any',
for (final package in packages) package: allVersions[package] ?? 'any',
};

// Overwrite with important constraints.
Expand Down Expand Up @@ -220,7 +220,7 @@ String createPubspec({
var content = '''
name: dartpad_sample
environment:
sdk: $dartLanguageVersion
sdk: ^$dartLanguageVersion
dependencies:
''';

Expand Down
Loading

0 comments on commit 01a2aba

Please sign in to comment.