Dart analyzer has terminated, due to stack overflow error, when I want to format a file (With logs using dart.analyzerInstrumentationLogFile)

Steps to Reproduce

Open VSCode or Intellij IDEA (I have tried both)
Try to format a file (say main.dart)
Then VSCode reports "The Dart analyzer has terminated."
This happens even for a newly created empty Flutter project! (In the following logs, I show the crash for two unrelated projects) (e.g. you just create one by flutter create bug then open that folder)

Logs

Logs

[THIS IS THE LOG OF DART ANALYZER]

[9:37:32 PM] [General] [Info]         /usr/sbin
[9:37:32 PM] [General] [Info]         /sbin
[9:37:32 PM] [General] [Info]         /Applications/VMware Fusion.app/Contents/Public
[9:37:32 PM] [General] [Info]         /Applications/VMware Fusion.app/Contents/Public/bin
[9:37:32 PM] [General] [Info]         /Library/TeX/texbin
[9:37:32 PM] [General] [Info]         /Library/TeX/texbin/bin
[9:37:32 PM] [General] [Info]         /opt/X11/bin
[9:37:32 PM] [General] [Info]         /Library/Apple/usr/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk/bin
[9:37:32 PM] [General] [Info]         /Users/tom/.pub-cache/bin
[9:37:32 PM] [General] [Info]         /Users/tom/Library/Android/sdk/platform-tools/
[9:37:32 PM] [General] [Info]         /Users/tom/Library/Android/sdk/platform-tools/bin
[9:37:32 PM] [General] [Info]         /Users/tom/.cargo/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk/bin
[9:37:32 PM] [General] [Info]     Found at:
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk/bin
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk/bin
[9:37:32 PM] [General] [Info]     Candidate paths to be post-filtered:
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk
[9:37:32 PM] [General] [Info]         /Users/tom/opt/flutter/bin/cache/dart-sdk
[9:37:32 PM] [General] [Info]     Found at /Users/tom/opt/flutter/bin/cache/dart-sdk
[9:37:32 PM] [General] [Info]     Returning SDK path /Users/tom/opt/flutter/bin/cache/dart-sdk for dart
[9:37:32 PM] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

Dart Code extension: 3.18.0
Flutter extension: 3.18.0 (not activated)

App: Visual Studio Code
Version: 1.52.1
Platform: mac

Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false

Dart SDK:
    Loc: /Users/tom/opt/flutter/bin/cache/dart-sdk
    Ver: 2.10.4
Flutter SDK:
    Loc: /Users/tom/opt/flutter
    Ver: 1.22.5

HTTP_PROXY: undefined
NO_PROXY: <IP_ADDRESS>,localhost
[9:37:32 PM] [General] [Info] Experiment random number is 14 for experiement 'lsp-prompt'. Experiment is enabled for <= 40
[9:37:32 PM] [General] [Info] Experiment 'lsp-prompt' is activating (not first time)
[9:37:32 PM] [Analyzer] [Info] Spawning /Users/tom/opt/flutter/bin/cache/dart-sdk/bin/dart with args ["/Users/tom/opt/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot","--lsp","--client-id=VS-Code","--client-version=3.18.0"]
[9:37:32 PM] [Analyzer] [Info]     PID: 12644
[9:37:32 PM] [FlutterDaemon] [Info] Spawning /Users/tom/opt/flutter/bin/flutter with args ["daemon"]
[9:37:32 PM] [FlutterDaemon] [Info] ..  in /Users/tom/opt/flutter
[9:37:32 PM] [FlutterDaemon] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[9:37:32 PM] [FlutterDaemon] [Info]     PID: 12636
[9:37:32 PM] [FlutterDaemon] [Info] ==> [{"id":"1","method":"emulator.getEmulators"}]
[9:37:32 PM] [General] [Info] Activating Flutter extension for Flutter project...
[9:37:32 PM] [General] [Info] Extension:Startup timing: 94ms
[9:37:32 PM] [Analyzer] [Info] ==> Content-Length: 3122
[9:37:32 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":12636,"clientInfo":{"name":"vscode","version":"1.52.1"},"rootPath":"/Users/tom/QAPMain/Development/rzzsdxx_frontend/proj","rootUri":"file:///Users/tom/QAPMain/Development/rzzsdxx_frontend/proj","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"…
[9:37:32 PM] [General] [Info] Found 0 folders requiring "pub get":
[9:37:33 PM] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

 IntelliJ IDEA Ultimate Edition (version 2020.3)
    • IntelliJ at /Users/tom/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.0

[✓] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is <IP_ADDRESS>,localhost
    • NO_PROXY contains <IP_ADDRESS>
    • NO_PROXY contains localhost

[✓] Connected device (1 available)
    • iPhone SE (2nd generation) (mobile) • 41640072-3F6C-45F1-A766-86FFCF6BD773 • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)

! Doctor found issues in 1 category.

  PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

 PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

Logs using dart.analyzerInstrumentationLogFile

