Skip to content

Language Server Protocol for Dart

Shirish Kadam edited this page May 23, 2023 · 4 revisions

The Language Server Protocol (LSP), which is designed to integrate multiple languages into code editors and IDEs. In this case, we are using the Dart language server.

To run this server and interact with it, we'll be starting the process, listening for JSON-RPC messages on its stdout, and writing JSON-RPC messages to its stdin. Here the client 'Tonic IDE' will be interacting with the server by sending request, notifications and the server will be responding back to the client with appropriate resolution.

Starting the LSP Server

In order to start and initialize the LSP server, you need to follow these steps:

  1. Start a new process, which will be your LSP server. dart language-server --client-id my-editor.my-plugin --client-version 1.2
  2. After starting the server, client needs need to send an initialize request to it. This is done by writing a properly formed request to the stdin of the process.
  3. Client can now monitor the server by listening to its stdout and stderr streams. This allows it to process any output or errors that the server produces.

Stopping LSP Server

As for the sequence of stop operations, the typical sequence would be:

  1. Send the shutdown request to the server. This request asks the server to shut down, but it does not actually cause the server to exit.
  2. Wait for the server to respond to the shutdown request. The server should respond with an empty response ({}).
  3. Send the exit notification to the server. This notification asks the server to exit.
  4. Close the input stream of the server process. This is necessary because the server might still be waiting for input.
  5. Wait for the server process to exit. You can do this by waiting on Process.exitCode. If the server does not exit within a reasonable time, send the SIGTERM signal to the server process with Process.kill(). If the server still does not exit, send the SIGKILL signal with Process.kill(ProcessSignal.sigkill).

Sample Dart LSP communication log