1609250047591:Ver:15901515637961052184122:VS-Code:3.18.0:1.29.0:2.10.0
1609250047692:Req:{"jsonrpc"::"2.0","id"::0,"method"::"initialize","params"::{"processId"::14768,"clientInfo"::{"name"::"vscode","version"::"1.52.1"},"rootPath"::"/Users/tom/temp/bug2","rootUri"::"file::///Users/tom/temp/bug2","capabilities"::{"workspace"::{"applyEdit"::true,"workspaceEdit"::{"documentChanges"::true,"resourceOperations"::["create","rename","delete"],"failureHandling"::"textOnlyTransactional"},"didChangeConfiguration"::{"dynamicRegistration"::true},"didChangeWatchedFiles"::{"dynamicRegistration"::true},"symbol"::{"dynamicRegistration"::true,"symbolKind"::{"valueSet"::[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand"::{"dynamicRegistration"::true},"configuration"::true,"workspaceFolders"::true},"textDocument"::{"publishDiagnostics"::{"relatedInformation"::true,"versionSupport"::false,"tagSupport"::{"valueSet"::[1,2]}},"synchronization"::{"dynamicRegistration"::true,"willSave"::true,"willSaveWaitUntil"::true,"didSave"::true},"completion"::{"dynamicRegistration"::true,"contextSupport"::true,"completionItem"::{"snippetSupport"::true,"commitCharactersSupport"::true,"documentationFormat"::["markdown","plaintext"],"deprecatedSupport"::true,"preselectSupport"::true,"tagSupport"::{"valueSet"::[1]}},"completionItemKind"::{"valueSet"::[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover"::{"dynamicRegistration"::true,"contentFormat"::["markdown","plaintext"]},"signatureHelp"::{"dynamicRegistration"::true,"signatureInformation"::{"documentationFormat"::["markdown","plaintext"],"parameterInformation"::{"labelOffsetSupport"::true}},"contextSupport"::true},"definition"::{"dynamicRegistration"::true,"linkSupport"::true},"references"::{"dynamicRegistration"::true},"documentHighlight"::{"dynamicRegistration"::true},"documentSymbol"::{"dynamicRegistration"::true,"symbolKind"::{"valueSet"::[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport"::true},"codeAction"::{"dynamicRegistration"::true,"isPreferredSupport"::true,"codeActionLiteralSupport"::{"codeActionKind"::{"valueSet"::["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens"::{"dynamicRegistration"::true},"formatting"::{"dynamicRegistration"::true},"rangeFormatting"::{"dynamicRegistration"::true},"onTypeFormatting"::{"dynamicRegistration"::true},"rename"::{"dynamicRegistration"::true,"prepareSupport"::true},"documentLink"::{"dynamicRegistration"::true,"tooltipSupport"::true},"typeDefinition"::{"dynamicRegistration"::true,"linkSupport"::true},"implementation"::{"dynamicRegistration"::true,"linkSupport"::true},"colorProvider"::{"dynamicRegistration"::true},"foldingRange"::{"dynamicRegistration"::true,"rangeLimit"::5000,"lineFoldingOnly"::true},"declaration"::{"dynamicRegistration"::true,"linkSupport"::true},"selectionRange"::{"dynamicRegistration"::true}},"window"::{"workDoneProgress"::true}},"initializationOptions"::{"closingLabels"::true,"flutterOutline"::true,"outline"::true},"trace"::"off","workspaceFolders"::[{"uri"::"file::///Users/tom/temp/bug2","name"::"bug2"}]}}
1609250047750:Res:{"id"::0,"jsonrpc"::"2.0","result"::{"capabilities"::{"executeCommandProvider"::{"commands"::["edit.sortMembers","edit.organizeImports","edit.sendWorkspaceEdit","refactor.perform"]},"workspaceSymbolProvider"::true,"workspace"::{"workspaceFolders"::{"supported"::true,"changeNotifications"::true}}},"serverInfo"::{"name"::"Dart SDK LSP Analysis Server","version"::"2.10.4"}}}
1609250047752:Req:{"jsonrpc"::"2.0","method"::"initialized","params"::{}}
1609250047763:Res:{"id"::1,"method"::"workspace/configuration","params"::{"items"::[{"section"::"dart"}]},"jsonrpc"::"2.0"}
1609250047768:Req:{"jsonrpc"::"2.0","id"::1,"result"::[{"additionalAnalyzerFileExtensions"::[],"allowTestsOutsideTestFolder"::false,"enableSdkFormatter"::true,"enableSnippets"::true,"env"::{},"closingLabels"::true,"analysisServerFolding"::true,"analysisExcludedFolders"::[],"flutterCustomEmulators"::[],"debugSdkLibraries"::false,"debugExternalLibraries"::false,"showDartDeveloperLogs"::true,"flutterStructuredErrors"::true,"enableCompletionCommitCharacters"::false,"previewCommitCharacters"::false,"triggerSignatureHelpAutomatically"::false,"flutterAdbConnectOnChromeOs"::false,"flutterTrackWidgetCreation"::true,"flutterAdditionalArgs"::[],"flutterAttachAdditionalArgs"::[],"flutterRunAdditionalArgs"::[],"flutterTestAdditionalArgs"::[],"hotReloadProgress"::"notification","evaluateGettersInDebugViews"::true,"sdkPath"::null,"sdkPaths"::[],"debugExtensionBackendProtocol"::"ws","devToolsTheme"::"dark","devToolsBrowser"::"chrome","showDevToolsDebugToolBarButtons"::true,"doNotFormat"::[],"lineLength"::80,"maxLogLineLength"::2000,"insertArgumentPlaceholders"::true,"completeFunctionCalls"::true,"showMainCodeLens"::true,"showTestCodeLens"::true,"showDartPadSampleCodeLens"::true,"showTodos"::true,"openTestView"::["testRunStart"],"notifyAnalyzerErrors"::true,"allowAnalytics"::true,"checkForSdkUpdates"::true,"pubAdditionalArgs"::[],"runPubGetOnPubspecChanges"::true,"promptToGetPackages"::true,"flutterScreenshotPath"::null,"flutterSdkPath"::null,"flutterSdkPaths"::[],"flutterHotReloadOnSave"::true,"flutterHotRestartOnSave"::true,"flutterCreateOffline"::false,"flutterCreateOrganization"::null,"flutterCreateIOSLanguage"::"swift","flutterCreateAndroidLanguage"::"kotlin","analyzeAngularTemplates"::true,"flutterOutline"::true,"flutterWebRenderer"::"auto","analyzerAdditionalArgs"::[],"analyzerDiagnosticsPort"::null,"analyzerInstrumentationLogFile"::"/Users/tom/temp/hello_analyzerInstrumentationLogFile.txt","analyzerSshHost"::null,"extensionLogFile"::null,"devToolsLogFile"::null,"analyzerLogFile"::null,"analyzerVmServicePort"::null,"analyzerPath"::null,"devToolsPort"::null,"devToolsReuseWindows"::true,"openDevTools"::"never","flutterDaemonLogFile"::null,"flutterRunLogFile"::null,"flutterTestLogFile"::null,"pubTestLogFile"::null,"vmServiceLogFile"::null,"useKnownChromeOSPorts"::true,"webDaemonLogFile"::null,"vmAdditionalArgs"::[],"buildRunnerAdditionalArgs"::[],"flutterSelectDeviceWhenConnected"::true,"warnWhenEditingFilesOutsideWorkspace"::true,"warnWhenEditingFilesInPubCache"::true,"showIgnoreQuickFixes"::true,"embedDevTools"::true,"updateImportsOnRename"::true,"flutterGutterIcons"::true,"previewFlutterUiGuides"::false,"previewFlutterUiGuidesCustomTracking"::false,"evaluateToStringInDebugViews"::true,"previewHotReloadOnSaveWatcher"::false,"previewLsp"::true,"autoImportCompletions"::true,"promptToRunIfErrors"::true,"previewBazelWorkspaceCustomScripts"::false}]}
1609250047783:Res:{"id"::2,"method"::"client/registerCapability","params"::{"registrations"::[{"id"::"0","method"::"textDocument/didOpen","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","scheme"::"file","pattern"::"**/pubspec.yaml"},{"language"::"yaml","scheme"::"file","pattern"::"**/analysis_options.yaml"}]}},{"id"::"1","method"::"textDocument/didClose","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","scheme"::"file","pattern"::"**/pubspec.yaml"},{"language"::"yaml","scheme"::"file","pattern"::"**/analysis_options.yaml"}]}},{"id"::"2","method"::"textDocument/didChange","registerOptions"::{"syncKind"::2,"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","scheme"::"file","pattern"::"**/pubspec.yaml"},{"language"::"yaml","scheme"::"file","pattern"::"**/analysis_options.yaml"}]}},{"id"::"3","method"::"textDocument/completion","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"triggerCharacters"::[".","=","(","$"],"resolveProvider"::true}},{"id"::"4","method"::"textDocument/hover","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"5","method"::"textDocument/signatureHelp","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"triggerCharacters"::["("],"retriggerCharacters"::[","]}},{"id"::"6","method"::"textDocument/references","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"7","method"::"textDocument/documentHighlight","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"8","method"::"textDocument/documentSymbol","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"9","method"::"textDocument/formatting","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"10","method"::"textDocument/onTypeFormatting","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"firstTriggerCharacter"::"}","moreTriggerCharacter"::[";"]}},{"id"::"11","method"::"textDocument/definition","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"12","method"::"textDocument/implementation","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"13","method"::"textDocument/codeAction","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"codeActionKinds"::["source","source.organizeImports","source.sortMembers","quickfix"]}},{"id"::"14","method"::"textDocument/rename","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"prepareProvider"::true}},{"id"::"15","method"::"textDocument/foldingRange","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"16","method"::"workspace/didChangeConfiguration"}]},"jsonrpc"::"2.0"}
1609250048016:Res:{"method"::"textDocument/publishDiagnostics","params"::{"uri"::"file::///Users/tom/temp/bug2/pubspec.yaml","diagnostics"::[]},"jsonrpc"::"2.0"}
1609250048020:Res:{"method"::"textDocument/publishDiagnostics","params"::{"uri"::"file::///Users/tom/temp/bug2/android/app/src/profile/AndroidManifest.xml","diagnostics"::[]},"jsonrpc"::"2.0"}
1609250048023:Res:{"method"::"textDocument/publishDiagnostics","params"::{"uri"::"file::///Users/tom/temp/bug2/android/app/src/main/AndroidManifest.xml","diagnostics"::[]},"jsonrpc"::"2.0"}
1609250048025:Res:{"method"::"textDocument/publishDiagnostics","params"::{"uri"::"file::///Users/tom/temp/bug2/android/app/src/debug/AndroidManifest.xml","diagnostics"::[]},"jsonrpc"::"2.0"}
1609250048359:Res:{"method"::"$/analyzerStatus","params"::{"isAnalyzing"::true},"jsonrpc"::"2.0"}
1609250048367:Req:{"jsonrpc"::"2.0","method"::"textDocument/didOpen","params"::{"textDocument"::{"uri"::"file::///Users/tom/temp/bug2/lib/main.dart","languageId"::"dart","version"::1,"text"::"import 'package::flutter/material.dart';\n\nvoid main() {\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  // This widget is the root of your application.\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title:: 'Flutter Demo',\n      theme:: ThemeData(\n        // This is the theme of your application.\n        //\n        // Try running your application with \"flutter run\". You'll see the\n        // application has a blue toolbar. Then, without quitting the app, try\n        // changing the primarySwatch below to Colors.green and then invoke\n        // \"hot reload\" (press \"r\" in the console where you ran \"flutter run\",\n        // or simply save your changes to \"hot reload\" in a Flutter IDE).\n        // Notice that the counter didn't reset back to zero; the application\n        // is not restarted.\n        primarySwatch:: Colors.blue,\n        // This makes the visual density adapt to the platform that you run\n        // the app on. For desktop platforms, the controls will be smaller and\n        // closer together (more dense) than on mobile platforms.\n        visualDensity:: VisualDensity.adaptivePlatformDensity,\n      ),\n      home:: MyHomePage(title:: 'Flutter Demo Home Page'),\n    );\n  }\n}\n\nclass MyHomePage extends StatefulWidget {\n  MyHomePage({Key key, this.title}) :: super(key:: key);\n\n  // This widget is the home page of your application. It is stateful, meaning\n  // that it has a State object (defined below) that contains fields that affect\n  // how it looks.\n\n  // This class is the configuration for the state. It holds the values (in this\n  // case the title) provided by the parent (in this case the App widget) and\n  // used by the build method of the State. Fields in a Widget subclass are\n  // always marked \"final\".\n\n  final String title;\n\n  @override\n  _MyHomePageState createState() => _MyHomePageState();\n}\n\nclass _MyHomePageState extends State<MyHomePage> {\n  int _counter = 0;\n\n  void _incrementCounter() {\n    setState(() {\n      // This call to setState tells the Flutter framework that something has\n      // changed in this State, which causes it to rerun the build method below\n      // so that the display can reflect the updated values. If we changed\n      // _counter without calling setState(), then the build method would not be\n      // called again, and so nothing would appear to happen.\n      _counter++;\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    a = 1;\n    b = 2;\n    // This method is rerun every time setState is called, for instance as done\n    // by the _incrementCounter method above.\n    //\n    // The Flutter framework has been optimized to make rerunning build methods\n    // fast, so that you can just rebuild anything that needs updating rather\n    // than having to individually change instances of widgets.\n    return Scaffold(\n      appBar:: AppBar(\n        // Here we take the value from the MyHomePage object that was created by\n        // the App.build method, and use it to set our appbar title.\n        title:: Text(widget.title),\n      ),\n      body:: Center(\n        // Center is a layout widget. It takes a single child and positions it\n        // in the middle of the parent.\n        child:: Column(\n          // Column is also a layout widget. It takes a list of children and\n          // arranges them vertically. By default, it sizes itself to fit its\n          // children horizontally, and tries to be as tall as its parent.\n          //\n          // Invoke \"debug painting\" (press \"p\" in the console, choose the\n          // \"Toggle Debug Paint\" action from the Flutter Inspector in Android\n          // Studio, or the \"Toggle Debug Paint\" command in Visual Studio Code)\n          // to see the wireframe for each widget.\n          //\n          // Column has various properties to control how it sizes itself and\n          // how it positions its children. Here we use mainAxisAlignment to\n          // center the children vertically; the main axis here is the vertical\n          // axis because Columns are vertical (the cross axis would be\n          // horizontal).\n          mainAxisAlignment:: MainAxisAlignment.center,\n          children:: <Widget>[\n            Text(\n              'You have pushed the button this many times::',\n            ),\n            Text(\n              '$_counter',\n              style:: Theme.of(context).textTheme.headline4,\n            ),\n          ],\n        ),\n      ),\n      floatingActionButton:: FloatingActionButton(\n        onPressed:: _incrementCounter,\n        tooltip:: 'Increment',\n        child:: Icon(Icons.add),\n      ), // This trailing comma makes auto-formatting nicer for build methods.\n    );\n  }\n}\n"}}}
1609250048402:Req:{"jsonrpc"::"2.0","id"::2,"result"::null}
1609250050242:Res:{"method"::"textDocument/publishDiagnostics","params"::{"uri"::"file::///Users/tom/temp/bug2/lib/main.dart","diagnostics"::[{"range"::{"start"::{"line"::67,"character"::4},"end"::{"line"::67,"character"::5}},"severity"::1,"code"::"undefined_identifier","source"::"dart","message"::"Undefined name 'a'.\nTry correcting the name to one that is defined, or defining the name."},{"range"::{"start"::{"line"::68,"character"::4},"end"::{"line"::68,"character"::5}},"severity"::1,"code"::"undefined_identifier","source"::"dart","message"::"Undefined name 'b'.\nTry correcting the name to one that is defined, or defining the name."}]},"jsonrpc"::"2.0"}
1609250050249:Res:{"method"::"dart/textDocument/publishClosingLabels","params"::{"uri"::"file::///Users/tom/temp/bug2/lib/main.dart","labels"::[{"range"::{"start"::{"line"::10,"character"::11},"end"::{"line"::29,"character"::5}},"label"::"MaterialApp"},{"range"::{"start"::{"line"::12,"character"::13},"end"::{"line"::27,"character"::7}},"label"::"ThemeData"},{"range"::{"start"::{"line"::75,"character"::11},"end"::{"line"::116,"character"::5}},"label"::"Scaffold"},{"range"::{"start"::{"line"::76,"character"::14},"end"::{"line"::80,"character"::7}},"label"::"AppBar"},{"range"::{"start"::{"line"::81,"character"::12},"end"::{"line"::110,"character"::7}},"label"::"Center"},{"range"::{"start"::{"line"::84,"character"::15},"end"::{"line"::109,"character"::9}},"label"::"Column"},{"range"::{"start"::{"line"::100,"character"::20},"end"::{"line"::108,"character"::11}},"label"::"<Widget>[]"},{"range"::{"start"::{"line"::101,"character"::12},"end"::{"line"::103,"character"::13}},"label"::"Text"},{"range"::{"start"::{"line"::104,"character"::12},"end"::{"line"::107,"character"::13}},"label"::"Text"},{"range"::{"start"::{"line"::111,"character"::28},"end"::{"line"::115,"character"::7}},"label"::"FloatingActionButton"}]},"jsonrpc"::"2.0"}
1609250050267:Res:{"method"::"dart/textDocument/publishOutline","params"::{"uri"::"file::///Users/tom/temp/bug2/lib/main.dart","outline"::{"element"::{"range"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"name"::"<unit>","kind"::"COMPILATION_UNIT"},"range"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"codeRange"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"children"::[{"element"::{"range"::{"start"::{"line"::2,"character"::5},"end"::{"line"::2,"character"::9}},"name"::"main","kind"::"FUNCTION","parameters"::"()","returnType"::"void"},"range"::{"start"::{"line"::2,"character"::0},"end"::{"line"::4,"character"::1}},"codeRange"::{"start"::{"line"::2,"character"::0},"end"::{"line"::4,"character"::1}},"children"::[{"element"::{"range"::{"start"::{"line"::3,"character"::9},"end"::{"line"::3,"character"::9}},"name"::"MyApp","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::3,"character"::9},"end"::{"line"::3,"character"::16}},"codeRange"::{"start"::{"line"::3,"character"::9},"end"::{"line"::3,"character"::16}}}]},{"element"::{"range"::{"start"::{"line"::6,"character"::6},"end"::{"line"::6,"character"::11}},"name"::"MyApp","kind"::"CLASS"},"range"::{"start"::{"line"::6,"character"::0},"end"::{"line"::31,"character"::1}},"codeRange"::{"start"::{"line"::6,"character"::0},"end"::{"line"::31,"character"::1}},"children"::[{"element"::{"range"::{"start"::{"line"::9,"character"::9},"end"::{"line"::9,"character"::14}},"name"::"build","kind"::"METHOD","parameters"::"(BuildContext context)","returnType"::"Widget"},"range"::{"start"::{"line"::8,"character"::2},"end"::{"line"::30,"character"::3}},"codeRange"::{"start"::{"line"::9,"character"::2},"end"::{"line"::30,"character"::3}},"children"::[{"element"::{"range"::{"start"::{"line"::10,"character"::11},"end"::{"line"::10,"character"::11}},"name"::"MaterialApp","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::10,"character"::11},"end"::{"line"::29,"character"::5}},"codeRange"::{"start"::{"line"::10,"character"::11},"end"::{"line"::29,"character"::5}},"children"::[{"element"::{"range"::{"start"::{"line"::28,"character"::12},"end"::{"line"::28,"character"::12}},"name"::"MyHomePage","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::28,"character"::12},"end"::{"line"::28,"character"::55}},"codeRange"::{"start"::{"line"::28,"character"::12},"end"::{"line"::28,"character"::55}}}]}]}]},{"element"::{"range"::{"start"::{"line"::33,"character"::6},"end"::{"line"::33,"character"::16}},"name"::"MyHomePage","kind"::"CLASS"},"range"::{"start"::{"line"::33,"character"::0},"end"::{"line"::49,"character"::1}},"codeRange"::{"start"::{"line"::33,"character"::0},"end"::{"line"::49,"character"::1}},"children"::[{"element"::{"range"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::12}},"name"::"MyHomePage","kind"::"CONSTRUCTOR","parameters"::"({Key key, this.title})"},"range"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::54}},"codeRange"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::54}}},{"element"::{"range"::{"start"::{"line"::45,"character"::15},"end"::{"line"::45,"character"::20}},"name"::"title","kind"::"FIELD","returnType"::"String"},"range"::{"start"::{"line"::45,"character"::2},"end"::{"line"::45,"character"::21}},"codeRange"::{"start"::{"line"::45,"character"::15},"end"::{"line"::45,"character"::20}}},{"element"::{"range"::{"start"::{"line"::48,"character"::19},"end"::{"line"::48,"character"::30}},"name"::"createState","kind"::"METHOD","parameters"::"()","returnType"::"_MyHomePageState"},"range"::{"start"::{"line"::47,"character"::2},"end"::{"line"::48,"character"::55}},"codeRange"::{"start"::{"line"::48,"character"::2},"end"::{"line"::48,"character"::55}}}]},{"element"::{"range"::{"start"::{"line"::51,"character"::6},"end"::{"line"::51,"character"::22}},"name"::"_MyHomePageState","kind"::"CLASS"},"range"::{"start"::{"line"::51,"character"::0},"end"::{"line"::118,"character"::1}},"codeRange"::{"start"::{"line"::51,"character"::0},"end"::{"line"::118,"character"::1}},"children"::[{"element"::{"range"::{"start"::{"line"::52,"character"::6},"end"::{"line"::52,"character"::14}},"name"::"_counter","kind"::"FIELD","returnType"::"int"},"range"::{"start"::{"line"::52,"character"::2},"end"::{"line"::52,"character"::19}},"codeRange"::{"start"::{"line"::52,"character"::6},"end"::{"line"::52,"character"::18}}},{"element"::{"range"::{"start"::{"line"::54,"character"::7},"end"::{"line"::54,"character"::24}},"name"::"_incrementCounter","kind"::"METHOD","parameters"::"()","returnType"::"void"},"range"::{"start"::{"line"::54,"character"::2},"end"::{"line"::63,"character"::3}},"codeRange"::{"start"::{"line"::54,"character"::2},"end"::{"line"::63,"character"::3}}},{"element"::{"range"::{"start"::{"line"::66,"character"::9},"end"::{"line"::66,"character"::14}},"name"::"build","kind"::"METHOD","parameters"::"(BuildContext context)","returnType"::"Widget"},"range"::{"start"::{"line"::65,"character"::2},"end"::{"line"::117,"character"::3}},"codeRange"::{"start"::{"line"::66,"character"::2},"end"::{"line"::117,"character"::3}},"children"::[{"element"::{"range"::{"start"::{"line"::75,"character"::11},"end"::{"line"::75,"character"::11}},"name"::"Scaffold","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::75,"character"::11},"end"::{"line"::116,"character"::5}},"codeRange"::{"start"::{"line"::75,"character"::11},"end"::{"line"::116,"character"::5}},"children"::[{"element"::{"range"::{"start"::{"line"::76,"character"::14},"end"::{"line"::76,"character"::14}},"name"::"AppBar","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::76,"character"::14},"end"::{"line"::80,"character"::7}},"codeRange"::{"start"::{"line"::76,"character"::14},"end"::{"line"::80,"character"::7}},"children"::[{"element"::{"range"::{"start"::{"line"::79,"character"::15},"end"::{"line"::79,"character"::15}},"name"::"Text(widget.title)","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::79,"character"::15},"end"::{"line"::79,"character"::33}},"codeRange"::{"start"::{"line"::79,"character"::15},"end"::{"line"::79,"character"::33}}}]},{"element"::{"range"::{"start"::{"line"::81,"character"::12},"end"::{"line"::81,"character"::12}},"name"::"Center","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::81,"character"::12},"end"::{"line"::110,"character"::7}},"codeRange"::{"start"::{"line"::81,"character"::12},"end"::{"line"::110,"character"::7}},"children"::[{"element"::{"range"::{"start"::{"line"::84,"character"::15},"end"::{"line"::84,"character"::15}},"name"::"Column","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::84,"character"::15},"end"::{"line"::109,"character"::9}},"codeRange"::{"start"::{"line"::84,"character"::15},"end"::{"line"::109,"character"::9}},"children"::[{"element"::{"range"::{"start"::{"line"::101,"character"::12},"end"::{"line"::101,"character"::12}},"name"::"Text('You have pushe...s many times::')","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::101,"character"::12},"end"::{"line"::103,"character"::13}},"codeRange"::{"start"::{"line"::101,"character"::12},"end"::{"line"::103,"character"::13}}},{"element"::{"range"::{"start"::{"line"::104,"character"::12},"end"::{"line"::104,"character"::12}},"name"::"Text('$_counter')","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::104,"character"::12},"end"::{"line"::107,"character"::13}},"codeRange"::{"start"::{"line"::104,"character"::12},"end"::{"line"::107,"character"::13}}}]}]},{"element"::{"range"::{"start"::{"line"::111,"character"::28},"end"::{"line"::111,"character"::28}},"name"::"FloatingActionButton","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::111,"character"::28},"end"::{"line"::115,"character"::7}},"codeRange"::{"start"::{"line"::111,"character"::28},"end"::{"line"::115,"character"::7}},"children"::[{"element"::{"range"::{"start"::{"line"::114,"character"::15},"end"::{"line"::114,"character"::15}},"name"::"Icon(Icons.add)","kind"::"CONSTRUCTOR_INVOCATION"},"range"::{"start"::{"line"::114,"character"::15},"end"::{"line"::114,"character"::30}},"codeRange"::{"start"::{"line"::114,"character"::15},"end"::{"line"::114,"character"::30}}}]}]}]}]}]}},"jsonrpc"::"2.0"}
1609250050287:Res:{"method"::"dart/textDocument/publishFlutterOutline","params"::{"uri"::"file::///Users/tom/temp/bug2/lib/main.dart","outline"::{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"name"::"<unit>","kind"::"COMPILATION_UNIT"},"range"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"codeRange"::{"start"::{"line"::0,"character"::0},"end"::{"line"::119,"character"::0}},"children"::[{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::2,"character"::5},"end"::{"line"::2,"character"::9}},"name"::"main","kind"::"FUNCTION","parameters"::"()","returnType"::"void"},"range"::{"start"::{"line"::2,"character"::0},"end"::{"line"::4,"character"::1}},"codeRange"::{"start"::{"line"::2,"character"::0},"end"::{"line"::4,"character"::1}},"children"::[{"kind"::"NEW_INSTANCE","className"::"MyApp","attributes"::[],"range"::{"start"::{"line"::3,"character"::9},"end"::{"line"::3,"character"::16}},"codeRange"::{"start"::{"line"::3,"character"::9},"end"::{"line"::3,"character"::16}},"children"::[]}]},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::6,"character"::6},"end"::{"line"::6,"character"::11}},"name"::"MyApp","kind"::"CLASS"},"range"::{"start"::{"line"::6,"character"::0},"end"::{"line"::31,"character"::1}},"codeRange"::{"start"::{"line"::6,"character"::0},"end"::{"line"::31,"character"::1}},"children"::[{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::9,"character"::9},"end"::{"line"::9,"character"::14}},"name"::"build","kind"::"METHOD","parameters"::"(BuildContext context)","returnType"::"Widget"},"range"::{"start"::{"line"::8,"character"::2},"end"::{"line"::30,"character"::3}},"codeRange"::{"start"::{"line"::9,"character"::2},"end"::{"line"::30,"character"::3}},"children"::[{"kind"::"NEW_INSTANCE","className"::"MaterialApp","attributes"::[{"name"::"title","label"::"'Flutter Demo'","valueRange"::{"start"::{"line"::11,"character"::13},"end"::{"line"::11,"character"::27}}},{"name"::"theme","label"::"…","valueRange"::{"start"::{"line"::12,"character"::13},"end"::{"line"::27,"character"::7}}}],"range"::{"start"::{"line"::10,"character"::11},"end"::{"line"::29,"character"::5}},"codeRange"::{"start"::{"line"::10,"character"::11},"end"::{"line"::29,"character"::5}},"children"::[{"kind"::"NEW_INSTANCE","className"::"MyHomePage","attributes"::[{"name"::"title","label"::"'Flutter Demo Home Page'","valueRange"::{"start"::{"line"::28,"character"::30},"end"::{"line"::28,"character"::54}}}],"range"::{"start"::{"line"::28,"character"::12},"end"::{"line"::28,"character"::55}},"codeRange"::{"start"::{"line"::28,"character"::12},"end"::{"line"::28,"character"::55}},"children"::[]}]}]}]},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::33,"character"::6},"end"::{"line"::33,"character"::16}},"name"::"MyHomePage","kind"::"CLASS"},"range"::{"start"::{"line"::33,"character"::0},"end"::{"line"::49,"character"::1}},"codeRange"::{"start"::{"line"::33,"character"::0},"end"::{"line"::49,"character"::1}},"children"::[{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::12}},"name"::"MyHomePage","kind"::"CONSTRUCTOR","parameters"::"({Key key, this.title})"},"range"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::54}},"codeRange"::{"start"::{"line"::34,"character"::2},"end"::{"line"::34,"character"::54}}},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::45,"character"::15},"end"::{"line"::45,"character"::20}},"name"::"title","kind"::"FIELD","returnType"::"String"},"range"::{"start"::{"line"::45,"character"::2},"end"::{"line"::45,"character"::21}},"codeRange"::{"start"::{"line"::45,"character"::15},"end"::{"line"::45,"character"::20}}},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::48,"character"::19},"end"::{"line"::48,"character"::30}},"name"::"createState","kind"::"METHOD","parameters"::"()","returnType"::"_MyHomePageState"},"range"::{"start"::{"line"::47,"character"::2},"end"::{"line"::48,"character"::55}},"codeRange"::{"start"::{"line"::48,"character"::2},"end"::{"line"::48,"character"::55}}}]},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::51,"character"::6},"end"::{"line"::51,"character"::22}},"name"::"_MyHomePageState","kind"::"CLASS"},"range"::{"start"::{"line"::51,"character"::0},"end"::{"line"::118,"character"::1}},"codeRange"::{"start"::{"line"::51,"character"::0},"end"::{"line"::118,"character"::1}},"children"::[{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::52,"character"::6},"end"::{"line"::52,"character"::14}},"name"::"_counter","kind"::"FIELD","returnType"::"int"},"range"::{"start"::{"line"::52,"character"::2},"end"::{"line"::52,"character"::19}},"codeRange"::{"start"::{"line"::52,"character"::6},"end"::{"line"::52,"character"::18}}},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::54,"character"::7},"end"::{"line"::54,"character"::24}},"name"::"_incrementCounter","kind"::"METHOD","parameters"::"()","returnType"::"void"},"range"::{"start"::{"line"::54,"character"::2},"end"::{"line"::63,"character"::3}},"codeRange"::{"start"::{"line"::54,"character"::2},"end"::{"line"::63,"character"::3}}},{"kind"::"DART_ELEMENT","dartElement"::{"range"::{"start"::{"line"::66,"character"::9},"end"::{"line"::66,"character"::14}},"name"::"build","kind"::"METHOD","parameters"::"(BuildContext context)","returnType"::"Widget"},"range"::{"start"::{"line"::65,"character"::2},"end"::{"line"::117,"character"::3}},"codeRange"::{"start"::{"line"::66,"character"::2},"end"::{"line"::117,"character"::3}},"children"::[{"kind"::"NEW_INSTANCE","className"::"Scaffold","attributes"::[],"range"::{"start"::{"line"::75,"character"::11},"end"::{"line"::116,"character"::5}},"codeRange"::{"start"::{"line"::75,"character"::11},"end"::{"line"::116,"character"::5}},"children"::[{"kind"::"NEW_INSTANCE","className"::"AppBar","attributes"::[],"range"::{"start"::{"line"::76,"character"::14},"end"::{"line"::80,"character"::7}},"codeRange"::{"start"::{"line"::76,"character"::14},"end"::{"line"::80,"character"::7}},"children"::[{"kind"::"NEW_INSTANCE","className"::"Text","attributes"::[{"name"::"data","label"::"widget.title","valueRange"::{"start"::{"line"::79,"character"::20},"end"::{"line"::79,"character"::32}}}],"range"::{"start"::{"line"::79,"character"::15},"end"::{"line"::79,"character"::33}},"codeRange"::{"start"::{"line"::79,"character"::15},"end"::{"line"::79,"character"::33}},"children"::[]}]},{"kind"::"NEW_INSTANCE","className"::"Center","attributes"::[],"range"::{"start"::{"line"::81,"character"::12},"end"::{"line"::110,"character"::7}},"codeRange"::{"start"::{"line"::81,"character"::12},"end"::{"line"::110,"character"::7}},"children"::[{"kind"::"NEW_INSTANCE","className"::"Column","attributes"::[{"name"::"mainAxisAlignment","label"::"MainAxisAlignment.center","valueRange"::{"start"::{"line"::99,"character"::29},"end"::{"line"::99,"character"::53}}}],"range"::{"start"::{"line"::84,"character"::15},"end"::{"line"::109,"character"::9}},"codeRange"::{"start"::{"line"::84,"character"::15},"end"::{"line"::109,"character"::9}},"children"::[{"kind"::"NEW_INSTANCE","className"::"Text","attributes"::[{"name"::"data","label"::"'You have pushed the button this many times::'","valueRange"::{"start"::{"line"::102,"character"::14},"end"::{"line"::102,"character"::59}}}],"range"::{"start"::{"line"::101,"character"::12},"end"::{"line"::103,"character"::13}},"codeRange"::{"start"::{"line"::101,"character"::12},"end"::{"line"::103,"character"::13}},"children"::[]},{"kind"::"NEW_INSTANCE","className"::"Text","attributes"::[{"name"::"data","label"::"'$_counter'","valueRange"::{"start"::{"line"::105,"character"::14},"end"::{"line"::105,"character"::25}}},{"name"::"style","label"::"Theme.of(context).textTheme.headline4","valueRange"::{"start"::{"line"::106,"character"::21},"end"::{"line"::106,"character"::58}}}],"range"::{"start"::{"line"::104,"character"::12},"end"::{"line"::107,"character"::13}},"codeRange"::{"start"::{"line"::104,"character"::12},"end"::{"line"::107,"character"::13}},"children"::[]}]}]},{"kind"::"NEW_INSTANCE","className"::"FloatingActionButton","attributes"::[{"name"::"onPressed","label"::"_incrementCounter","valueRange"::{"start"::{"line"::112,"character"::19},"end"::{"line"::112,"character"::36}}},{"name"::"tooltip","label"::"'Increment'","valueRange"::{"start"::{"line"::113,"character"::17},"end"::{"line"::113,"character"::28}}}],"range"::{"start"::{"line"::111,"character"::28},"end"::{"line"::115,"character"::7}},"codeRange"::{"start"::{"line"::111,"character"::28},"end"::{"line"::115,"character"::7}},"children"::[{"kind"::"NEW_INSTANCE","className"::"Icon","attributes"::[{"name"::"icon","label"::"Icons.add","valueRange"::{"start"::{"line"::114,"character"::20},"end"::{"line"::114,"character"::29}}}],"range"::{"start"::{"line"::114,"character"::15},"end"::{"line"::114,"character"::30}},"codeRange"::{"start"::{"line"::114,"character"::15},"end"::{"line"::114,"character"::30}},"children"::[]}]}]}]}]}]}},"jsonrpc"::"2.0"}
1609250052839:Ex:Stack Overflow:#0      _StringBase._substringUnchecked (dart::core-patch/string_patch.dart::401::3)
#1      _StringBase.substring (dart::core-patch/string_patch.dart::398::12)
#2      EmbedderSdk.internalMapDartUri (package::analyzer/src/dart/sdk/sdk.dart::262::29)
#3      AbstractDartSdk.mapDartUri (package::analyzer/src/dart/sdk/sdk.dart::165::16)
#4      DartUriResolver.resolveAbsolute (package::analyzer/src/generated/source.dart::144::17)
#5      SourceFactoryImpl._internalResolveUri.<anonymous closure> (package::analyzer/src/context/source.dart::169::34)
#6      _HashMap.putIfAbsent (dart::collection-patch/collection_patch.dart::140::29)
#7      SourceFactoryImpl._internalResolveUri (package::analyzer/src/context/source.dart::167::38)
#8      SourceFactoryImpl.forUri2 (package::analyzer/src/context/source.dart::91::16)
#9      DriverBasedUriConverter.uriToPath (package::analyzer/src/dart/analysis/uri_converter.dart::40::53)
#10     DeclarationsContext._resolveUri (package::analyzer/src/services/available_declarations.dart::409::25)
#11     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::708::26)
#12     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#13     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#14     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#15     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#16     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#17     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#18     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#19     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#20     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#21     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#22     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#23     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#24     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#25     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#26     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#27     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#28     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#29     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#30     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#31     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#32     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#33     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#34     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#35     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#36     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#37     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#38     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#39     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#40     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#41     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#42     _File.refresh (package::analyzer/src/services/available_declarations.dart::1738::20)
#43     DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
...
...
#6978   _File.refresh (package::analyzer/src/services/available_declarations.dart::1213::19)
#6979   DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#6980   _File._fileForRelativeUri (package::analyzer/src/services/available_declarations.dart::1738::20)
#6981   _File.refresh (package::analyzer/src/services/available_declarations.dart::1213::19)
#6982   DeclarationsTracker._getFileByUri (package::analyzer/src/services/available_declarations.dart::713::14)
#6983   _File._fileForRelativeUri (package::analyzer/src/services/available_declarations.dart::1738::20)
#6984   _File.refresh (package::analyzer/src/services/available_declarations.dart::1213::19)
#6985   DeclarationsTracker._getFileByPath (package::analyzer/src/services/available_declarations.dart::699::14)
#6986   DeclarationsTracker.doWork (package::analyzer/src/services/available_declarations.dart::601::18)
#6987   CompletionLibrariesWorker.performWork (package::analysis_server/src/domains/completion/available_suggestions.dart::302::13)
#6988   AnalysisDriverScheduler._run (package::analyzer/src/dart/analysis/driver.dart::1939::35)
#6989   _rootRunUnary (dart::async/zone.dart::1198::47)
#6990   _CustomZone.runUnary (dart::async/zone.dart::1100::19)
#6991   _FutureListener.handleValue (dart::async/future_impl.dart::143::18)
#6992   Future._propagateToListeners.handleValueCallback (dart::async/future_impl.dart::696::45)
#6993   Future._propagateToListeners (dart::async/future_impl.dart::725::32)
#6994   Future._completeWithValue (dart::async/future_impl.dart::529::5)
#6995   _AsyncAwaitCompleter.complete (dart::async-patch/async_patch.dart::40::15)
#6996   _completeOnAsyncReturn (dart::async-patch/async_patch.dart::311::13)
#6997   Monitor.signal (package::analyzer/src/dart/analysis/status.dart)
#6998   _rootRunUnary (dart::async/zone.dart::1198::47)
#6999   _CustomZone.runUnary (dart::async/zone.dart::1100::19)
#7000   _FutureListener.handleValue (dart::async/future_impl.dart::143::18)
#7001   Future._propagateToListeners.handleValueCallback (dart::async/future_impl.dart::696::45)
#7002   Future._propagateToListeners (dart::async/future_impl.dart::725::32)
#7003   Future._completeWithValue (dart::async/future_impl.dart::529::5)
#7004   Future._asyncCompleteWithValue.<anonymous closure> (dart::async/future_impl.dart::567::7)
#7005   _rootRun (dart::async/zone.dart::1190::13)
#7006   _CustomZone.run (dart::async/zone.dart::1093::19)
#7007   _CustomZone.runGuarded (dart::async/zone.dart::997::7)
#7008   _CustomZone.bindCallbackGuarded.<anonymous closure> (dart::async/zone.dart::1037::23)
#7009   _microtaskLoop (dart::async/schedule_microtask.dart::41::21)
#7010   _startMicrotaskLoop (dart::async/schedule_microtask.dart::50::5)
#7011   _runPendingImmediateCallback (dart::isolate-patch/isolate_patch.dart::118::13)
#7012   _Timer._runTimers (dart::isolate-patch/timer_impl.dart::404::11)
#7013   _Timer._handleMessage (dart::isolate-patch/timer_impl.dart::428::5)
#7014   _RawReceivePortImpl._handleMessage (dart::isolate-patch/isolate_patch.dart::168::12)

Dart SDK Version (dart --version) latest
Whether you are using Windows, MacOSX, or Linux (if applicable) mac
Whether you are using Chrome, Safari, Firefox, Edge (if applicable) not

@bwilkerson likely the same as #43899.

@bwilkerson likely the same as #43899.

It looks that way. I'll close this in favor of the earlier issue.

It looks that way. I'll close this in favor of the earlier issue.

Thanks for that

Thanks for that


Added test for edifact message UNA and UNB

Added test for edifact message UNA and UNB for PAXLST message

Hm, what are you testing exactly here? Aren't you testing the parser? (by creating a segment and checking if the array was created correctly in the SegmentsCollection?
ATM a message like PAXLST is not implemented and will be implemented most probably by a class like PaxlstMessage with tests for it.
Which does not mean I don't want to accept this PR...

Could you maybe move that test into tests/messagetypes/paxlst
New tests preferrably should be pytest, not Django unittests. ok for you?

Yes, I am trying to implement PAXLST PNRGOV message. We are doing a port of
https://github.com/US-CBP/GTAS in pure python / django
https://github.com/minelytics/GTAS

I will move the test to the location you said and move to pytest as well.

If you can guide we would like to add the PR for parsers https://github.com/minelytics/GTAS/tree/branch_1f_parsers/gtas/parsers/paxlst to pydifact.  We are writing a lot of parser for EDIFact PAXLST and PNR gov. We also intend to write validators. if I can move all the functions to pydifact that would be great. Then I can just use the wrapper classes to put the code.