1684846962832:Ver:1632818131936475408632:VS-Code:3.64.0:1.34.0:3.0.0
1684846962854:Req:{"jsonrpc"::"2.0","id"::0,"method"::"initialize","params"::{"processId"::40387,"clientInfo"::{"name"::"Visual Studio Code","version"::"1.78.2"},"locale"::"en-gb","rootPath"::"/Users/felix/StudioProjects/tonic-ide","rootUri"::"file::///Users/felix/StudioProjects/tonic-ide","capabilities"::{"workspace"::{"applyEdit"::true,"workspaceEdit"::{"documentChanges"::true,"resourceOperations"::["create","rename","delete"],"failureHandling"::"textOnlyTransactional","normalizesLineEndings"::true,"changeAnnotationSupport"::{"groupsOnLabel"::true}},"configuration"::true,"didChangeWatchedFiles"::{"dynamicRegistration"::true,"relativePatternSupport"::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]},"tagSupport"::{"valueSet"::[1]},"resolveSupport"::{"properties"::["location.range"]}},"codeLens"::{"refreshSupport"::true},"executeCommand"::{"dynamicRegistration"::true},"didChangeConfiguration"::{"dynamicRegistration"::true},"workspaceFolders"::true,"semanticTokens"::{"refreshSupport"::true},"fileOperations"::{"dynamicRegistration"::true,"didCreate"::true,"didRename"::true,"didDelete"::true,"willCreate"::true,"willRename"::true,"willDelete"::true},"inlineValue"::{"refreshSupport"::true},"inlayHint"::{"refreshSupport"::true},"diagnostics"::{"refreshSupport"::true}},"textDocument"::{"publishDiagnostics"::{"relatedInformation"::true,"versionSupport"::false,"tagSupport"::{"valueSet"::[1,2]},"codeDescriptionSupport"::true,"dataSupport"::true},"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]},"insertReplaceSupport"::true,"resolveSupport"::{"properties"::["documentation","detail","additionalTextEdits"]},"insertTextModeSupport"::{"valueSet"::[1,2]},"labelDetailsSupport"::true},"insertTextMode"::2,"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]},"completionList"::{"itemDefaults"::["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover"::{"dynamicRegistration"::true,"contentFormat"::["markdown","plaintext"]},"signatureHelp"::{"dynamicRegistration"::true,"signatureInformation"::{"documentationFormat"::["markdown","plaintext"],"parameterInformation"::{"labelOffsetSupport"::true},"activeParameterSupport"::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,"tagSupport"::{"valueSet"::[1]},"labelSupport"::true},"codeAction"::{"dynamicRegistration"::true,"isPreferredSupport"::true,"disabledSupport"::true,"dataSupport"::true,"resolveSupport"::{"properties"::["edit"]},"codeActionLiteralSupport"::{"codeActionKind"::{"valueSet"::["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations"::false},"codeLens"::{"dynamicRegistration"::true},"formatting"::{"dynamicRegistration"::true},"rangeFormatting"::{"dynamicRegistration"::true},"onTypeFormatting"::{"dynamicRegistration"::true},"rename"::{"dynamicRegistration"::true,"prepareSupport"::true,"prepareSupportDefaultBehavior"::1,"honorsChangeAnnotations"::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,"foldingRangeKind"::{"valueSet"::["comment","imports","region"]},"foldingRange"::{"collapsedText"::false}},"declaration"::{"dynamicRegistration"::true,"linkSupport"::true},"selectionRange"::{"dynamicRegistration"::true},"callHierarchy"::{"dynamicRegistration"::true},"semanticTokens"::{"dynamicRegistration"::true,"tokenTypes"::["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers"::["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats"::["relative"],"requests"::{"range"::true,"full"::{"delta"::true}},"multilineTokenSupport"::false,"overlappingTokenSupport"::false,"serverCancelSupport"::true,"augmentsSyntaxTokens"::true},"linkedEditingRange"::{"dynamicRegistration"::true},"typeHierarchy"::{"dynamicRegistration"::true},"inlineValue"::{"dynamicRegistration"::true},"inlayHint"::{"dynamicRegistration"::true,"resolveSupport"::{"properties"::["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"diagnostic"::{"dynamicRegistration"::true,"relatedDocumentSupport"::false}},"window"::{"showMessage"::{"messageActionItem"::{"additionalPropertiesSupport"::true}},"showDocument"::{"support"::true},"workDoneProgress"::true},"general"::{"staleRequestSupport"::{"cancel"::true,"retryOnContentModified"::["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]},"regularExpressions"::{"engine"::"ECMAScript","version"::"ES2020"},"markdown"::{"parser"::"marked","version"::"1.1.0","allowedTags"::["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]},"positionEncodings"::["utf-16"]},"notebookDocument"::{"synchronization"::{"dynamicRegistration"::true,"executionSummarySupport"::true}},"experimental"::{"supportsWindowShowMessageRequest"::true,"snippetTextEdit"::true,"dartCodeAction"::{"commandParameterSupport"::{"supportedKinds"::["saveUri"]}}}},"initializationOptions"::{"allowOpenUri"::true,"appHost"::"desktop","closingLabels"::true,"flutterOutline"::true,"onlyAnalyzeProjectsWithOpenFiles"::false,"outline"::true,"suggestFromUnimportedLibraries"::true},"trace"::"off","workspaceFolders"::[{"uri"::"file::///Users/felix/StudioProjects/tonic-ide","name"::"tonic-ide"}]},"clientRequestTime"::1684846962179}
1684846962914:Res:{"id"::0,"jsonrpc"::"2.0","result"::{"capabilities"::{"executeCommandProvider"::{"commands"::["edit.sortMembers","edit.organizeImports","edit.fixAll","edit.sendWorkspaceEdit","refactor.perform","move_top_level_to_file"],"workDoneProgress"::true},"workspace"::{"workspaceFolders"::{"changeNotifications"::true,"supported"::true}},"workspaceSymbolProvider"::true},"serverInfo"::{"name"::"Dart SDK LSP Analysis Server","version"::"3.0.0"}}}
1684846962920:Req:{"jsonrpc"::"2.0","method"::"initialized","params"::{},"clientRequestTime"::1684846962917}
1684846962934:Res:{"id"::1,"jsonrpc"::"2.0","method"::"workspace/configuration","params"::{"items"::[{"scopeUri"::"file::///Users/felix/StudioProjects/tonic-ide","section"::"dart"},{"section"::"dart"}]}}
1684846962941:Req:{"jsonrpc"::"2.0","id"::1,"result"::[{"additionalAnalyzerFileExtensions"::[],"analysisExcludedFolders"::[],"analyzeAngularTemplates"::false,"analyzerAdditionalArgs"::[],"analyzerDiagnosticsPort"::null,"analyzerPath"::null,"analyzerSshHost"::null,"analyzerVmServicePort"::null,"includeDependenciesInWorkspaceSymbols"::true,"notifyAnalyzerErrors"::true,"onlyAnalyzeProjectsWithOpenFiles"::false,"showTodos"::true,"useLegacyAnalyzerProtocol"::false,"updateDevTools"::true,"devToolsBrowser"::"chrome","devToolsPort"::null,"devToolsReuseWindows"::true,"devToolsTheme"::"dark","devToolsLocation"::"beside","openDevTools"::"flutter","shareDevToolsWithFlutter"::true,"showInspectorNotificationsForWidgetErrors"::true,"customDevTools"::{},"analysisServerFolding"::true,"autoImportCompletions"::true,"automaticCommentSlashes"::"tripleSlash","closingLabels"::true,"completeFunctionCalls"::true,"documentation"::"full","doNotFormat"::[],"enableCompletionCommitCharacters"::false,"enableSdkFormatter"::true,"enableSnippets"::true,"insertArgumentPlaceholders"::true,"lineLength"::80,"lspSnippetTextEdits"::true,"renameFilesWithClasses"::"never","showDartPadSampleCodeLens"::true,"showMainCodeLens"::true,"showTestCodeLens"::true,"updateImportsOnRename"::true,"warnWhenEditingFilesOutsideWorkspace"::true,"warnWhenEditingFilesInPubCache"::true,"flutterAdbConnectOnChromeOs"::false,"flutterAdditionalArgs"::[],"flutterAttachAdditionalArgs"::[],"flutterCreateAndroidLanguage"::"kotlin","flutterCreateIOSLanguage"::"swift","flutterCreatePlatforms"::null,"offline"::false,"flutterCreateOrganization"::null,"flutterCustomEmulators"::[],"flutterGutterIcons"::true,"flutterHotReloadOnSave"::"manual","hotReloadOnSave"::"never","flutterGenerateLocalizationsOnSave"::"never","flutterOutline"::true,"flutterRunAdditionalArgs"::[],"flutterScreenshotPath"::null,"flutterRememberSelectedDevice"::true,"flutterSelectDeviceWhenConnected"::true,"flutterShowEmulators"::"local","flutterShowWebServerDevice"::"remote","flutterTestAdditionalArgs"::[],"flutterTrackWidgetCreation"::true,"flutterWebRenderer"::"auto","analyzerInstrumentationLogFile"::"analyzerInstrumentationLogFile.txt","analyzerLogFile"::"analyzerLogFile.txt","dapLogFile"::null,"devToolsLogFile"::null,"extensionLogFile"::null,"flutterDaemonLogFile"::null,"flutterRunLogFile"::null,"flutterTestLogFile"::null,"maxLogLineLength"::2000,"maxCompletionItems"::100000,"dartTestLogFile"::null,"vmServiceLogFile"::null,"webDaemonLogFile"::null,"promptToGetPackages"::true,"pubAdditionalArgs"::[],"runPubGetOnPubspecChanges"::"always","runPubGetOnNestedProjects"::"none","buildRunnerAdditionalArgs"::[],"cliConsole"::"debugConsole","debugExtensionBackendProtocol"::"ws","debugSdkLibraries"::false,"debugExternalPackageLibraries"::false,"evaluateGettersInDebugViews"::true,"evaluateToStringInDebugViews"::true,"hotReloadProgress"::"notification","promptToRunIfErrors"::true,"showDartDeveloperLogs"::true,"showDebuggerNumbersAsHex"::false,"showDevToolsDebugToolBarButtons"::true,"suppressTestTimeouts"::"never","cliAdditionalArgs"::[],"testAdditionalArgs"::[],"vmAdditionalArgs"::[],"customDartDapPath"::null,"customFlutterDapPath"::null,"checkForSdkUpdates"::true,"sdkPath"::null,"sdkPaths"::[],"flutterSdkPath"::null,"flutterSdkPaths"::[],"addSdkToTerminalPath"::true,"allowTestsOutsideTestFolder"::false,"openTestView"::["testRunStart"],"showSkippedTests"::true,"testInvocationMode"::"name","projectSearchDepth"::5,"env"::{},"enableServerSnippets"::true,"normalizeFileCasing"::false,"daemonPort"::null,"previewCommitCharacters"::false,"previewFlutterUiGuides"::false,"previewFlutterUiGuidesCustomTracking"::false,"previewHotReloadOnSaveWatcher"::false,"previewSdkDaps"::null,"experimentalRefactors"::false},{"additionalAnalyzerFileExtensions"::[],"analysisExcludedFolders"::[],"analyzeAngularTemplates"::false,"analyzerAdditionalArgs"::[],"analyzerDiagnosticsPort"::null,"analyzerPath"::null,"analyzerSshHost"::null,"analyzerVmServicePort"::null,"includeDependenciesInWorkspaceSymbols"::true,"notifyAnalyzerErrors"::true,"onlyAnalyzeProjectsWithOpenFiles"::false,"showTodos"::true,"useLegacyAnalyzerProtocol"::false,"updateDevTools"::true,"devToolsBrowser"::"chrome","devToolsPort"::null,"devToolsReuseWindows"::true,"devToolsTheme"::"dark","devToolsLocation"::"beside","openDevTools"::"flutter","shareDevToolsWithFlutter"::true,"showInspectorNotificationsForWidgetErrors"::true,"customDevTools"::{},"analysisServerFolding"::true,"autoImportCompletions"::true,"automaticCommentSlashes"::"tripleSlash","closingLabels"::true,"completeFunctionCalls"::true,"documentation"::"full","doNotFormat"::[],"enableCompletionCommitCharacters"::false,"enableSdkFormatter"::true,"enableSnippets"::true,"insertArgumentPlaceholders"::true,"lineLength"::80,"lspSnippetTextEdits"::true,"renameFilesWithClasses"::"never","showDartPadSampleCodeLens"::true,"showMainCodeLens"::true,"showTestCodeLens"::true,"updateImportsOnRename"::true,"warnWhenEditingFilesOutsideWorkspace"::true,"warnWhenEditingFilesInPubCache"::true,"flutterAdbConnectOnChromeOs"::false,"flutterAdditionalArgs"::[],"flutterAttachAdditionalArgs"::[],"flutterCreateAndroidLanguage"::"kotlin","flutterCreateIOSLanguage"::"swift","flutterCreatePlatforms"::null,"offline"::false,"flutterCreateOrganization"::null,"flutterCustomEmulators"::[],"flutterGutterIcons"::true,"flutterHotReloadOnSave"::"manual","hotReloadOnSave"::"never","flutterGenerateLocalizationsOnSave"::"never","flutterOutline"::true,"flutterRunAdditionalArgs"::[],"flutterScreenshotPath"::null,"flutterRememberSelectedDevice"::true,"flutterSelectDeviceWhenConnected"::true,"flutterShowEmulators"::"local","flutterShowWebServerDevice"::"remote","flutterTestAdditionalArgs"::[],"flutterTrackWidgetCreation"::true,"flutterWebRenderer"::"auto","analyzerInstrumentationLogFile"::"analyzerInstrumentationLogFile.txt","analyzerLogFile"::"analyzerLogFile.txt","dapLogFile"::null,"devToolsLogFile"::null,"extensionLogFile"::null,"flutterDaemonLogFile"::null,"flutterRunLogFile"::null,"flutterTestLogFile"::null,"maxLogLineLength"::2000,"maxCompletionItems"::100000,"dartTestLogFile"::null,"vmServiceLogFile"::null,"webDaemonLogFile"::null,"promptToGetPackages"::true,"pubAdditionalArgs"::[],"runPubGetOnPubspecChanges"::"always","runPubGetOnNestedProjects"::"none","buildRunnerAdditionalArgs"::[],"cliConsole"::"debugConsole","debugExtensionBackendProtocol"::"ws","debugSdkLibraries"::false,"debugExternalPackageLibraries"::false,"evaluateGettersInDebugViews"::true,"evaluateToStringInDebugViews"::true,"hotReloadProgress"::"notification","promptToRunIfErrors"::true,"showDartDeveloperLogs"::true,"showDebuggerNumbersAsHex"::false,"showDevToolsDebugToolBarButtons"::true,"suppressTestTimeouts"::"never","cliAdditionalArgs"::[],"testAdditionalArgs"::[],"vmAdditionalArgs"::[],"customDartDapPath"::null,"customFlutterDapPath"::null,"checkForSdkUpdates"::true,"sdkPath"::null,"sdkPaths"::[],"flutterSdkPath"::null,"flutterSdkPaths"::[],"addSdkToTerminalPath"::true,"allowTestsOutsideTestFolder"::false,"openTestView"::["testRunStart"],"showSkippedTests"::true,"testInvocationMode"::"name","projectSearchDepth"::5,"env"::{},"enableServerSnippets"::true,"normalizeFileCasing"::false,"daemonPort"::null,"previewCommitCharacters"::false,"previewFlutterUiGuides"::false,"previewFlutterUiGuidesCustomTracking"::false,"previewHotReloadOnSaveWatcher"::false,"previewSdkDaps"::null,"experimentalRefactors"::false}],"clientRequestTime"::1684846962938}
1684846962964:Res:{"id"::2,"jsonrpc"::"2.0","method"::"client/registerCapability","params"::{"registrations"::[{"id"::"0","method"::"textDocument/didOpen","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","pattern"::"**/pubspec.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/analysis_options.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/lib/fix_data.yaml","scheme"::"file"}]}},{"id"::"1","method"::"textDocument/didClose","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","pattern"::"**/pubspec.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/analysis_options.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/lib/fix_data.yaml","scheme"::"file"}]}},{"id"::"2","method"::"textDocument/didChange","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"},{"language"::"yaml","pattern"::"**/pubspec.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/analysis_options.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/lib/fix_data.yaml","scheme"::"file"}],"syncKind"::2}},{"id"::"3","method"::"textDocument/completion","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"resolveProvider"::true,"triggerCharacters"::[".","=","(","$","\"","'","{","/","::"]}},{"id"::"4","method"::"textDocument/completion","registerOptions"::{"documentSelector"::[{"language"::"yaml","pattern"::"**/pubspec.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/analysis_options.yaml","scheme"::"file"},{"language"::"yaml","pattern"::"**/lib/fix_data.yaml","scheme"::"file"}],"resolveProvider"::true}},{"id"::"5","method"::"textDocument/hover","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"6","method"::"textDocument/signatureHelp","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"retriggerCharacters"::[","],"triggerCharacters"::["("]}},{"id"::"7","method"::"textDocument/references","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"8","method"::"textDocument/documentHighlight","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"9","method"::"textDocument/documentSymbol","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"10","method"::"textDocument/documentColor","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"11","method"::"textDocument/formatting","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"12","method"::"textDocument/onTypeFormatting","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"firstTriggerCharacter"::"}","moreTriggerCharacter"::[";"]}},{"id"::"13","method"::"textDocument/rangeFormatting","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"14","method"::"textDocument/definition","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"15","method"::"textDocument/typeDefinition","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"16","method"::"textDocument/implementation","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"17","method"::"textDocument/codeAction","registerOptions"::{"codeActionKinds"::["source","source.organizeImports","source.fixAll","source.sortMembers","quickfix","refactor"],"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"18","method"::"textDocument/rename","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"prepareProvider"::true}},{"id"::"19","method"::"textDocument/foldingRange","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"20","method"::"workspace/willRenameFiles","registerOptions"::{"filters"::[{"pattern"::{"glob"::"**/*.dart","matches"::"file"},"scheme"::"file"},{"pattern"::{"glob"::"**/","matches"::"folder"},"scheme"::"file"}]}},{"id"::"21","method"::"workspace/didChangeConfiguration"},{"id"::"22","method"::"textDocument/selectionRange","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"23","method"::"textDocument/prepareCallHierarchy","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"24","method"::"textDocument/semanticTokens","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"full"::{"delta"::false},"legend"::{"tokenModifiers"::["documentation","constructor","declaration","importPrefix","instance","static","escape","annotation","control","label","interpolation","void"],"tokenTypes"::["annotation","keyword","class","comment","method","variable","parameter","enum","enumMember","type","source","property","namespace","boolean","number","string","function","typeParameter"]},"range"::true}},{"id"::"25","method"::"textDocument/prepareTypeHierarchy","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}]}},{"id"::"26","method"::"textDocument/inlayHint","registerOptions"::{"documentSelector"::[{"language"::"dart","scheme"::"file"}],"resolveProvider"::false}}]}}
1684846962976:Req:{"jsonrpc"::"2.0","id"::2,"result"::null,"clientRequestTime"::1684846962972}
1684846962979:Req:{"jsonrpc"::"2.0","method"::"textDocument/didOpen","params"::{"textDocument"::{"uri"::"file::///Users/felix/StudioProjects/tonic-ide/lib/main.dart","languageId"::"dart","version"::1,"text"::"import 'package::flutter/material.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\n//  oin rv oin verv ::3\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\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      ),\n      home:: const MyHomePage(title:: 'Flutter Demo Home Page'),\n    );\n  }\n}\n\nclass MyHomePage extends StatefulWidget {\n  const MyHomePage({super.key, required this.title});\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  State<MyHomePage> 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    // 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            const Text(\n              'You have pushed the button this many times::',\n            ),\n            Text(\n              '$_counter',\n              style:: Theme.of(context).textTheme.headlineMedium,\n            ),\n          ],\n        ),\n      ),\n      floatingActionButton:: FloatingActionButton(\n        onPressed:: _incrementCounter,\n        tooltip:: 'Increment',\n        child:: const Icon(Icons.add),\n      ), // This trailing comma makes auto-formatting nicer for build methods.\n    );\n  }\n}\n"}},"clientRequestTime"::1684846962973}
1684846962987:Req:{"jsonrpc"::"2.0","id"::1,"method"::"textDocument/documentColor","params"::{"textDocument"::{"uri"::"file::///Users/felix/StudioProjects/tonic-ide/lib/main.dart"}},"clientRequestTime"::1684846962973}
1684846962990:Req:{"jsonrpc"::"2.0","id"::2,"method"::"textDocument/codeAction","params"::{"textDocument"::{"uri"::"file::///Users/felix/StudioProjects/tonic-ide/lib/main.dart"},"range"::{"start"::{"line"::7,"character"::8},"end"::{"line"::7,"character"::8}},"context"::{"diagnostics"::[],"triggerKind"::2}},"clientRequestTime"::1684846962977}
1684846962993:Req:{"jsonrpc"::"2.0","id"::3,"method"::"textDocument/inlayHint","params"::{"textDocument"::{"uri"::"file::///Users/felix/StudioProjects/tonic-ide/lib/main.dart"},"range"::{"start"::{"line"::0,"character"::0},"end"::{"line"::65,"character"::79}}},"clientRequestTime"::1684846962979}
1684846962995:Res:{"id"::1,"jsonrpc"::"2.0","error"::{"code"::-32007,"data"::"/Users/felix/StudioProjects/tonic-ide/lib/main.dart","message"::"File is not being analyzed"}}
1684846962996:Res:{"id"::2,"jsonrpc"::"2.0","result"::[]}
Clone this wiki locally