I will send a new PR request shortly.

Updated the code.
a) Moved the test to messagetype
b) Use pytest in place of unittest
I noticed in some test there are still code using the unittest, shall i convert that to pytest?

Thanks, seems good!
Just one thing: pydifact uses black to format all code. I did that already in another commit.

Oh, and yes, if you really want to do the work and make the full transit to pytest for the others, feel free - but that's really low priority. I'd  just like to have new tests in pytest.


Fix warnings and remove unneeded code

These changes appear to replace is_useful with is_data || is_text. I think this would not change the meaning, except that is_bss was removed. is_bss may not occur in the cases you looked at but it is a case that we need to be able to handle. A .bss section is a data section where the contents are initialized to zero.

I didn't think I removed is_bss. I only removed is_useful because I noticed that there's no else case for that. Maybe it does make sense to leave it in though. The semantics is the same I think I just thought less code is better. Please feel free to ignore.


IP-Per-Task HealthCheck: Health check port indices must address an element of the ports array or container port mappings

Environment:
DC/OS 1.7

SDN
Nuage networks

My JSON file:
{
        "id": "/kafka2",
        "groups": [{

                "id": "/kafka2/zk",
                "apps": [{
                                "id": "zk1",
                                "cpus": 0.5,
                                "mem": 512,
                                "instances": 1,
                                "maxLaunchDelaySeconds": 10,
                                "labels": {
                                        "HAPROXY_GROUP": "internal"
                                },
                                "container": {
                                        "type": "DOCKER",
                                        "volumes": [],
                                        "docker": {
                                                "image": "mesoscloud/zookeeper:latest",
                                                "network": "BRIDGE",
                                                "portmappings": [{
                                                                "containerPort": 2181,
                                                                "protocol": "tcp",
                                                                "servicePort": 10181
                                                        }, {
                                                                "containerPort": 2888,
                                                                "protocol": "tcp",
                                                                "servicePort": 10888

                                                        }, {
                                                                "containerPort": 3888,
                                                                "protocol": "tcp",
                                                                "servicePort": 11888
                                                        }

                                                ],
                                                "privileged": false,
                                                "parameters": [{
                                                        "key": "net",
                                                        "value": "devnet"
                                                }, {
                                                        "key": "hostname",
                                                        "value": "zk1.zk.kafka2.marathon.mesos"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localnet.net"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localdevnet.com"
                                                }],
                                                "forcePullImage": false
                                        }
                                },
                                "constraints": [
                                        ["hostname", "UNIQUE"]
                                ],
                                "healthChecks": [{
                                        "path": "/admin/healthcheck",
                                        "protocol": "HTTP",
                                        "portIndex": 0,
                                        "gracePeriodSeconds": 120,
                                        "intervalSeconds": 30,
                                        "timeoutSeconds": 5,
                                        "maxConsecutiveFailures": 0,
                                        "ignoreHttp1xx": false
                                }],
                                "portDefinitions": [],
                                "ipAddress": {},

                                "env": {
                                        "MYID": "1",
                                        "ZOOKEEPER_INIT_LIMIT": "30",
                                        "ZOOKEEPER_CLIENT_PORT": "2181",
                                        "ZOOKEEPER_SYNC_LIMIT": "30",
                                        "ZOOKEEPER_LOG4J_ROOT_LOGLEVEL": "INFO",
                                        "SERVERS": "zk1.zk.kafka2.marathon.mesos,zk2.zk.kafka2.marathon.mesos,zk3.zk.kafka2.marathon.mesos"
                                }
                        }, {

                                "id": "zk2",
                                "dependencies": ["/kafka2/zk/zk1"],
                                "cpus": 0.5,
                                "mem": 512,
                                "instances": 1,
                                "maxLaunchDelaySeconds": 10,
                                "labels": {
                                        "HAPROXY_GROUP": "internal"
                                },
                                "container": {
                                        "type": "DOCKER",
                                        "volumes": [],
                                        "docker": {
                                                "image": "mesoscloud/zookeeper:latest",
                                                "network": "BRIDGE",
                                                "portmappings": [{
                                                                "containerPort": 2181,
                                                                "protocol": "tcp",
                                                                "servicePort": 12181
                                                        }, {
                                                                "containerPort": 2888,
                                                                "protocol": "tcp",
                                                                "servicePort": 12888
                                                        }, {
                                                                "containerPort": 3888,
                                                                "protocol": "tcp",
                                                                "servicePort": 13888
                                                        }

                                                ],
                                                "privileged": false,
                                                "parameters": [{
                                                        "key": "net",
                                                        "value": "devnet"
                                                }, {
                                                        "key": "hostname",
                                                        "value": "zk2.zk.kafka2.marathon.mesos"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localnet.net"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localdevnet.com"
                                                }],
                                                "forcePullImage": false
                                        }
                                },
                                "constraints": [
                                        ["hostname", "UNIQUE"]
                                ],
                                "healthChecks": [{
                                        "path": "/admin/healthcheck",
                                        "protocol": "HTTP",
                                        "portIndex": 0,
                                        "gracePeriodSeconds": 120,
                                        "intervalSeconds": 30,
                                        "timeoutSeconds": 5,
                                        "maxConsecutiveFailures": 0,
                                        "ignoreHttp1xx": false
                                }],
                                "portDefinitions": [],
                                "ipAddress": {},

                                "env": {
                                        "MYID": "2",
                                        "ZOOKEEPER_INIT_LIMIT": "30",
                                        "ZOOKEEPER_CLIENT_PORT": "2181",
                                        "ZOOKEEPER_SYNC_LIMIT": "30",
                                        "ZOOKEEPER_LOG4J_ROOT_LOGLEVEL": "INFO",
                                        "SERVERS": "zk1.zk.kafka2.marathon.mesos,zk2.zk.kafka2.marathon.mesos,zk3.zk.kafka2.marathon.mesos"
                                }
                        }, {

                                "id": "zk3",
                                "dependencies": ["/kafka2/zk/zk2"],
                                "cpus": 0.5,
                                "mem": 512,
                                "instances": 1,
                                "maxLaunchDelaySeconds": 10,
                                "labels": {
                                        "HAPROXY_GROUP": "internal"
                                },
                                "container": {
                                        "type": "DOCKER",
                                        "volumes": [],
                                        "docker": {
                                                "image": "mesoscloud/zookeeper:latest",
                                                "network": "BRIDGE",
                                                "portmappings": [{
                                                                "containerPort": 2181,
                                                                "protocol": "tcp",
                                                                "servicePort": 14181
                                                        }, {
                                                                "containerPort": 2888,
                                                                "protocol": "tcp",
                                                                "servicePort": 14888
                                                        }, {
                                                                "containerPort": 3888,
                                                                "protocol": "tcp",
                                                                "servicePort": 15888
                                                        }

                                                ],
                                                "privileged": false,
                                                "parameters": [{
                                                        "key": "net",
                                                        "value": "devnet"
                                                }, {
                                                        "key": "hostname",
                                                        "value": "zk3.zk.kafka2.marathon.mesos"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns",
                                                        "value": "<IP_ADDRESS>"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localnet.net"
                                                }, {
                                                        "key": "dns-search",
                                                        "value": "localdevnet.com"
                                                }],
                                                "forcePullImage": false
                                        }
                                },
                                "constraints": [
                                        ["hostname", "UNIQUE"]
                                ],
                                "healthChecks": [{
                                        "path": "/admin/healthcheck",
                                        "protocol": "HTTP",
                                        "portIndex": 0,
                                        "gracePeriodSeconds": 120,
                                        "intervalSeconds": 30,
                                        "timeoutSeconds": 5,
                                        "maxConsecutiveFailures": 0,
                                        "ignoreHttp1xx": false
                                }],
                                "portDefinitions": [],
                                "ipAddress": {},

                                "env": {
                                        "MYID": "3",
                                        "ZOOKEEPER_INIT_LIMIT": "30",
                                        "ZOOKEEPER_CLIENT_PORT": "2181",
                                        "ZOOKEEPER_SYNC_LIMIT": "30",
                                        "ZOOKEEPER_LOG4J_ROOT_LOGLEVEL": "INFO",
                                        "SERVERS": "zk1.zk.kafka2.marathon.mesos,zk2.zk.kafka2.marathon.mesos,zk3.zk.kafka2.marathon.mesos"
                                }
                        }

                ]

          }
        ]
}

Trying to submit the task, but getting an error:
[root@mmaster1 zookeeper-docker]# curl --header "Authorization: token=$(dcos config show core.dcos_acs_token)" -k -H "Content-Type: application/json" -X POST<EMAIL_ADDRESS>http://<IP_ADDRESS>:8080/v2/groups | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6071    0   513  100  5558  11370   120k --:--:-- --:--:-- --:--:--  123k
{
  "message": "Object is not valid",
  "details": [
    {
      "path": "/groups(0)/apps(0)/healthChecks(0)",
      "errors": [
        "Health check port indices must address an element of the ports array or container port mappings."
      ]
    },
    {
      "path": "/groups(0)/apps(2)/healthChecks(0)",
      "errors": [
        "Health check port indices must address an element of the ports array or container port mappings."
      ]
    },
    {
      "path": "/groups(0)/apps(1)/healthChecks(0)",
      "errors": [
        "Health check port indices must address an element of the ports array or container port mappings."
      ]
    }
  ]
}

Is it a bug or am I doing something wrong here ?
Thanks again,
Alex

thanks for reporting this. I think we fixed this on master but haven't yet backported.
xref https://github.com/mesosphere/marathon/commit/a3ad9bc4be75c1e6c0f5eda19bf74ff9c0459765#diff-fdb92518a2f12016f315d4352487c0ceR277

after a second look at the code, it's unclear whether the commit linked above would actually impact this use case given that the marathon release 1.1.x ports code is so different from later releases.

@jdef AFAIK DC/OS 1.7 uses Marathon 1.1.1. Does this mean that error is still present in Marathon 1.1.1 and current port will not yet address the issue ?
Thanks again!

I tried with this app on my dcos 1.7 cluster and it worked fine:
{
  "id": "/dockerhealthcheckindex",
  "instances": 1,
  "cpus": 0.1,
  "mem": 128,
  "args": [
    "--forceHTTP"
  ],
  "container": {
    "docker": {
      "network": "BRIDGE",
      "image": "pierrezemb/gostatic",
      "portMappings": [
        { "containerPort": 8043, "hostPort": 0 }
      ]
    },
    "volumes": [
      { "hostPath": "index.html", "containerPath": "/srv/http/index.html", "mode": "RW" }
    ]
  },
  "healthChecks": [
    { "path": "/index.html", "protocol": "HTTP", "portIndex": 0 }
  ],
  "uris": [
    "https://gist.githubusercontent.com/jdef/5005a036e0e63f299f50c3574e996927/raw/06edc82f428b7bda60198c4d6caef621b77f679f/index.html"
  ],
  "backoffFactor": 0.20
}

mind testing on yours?

Thanks for quick response. JSON  "as-is" works great as long as I do not provide IP-Per-Task.  Here is a slightly modified version which includes IP-Per-Task and it results in an error:
{
        "id": "/dockerhealthcheckindex",
        "cpus": 0.5,
        "mem": 128,
        "instances": 1,
        "args": [
                "--forceHTTP"
        ],
        "container": {
                "type": "DOCKER",
                "volumes": [],
                "docker": {
                        "image": "pierrezemb/gostatic",
                        "network": "BRIDGE",
                        "portmappings": [{
                                "containerPort": 8043,
                                "protocol": "tcp"
                        }],
                        "privileged": false,
                        "parameters": [{
                                "key": "net",
                                "value": "devnet"
                        }],
                        "forcePullImage": false
                },
                "volumes ": [{
                        "hostPath": "index.html",
                        "containerPath": "/srv/http/index.html",
                        "mode": "RW"
                }]

        },
        "healthChecks": [{
                "path": "/index.html",
                "protocol": "HTTP",
                "portIndex": 0
        }],
        "uris": [
                "https://gist.githubusercontent.com/jdef/5005a036e0e63f299f50c3574e996927/raw/06edc82f428b7bda60198c4d6caef621b77f679f/index.html"
        ],
        "backoffFactor": 0.20,
        "portDefinitions": [],
        "ipAddress": {}

}

Submitting job to Marathon:
[root@mmaster1 kafka]# curl --header "Authorization: token=$(dcos config show core.dcos_acs_token)" -k -H "Content-Type: application/json" -X POST<EMAIL_ADDRESS>http://<IP_ADDRESS>:8080/v2/apps | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1002    0   183  100   819   6706  30015 --:--:-- --:--:-- --:--:-- 30333
{
  "message": "Object is not valid",
  "details": [
    {
      "path": "/healthChecks(0)",
      "errors": [
        "Health check port indices must address an element of the ports array or container port mappings."
      ]
    }
  ]
}
[root@mmaster1 kafka]#

Errors out ... :(

Thanks for testing. My gut says that this may be difficult to get working
right in dcos 1.7; we made changes in dcos 1.8 (virtual networking support)
to support USER as a docker container networking mode .. and some other
changes that allow ipAddress{} to place more nicely with portMappings.
Do you have access to a dcos 1.8 cluster for testing?
On Thu, Oct 27, 2016 at 10:24 AM, Alex Kamalov<EMAIL_ADDRESS>wrote:

Thanks for quick response. JSON "as-is" works great as long as I do not
provide IP-Per-Task. Here is a slightly modified version which includes
IP-Per-Task and it results in an error:
{
"id": "/dockerhealthcheckindex",
"cpus": 0.5,
"mem": 128,
"instances": 1,
"args": [
"--forceHTTP"
],
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "pierrezemb/gostatic",
"network": "BRIDGE",
"portmappings": [{
"containerPort": 8043,
"protocol": "tcp"
}],
"privileged": false,
"parameters": [{
"key": "net",
"value": "devnet"
}],
"forcePullImage": false
},
"volumes ": [{
"hostPath": "index.html",
"containerPath": "/srv/http/index.html",
"mode": "RW"
}]
    },
    "healthChecks": [{
            "path": "/index.html",
            "protocol": "HTTP",
            "portIndex": 0
    }],
    "uris": [
            "https://gist.githubusercontent.com/jdef/5005a036e0e63f299f50c3574e996927/raw/06edc82f428b7bda60198c4d6caef621b77f679f/index.html"
    ],
    "backoffFactor": 0.20,
    "portDefinitions": [],
    "ipAddress": {}

}
Submitting job to Marathon:
[root@mmaster1 kafka]# curl --header "Authorization: token=$(dcos config show core.dcos_acs_token)" -k -H "Content-Type: application/json" -X POST<EMAIL_ADDRESS>http://<IP_ADDRESS>:8080/v2/apps | jq .
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  1002    0   183  100   819   6706  30015 --:--:-- --:--:-- --:--:-- 30333
{
"message": "Object is not valid",
"details": [
{
"path": "/healthChecks(0)",
"errors": [
"Health check port indices must address an element of the ports array or container port mappings."
]
}
]
}
[root@mmaster1 kafka]#
Errors out ... :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mesosphere/marathon/issues/4620#issuecomment-256656213,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACPVLBGGqJpCYljoWI4_5188nkTUdL4eks5q4LQbgaJpZM4KhKzR
.

I can upgrade. I need to look into what it takes to upgrade.

Works once upgraded to latest Marathon (1.3.x) Thanks again @jdef


[Feature]  Show filter logic for profiling and metric queries

PR checklist

[x] Ensure you have added or ran the appropriate tests for your PR.
[x] DCO signed

What type of PR is this?
feature
What this PR does / why we need it:
show filter logic to be more informative
Which issue(s) this PR fixes:
sc-30464
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

NONE

--table shouldn't show no model for profile

--table shouldn't show no model for profile

Because users have specified only one subject, we didn't know how many models are skipped unless we do database reflection first.
Hence, we don't show no model for profile and also don't say how many are skipped.


Add cookie storage for text files and API key

Would be convenient to save user options and files on their machine for when they return to the page

We can store workspaces in the electron app. We can have a download button to manually get files on web.


No shared scheme to work with Carthage

Hi,
I think you forgot to check the shared scheme chekbox in order to be Carthage compatible.

That might be right, will fix, thanks

Fixed and reset tag, Carthage should be working without problems now :)


Expose a library API

This is not usable as a library dependency for others via go get. Can keep the CLI iface the same, just pull the code into a package and expose things with reasonable names. Everything that can be done via the CLI should be doable programmatically (of course, the CLI code just invokes the lib code). I'd send a PR to do this myself, but I figure such a large refactor (as in size, not effort) should be done by the maintainer.
(also, during the refactoring, fix things like exposed internal variables, use of bool returns instead of error, etc)

I had a couple people ask to use the tool as a library, so I'm going to leave this open to think about it, but it will take some care to design a simple API, and I think the ACME server will cover most of those use cases.
In the PR you mention not liking "hardcoding CA org name", but I definitely don't want mkcert to grow options, whether through the API or the CLI. It's a simple tool that serves a simple use case with no configuration. The API should not be different.

In the PR you mention not liking "hardcoding CA org name", but I definitely don't want mkcert to grow options, whether through the API or the CLI. It's a simple tool that serves a simple use case with no configuration. The API should not be different.

Completely agree! That's why you have a set of options all with sensible defaults. So you take an options struct, or if nil you create use the default struct. In the struct you have something like a *x509.Certificate field for the template, and if it's not provided, you use the result from DefaultTemplate() which does have hardcoded values. It doesn't add as much code as it might sound.
If welcomed, I would be happy to do this refactoring, but just be advised that while the CLI args would look the exact same, the code might change considerably which is why I wouldn't go down this path without your blessing. Of course, when refactoring, I always attempt to remain extremely simple and do not over-abstract for the sake of over-abstracting and wouldn't even think of bringing in any dependencies.

I think a library for add/delete operations on certificate stores should be a separate repository. Then this (and many others) project could use that.
What about starting with this interface?
type Store interface {
	Add(*x509.Certificate) error
	Remove(*x509.Certificate) error
}

@adamdecaf - Disagree a bit. Just a separate folder in this project would allow anyone else to use it. That interface also doesn't really have removal right. Darwin/Linux just remove a cert path, Windows removes based on subject org. And I think as an initial first step, just doing what mkcert does is enough. So more like:
type Mkcert struct {
	// ...
}

func (*Mkcert) Install() error   { panic("TODO: use currPlatform") }
func (*Mkcert) Uninstall() error { panic("TODO: use currPlatform") }

type platform interface {
	install(*Mkcert) error
	uninstall(*Mkcert) error
}

// then in platform_windows.go

var currPlatform platform = windowsPlatform{}

type windowsPlatform struct{}

func (windowsPlatform) install(m *Mkcert) error   { panic("TODO") }
func (windowsPlatform) uninstall(m *Mkcert) error { panic("TODO") }

Then a simple new(Mkcert).Install() does exactly what mkcert -install does from the CLI, yet Mkcert could have a couple of nil-means-fall-back-to-default fields (e.g. template, root path, etc).
If there is more value in abstracting how to communicate with OS-specific CAs, then that is a separate concern and probably a separate library, yes.

Why can't org be pulled from the certificate? I see in your windows PR the org value used is copied from the certificate.
https://github.com/FiloSottile/mkcert/blob/master/cert.go#L53

@adamdecaf - Answered in that PR.

I find myself having a need to use this tool as a library from my Go program. What can I do to help make this happen?
(Specifically, I need to install a root CA that is unique to that client machine, and then call a function and get back a *x509.Certificate for some given names and is good for some duration. Or a tls.Certificate -- doesn't matter too much. Could even be ASN bytes, just something that's not necessarily written to disk.)

Hi Matt, thanks for helping with context! A couple questions:

do you need the CA to be installed in the system store, or just for it to be trusted by your Go program?
would an ACME server work instead?

do you need the CA to be installed in the system store, or just for it to be trusted by your Go program?

I need it to be trusted by the web browser(s). My Go program exposes a local static file server that needs to use HTTPS because scripts on the page require HTTPS.

would an ACME server work instead?

As long as its certificates are trusted in browsers, but an ACME server and client configuration does seem a little overkill for what I need.

In that way, an ACME server makes sense, even one that you can start with an API.

Yes, you're right -- I suppose I can integrate a small ACME client (like autocert, or lego) that hits a small ACME server (but then I need to find a good server that's production-ready but also minimal). However, the CA still has to be trusted by the browser.

Can you tell me a bit more about what this is for?

It's for the web UI for a Go application that will be distributed to numerous clients. As you know, I'm no fan of messing with root stores on client machines, but I think our use case here is legitimate. The web UI is accessible only via the loopback interface, so no network transmissions are even happening. However, certain scripts such as Stripe.js refuse to work over HTTP, even in secure localhost contexts (I've already emailed them about this). This means our locally-served web app can't let the customer set their payment card, for example, even though all network transmissions use HTTPS. 🤷♂
So, in summary, this is for software for non-technical users. No TLS interception going on, no nefarious use of the root store or custom CA: just need to ensure that the root key is generated per-client (and stored safely) and not shipped with the application, of course. :)
I can understand if this is outside the use case of mkcert. Feel free to say so!

(BTW, you can use ListenAndServeTLS with a tls.Certificate generated via tls.X509KeyPair by setting http.Server.TLSConfig. It's more obscure than it should be.)

Yeah, we do this in Caddy. I just thought I'd mention it here since I don't know what the predominant use case will be for other users of this lib. I'm not sure I've even decided which method to use. :sweat_smile:

Thanks for making this project!
I also have a use case for separating the library from main:
Printing to thermal printers (shipping/receipt/name badges/etc) unfortunately requires raw access to send print codes which browsers don't support for obvious security reasons.
To get around this, the client can run a "print server" on http(s)://localhost:8080 and POST their print job to themselves via loopback which then sends the print job locally.
This workflow has worked great for years but recent changes in browsers and the number of HTTPS only sites has had an impact on this workflow. You can no longer effectively send an HTTP request to localhost if the site you are getting the print job from is HTTPS. Self-signed certs are also no longer accepted without modifying hidden browser settings.
To get around this we give our users instructions to create their own local CA and run through all the manual steps and arcane commands to create their own "legitimate" self-signed certs to provide to our client software. We would love to automate this across multiple OSes within our software.
The mkcert utility automatically does what we tell our users to do manually. We just want to include it in our app to streamline the process.
I believe not exposing a library along with the utility reduces the usefulness of this project even if it means some users abuse it. Separating the main utility from the library also provides better code organization and makes creating additional/future utilities easier. You can still warn users not to use the library without good cause if you are worried about abuse.
Because I need this change now, I'm going to fork and make it happen. I'll simply make a cmd/mkcert/main.go and separate calling funcs from flag/global state. Let me know if you want a PR.
I really don't want to maintain a fork so please consider. And, thanks again for all the hard work creating this!

I'd like to be able use this via my task runner https://github.com/brad-jones/gomake (plenty of other go based task runners that would benefit too).
The end goal being that a developer can just run some task like gomake up which runs mkcert -install, generates some certs, one for each of our micro-services, builds each of the micro-services, ensures each micro-service trusts the CA, finally executes the entire stack via docker-compose up.
Right now I am shelling out to the mkcert command to make this all happen.

@FiloSottile Hello. First of all, thanks for this great project which helps lot of people around as it seems (and me by the same occasion).
I was wondering if mkcert was exposing any API, and found this thread.
From the previous comments, and some other issues that I read, I understand your vision about mkcert and what are the risks that you want to reduce.
Though, I think, as some others, that exposing an API for mkcert would greatly improve its usage.
So, as the previous comments in this thread, I would like to also expose a use-case that I am running into.
I am working on a project that I would like to make available through a Docker container.
It exposes a web service reachable by clients only if it's through HTTPS and if the certificate is trusted.
For testing purpose and development only, (worth to notice that it would be mainly for development), I would like to make the certificates generation automatic when the Docker stack starts.
So, my idea was: it would be cool to be able to call mkcert from the Docker container to get the certificates and get the whole set up and ready to go.
I think a schema is shorter and more explicit than long explanations to illustrate the idea:

For security concerns, from my point of view, the API MUST request an authorization token.
It would be dangerous that any container that you run could make some calls to an installed mkcert without people even knowing/allowing it.
This authorization token, which could be for example a JWT would carry the permissions and other useful information.
On mkcert side, what would it mean?

New command for token generation. For example:

mkcert -token example.com 56000

Exposing an API on a port chosen by the user. The latter must be able to handle token storage.

On client side, what would it mean? (I will use my use case)

The client make sure to install mkcert if he wants to get a simplified running process (for example: testing purpose)

The client generate a key for the domain requested (with a TTL of its choice)

The client passes the key and the API port in the .env and can run the stack. It works.

What would be in your opinion the downsides with this approach? If you don't see any advantages, what would be for you a nice and simple alternative? Let me know what you think.
As @mholt said:

I can understand if this is outside the use case of mkcert. Feel free to say so!

@noglitchyo you might want to look into smallstep/certificates.
You can use smallstep/cli to create a CSR and a JWT token, those will get validated by the CA and you'll get a signed certificate back.
You will first need to configure the CA (certificates) using step ca init, and run it in your environment. Then you can create a token using step ca token [-san <san>] <cn> and get the certificate with step ca certificate --token <token> <cn> <cert.crt> <cert.key>. On your terminal, you can skip the step ca token and use just step ca certificate, it will automatically generate the token. Note that a password is required to decrypt to private JWK used to sign the token, but you can pass it using --password-file. By default, the certificates are short-lived, 24h, you can renew them using step ca renew, but you can configure the CA to increase the validity of the certificates.
Disclosure: I'm involved in the development of those projects.

@noglitchyo I forgot that you can bootstrap your environment so you don't need to provide the root certificate or the ca url using step ca bootstrap

@noglitchyo Thanks for the detailed comment. I see that as definitely out of scope for mkcert itself, and something that can be built on top of it. In particular because there are so many ways to do  authorization and authentication that we can't implement them all well.
It should be fairly doable by shelling out to mkcert, as well.

Thoroughly enjoying mkcert, and I was thinking about extending @unravelin's dev CLI to make use of it. Part of that CLI spins up proxies to remote running services on local ports, and I wanted to automate creating the certificates, so I threw together: https://godoc.org/github.com/icio/mkcert to programmatically invoke the CLI:
cert, err := mkcert.Exec(
	// Domains tells mkcert what certificate to generate.
	mkcert.Domains("localhost"),
	// RequireTrusted(true) tells Exec to return an error if the CA isn't
	// in the trust stores.
	mkcert.RequireTrusted(true),
	// CertFile and KeyFile override the default behaviour of generating
	// the keys in the local directory.
	mkcert.CertFile(filepath.Join(dir, "cert.pem")),
	mkcert.KeyFile(filepath.Join(dir, "key.pem")),
)

Users still need to have mkcert installed, but updates to dev won't require us to announce to anybody they need to recreate certificates - we can just do it during startup.

@icio Since you mentioned it, mkcert would make an excellent certmagic.Manager implementation. This way you get all the same API as CertMagic for public certs but with private certs using mkcert under the hood.

Hi @FiloSottile,
My use case: at my company we use a private root CA for internal services. Right now we have a onboarding process that requires manually doing the stuff mkcert does to copy the cert into various trust stores. I'd like to replace this step with a tool that uses the same fiddly code mkcert already takes care of. This is especially important if we want to move to shorter-lived certificates.
This use case might be different from most of the ones mentioned on this thread since I don't want to issue new certificates at all, just reuse the copy-to-trust-store code.
I think I can use mkcert itself for this use case today: I'd have to make a temp CAROOT and copy my cert into there as rootCA.pem, then call mkcert -install. But it would be cleaner if I could call the Go code directly from my own tools.
(By the way, I was also thinking that maybe we're doing it wrong and we should use Let's Encrypt even for internal services. However, some investigation seems to indicate that it's not intended to be used for non-public domains. I'm happy to be told I'm doing it wrong, though.)

@cespare take a look to https://github.com/smallstep/truststore, it implements mkcert install logic but you can use it in your code.


A sample pull request

Task 3 creating a pull request on forked repository

@MaimoonaAbid
It appears that the PR submitted seems to be empty or lacks the necessary content to be reviewed.
To ensure the productivity and efficiency of the project's development, it is important for contributors to verify their submissions for completeness and relevance to the project and to open issues.
Should you need guidance on how to make a contribution, please refer to the project's contributing guidelines at age.apache.org.


OOP school library: set up associations

For this PR, I:

Run a program using the command line.
Set up associations between classes and objects.

Thank you for the approval! @codepantha


Default argument function causing Supplied parameters do not match any signature of call target

TypeScript Version:  2.3.2
Code
function map<T, R>(
    iterable: AsyncIterable<T> | Iterable<T>,
    func?: (item: T, index: number) => R
): AsyncIterable<R>

async function* map(iterable, func=x => x) {
    let idx = 0
    for await (const item of iterable) {
        yield func(item, idx) // Supplied parameters do not match any signature of call target.
        idx += 1
    }
}

What Happened:
Basically TypeScript complains about "Supplied parameters do not match any signature of call target" at the call of func, this only occurs with the default parameter present, without it it works as expected.
What I'd expect:
Now according to the handbook under the section "Optional parameters in callbacks" it mentions that callbacks can be passed excess parameters, and this does work without using default arguments:
map([1,2,3,4], x => x)

Essentially I'd expect anything that is treated as a default argument to undergo the same type inference as something passed into the function directly, it appears that isn't the case currently.

I'm not sure which specific behavior you consider a bug.
If you don't have the default, then the type of func is any, so anything goes.
If you do have the default, it's of type (x: any) => any, which you can only directly invoke with one parameter. It'd be silly to allow Math.abs(x, y), of course, because that's clearly wrong.

But Math.abs is perfectly permissible to pass to my map function, it takes a T and maps it onto an R it doesn't matter that the second argument is ignored, and further TypeScript does not even complain about this:
// This is valid by the definition of map!
map([1,2,3,4], Math.abs)

Or this:
map([1,2,3,4], x => x)

Essentially my question is why is the x => x typing inferred in that case, but not this case:
map([1,2,3,4] /*
   It seems obvious to me that the default
   argument here should be inferred to be (x: number) => number
   as the definition can simply be inserted in place of no argument,
   and because it's dynamic that's effectively exactly how
*/)

Even though the latter is obviously equivalent to the former as the function is completely identical to the default argument?
What'd make sense to me is if default parameters were a bit like a type guard, e.g.
// Ideally I'd be able to define my function
// without y?: because the type of y isn't undefined | number
// y should always be guaranteed to be a number, it's the parameter
// passed in that can be undefined | number NOT y itself!
function add(x: number, y: number)

/* This effectively guards against y being undefined */
function add(x, y=2) {
    // y can never be undefined so the type of y is actually
    // just number, not undefined | number!
    return x + y
}

/* x can have type undefined or number that's fine, but that doesn't
   mean y can
*/
const x?: number = 10
add(10, x)

Also this satisfies the type and behaves exactly the same and TypeScript doesn't complain.
function map<T, R>(
    iterable: AsyncIterable<T> | Iterable<T>,
    func?: (item: T, index: number) => R
): AsyncIterable<R>

async function* map(iterable, func) {
    /* This is what default parameters already do! So this shouldn't
       somehow be different to default parameters.
    */
    if (func === undefined) {
        func = x => x
    }
    let idx = 0
    for await (const item of iterable) {
        yield func(item, idx) // Supplied parameters do not match any signature of call target.
        idx += 1
    }
}

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.


qgrid not showing when jupyter lab is launched by Anaconda Navigator

Environment

Operating System: Mac OS
Python Version: Python 3.6.5 :: Anaconda, Inc.
How did you install Qgrid: (conda)

If Jupyter Lab is launched by Anaconda Navigator qgrid is not showing. If launched via environment console using jupyter lab --ip=<IP_ADDRESS> --no-browser all is fine.

Interesting...thanks for the report, I'll look into it.


Wrong production chain for Soap Factory

Really great project! Except for occasional difficulties with the island recognition, the program works great and saves a lot of work! However, since I recently started to enter the entire production chain, I noticed that apparently a wrong recipe is used for the soap production.
According to fandom wiki the chain for soap is 2 -> 2 -> 1, but implemented is 1 -> 1 ->.

The calculator the number of buildings you require. This is not necessarily a full production chain.

Ahh all right maybe then a display of overproduction would be nice?