├── .gitignore ├── languages └── dart │ ├── injections.scm │ ├── indents.scm │ ├── brackets.scm │ ├── outline.scm │ ├── config.toml │ ├── tasks.json │ ├── runnables.scm │ └── highlights.scm ├── Cargo.toml ├── README.md ├── .github └── workflows │ ├── release_version.yml │ └── bump_version.yml ├── extension.toml ├── debug_adapter_schemas └── Dart.json ├── src └── dart.rs ├── LICENSE └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | *.wasm 2 | /target 3 | grammars/ 4 | -------------------------------------------------------------------------------- /languages/dart/injections.scm: -------------------------------------------------------------------------------- 1 | ((comment) @content 2 | (#set! "language" "comment")) 3 | -------------------------------------------------------------------------------- /languages/dart/indents.scm: -------------------------------------------------------------------------------- 1 | (_ "[" "]" @end) @indent 2 | (_ "{" "}" @end) @indent 3 | (_ "(" ")" @end) @indent 4 | -------------------------------------------------------------------------------- /languages/dart/brackets.scm: -------------------------------------------------------------------------------- 1 | ("(" @open ")" @close) 2 | ("[" @open "]" @close) 3 | ("{" @open "}" @close) 4 | ("<" @open ">" @close) 5 | ("\"" @open "\"" @close) 6 | ("'" @open "'" @close) 7 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "zed_dart" 3 | version = "0.3.2" 4 | edition = "2021" 5 | publish = false 6 | license = "Apache-2.0" 7 | 8 | [lib] 9 | path = "src/dart.rs" 10 | crate-type = ["cdylib"] 11 | 12 | [dependencies] 13 | zed_extension_api = "0.7.0" 14 | -------------------------------------------------------------------------------- /languages/dart/outline.scm: -------------------------------------------------------------------------------- 1 | (class_definition 2 | "class" @context 3 | name: (_) @name) @item 4 | 5 | (function_signature 6 | name: (_) @name) @item 7 | 8 | (getter_signature 9 | "get" @context 10 | name: (_) @name) @item 11 | 12 | (setter_signature 13 | "set" @context 14 | name: (_) @name) @item 15 | 16 | (enum_declaration 17 | "enum" @context 18 | name: (_) @name) @item 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zed Dart 2 | 3 | A [Dart](https://dart.dev/) extension for [Zed](https://zed.dev). 4 | 5 | ## Documentation 6 | 7 | See: 8 | - [Zed Dart Language Docs](https://zed.dev/docs/languages/dart) 9 | - [Dart LSP Support Docs](https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/tool/lsp_spec/README.md) 10 | 11 | ## Development 12 | 13 | To develop this extension, see the [Developing Extensions](https://zed.dev/docs/extensions/developing-extensions) section of the Zed docs. 14 | -------------------------------------------------------------------------------- /.github/workflows/release_version.yml: -------------------------------------------------------------------------------- 1 | # Generated from xtask::workflows::extensions::release_version within the Zed repository. 2 | # Rebuild with `cargo xtask workflows`. 3 | name: extensions::release_version 4 | on: 5 | push: 6 | tags: 7 | - v** 8 | jobs: 9 | call_release_version: 10 | uses: zed-industries/zed/.github/workflows/extension_release.yml@main 11 | secrets: 12 | app-id: ${{ secrets.ZED_ZIPPY_APP_ID }} 13 | app-secret: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }} 14 | -------------------------------------------------------------------------------- /languages/dart/config.toml: -------------------------------------------------------------------------------- 1 | name = "Dart" 2 | grammar = "dart" 3 | path_suffixes = ["dart"] 4 | line_comments = ["// ", "/// "] 5 | autoclose_before = ";:.,=}])>" 6 | brackets = [ 7 | { start = "{", end = "}", close = true, newline = true }, 8 | { start = "[", end = "]", close = true, newline = true }, 9 | { start = "(", end = ")", close = true, newline = true }, 10 | { start = "<", end = ">", close = true, newline = false}, 11 | { start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] }, 12 | { start = "'", end = "'", close = true, newline = false, not_in = ["string"] }, 13 | { start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] }, 14 | { start = "`", end = "`", close = true, newline = false, not_in = ["string", "comment"] }, 15 | ] 16 | -------------------------------------------------------------------------------- /extension.toml: -------------------------------------------------------------------------------- 1 | id = "dart" 2 | name = "Dart" 3 | description = "Dart support." 4 | version = "0.3.2" 5 | schema_version = 1 6 | authors = [ 7 | "Abdullah Alsigar ", 8 | "Flo ", 9 | "ybbond ", 10 | "nielsenko ", 11 | ] 12 | repository = "https://github.com/zed-extensions/dart" 13 | 14 | [language_servers.dart] 15 | name = "Dart LSP" 16 | language = "Dart" 17 | languages = ["Dart"] 18 | 19 | [grammars.dart] 20 | repository = "https://github.com/UserNobody14/tree-sitter-dart" 21 | commit = "80e23c07b64494f7e21090bb3450223ef0b192f4" 22 | 23 | [debug_adapters.Dart] 24 | # Optional relative path to the JSON schema for the debug adapter configuration schema. Defaults to `debug_adapter_schemas/$DEBUG_ADAPTER_NAME_ID.json`. 25 | # Note that while this field is optional, a schema is mandatory. 26 | # schema_path = "relative/path/to/schema.json" 27 | -------------------------------------------------------------------------------- /languages/dart/tasks.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "label": "flutter run", 4 | "command": "flutter", 5 | "args": ["run"], 6 | "tags": ["flutter-main"] 7 | }, 8 | { 9 | "label": "fvm flutter run", 10 | "command": "fvm flutter", 11 | "args": ["run"], 12 | "tags": ["flutter-main"] 13 | }, 14 | { 15 | "label": "flutter test $ZED_STEM", 16 | "command": "flutter", 17 | "args": ["test", "$ZED_FILE"], 18 | "tags": ["flutter-test-main"] 19 | }, 20 | { 21 | "label": "fvm flutter test $ZED_STEM", 22 | "command": "fvm flutter", 23 | "args": ["test", "$ZED_FILE"], 24 | "tags": ["flutter-test-main"] 25 | }, 26 | { 27 | "label": "dart test file $ZED_STEM", 28 | "command": "dart", 29 | "args": ["test", "$ZED_FILE"], 30 | "tags": ["dart-test-file"] 31 | }, 32 | { 33 | "label": "dart test group $ZED_STEM", 34 | "command": "dart", 35 | "args": ["test", "\"$ZED_FILE?line=$ZED_ROW\""], 36 | "tags": ["dart-test-group"] 37 | }, 38 | { 39 | "label": "dart test single $ZED_STEM", 40 | "command": "dart", 41 | "args": ["test", "\"$ZED_FILE?line=$ZED_ROW\""], 42 | "tags": ["dart-test-single"] 43 | } 44 | ] 45 | -------------------------------------------------------------------------------- /debug_adapter_schemas/Dart.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "Dart Debug Adapter Configuration", 4 | "type": "object", 5 | "properties": { 6 | "adapter": { 7 | "type": "string", 8 | "enum": ["Dart"] 9 | }, 10 | "type": { 11 | "type": "string", 12 | "enum": ["dart", "flutter"], 13 | "description": "Debug Flutter or Dart file" 14 | }, 15 | "label": { 16 | "type": "string", 17 | "description": "Human-readable name for this debug configuration", 18 | "examples": ["Launch Dart App", "Debug Main", "Dart Console"] 19 | }, 20 | "program": { 21 | "type": "string", 22 | "description": "Path to the Dart file to debug", 23 | "examples": ["lib/main.dart", "bin/main.dart", "test/example_test.dart"] 24 | }, 25 | "cwd": { 26 | "type": "string", 27 | "description": "Path to the working directory" 28 | }, 29 | "useFvm": { 30 | "type": "boolean", 31 | "description": "Weather to use fvm to run the Dart/Flutter program" 32 | }, 33 | "args": { 34 | "type": "array", 35 | "description": "Arguments passed to the Dart program.", 36 | "items": { 37 | "type": "string" 38 | }, 39 | "default": [] 40 | }, 41 | "device_id": { 42 | "type": "string", 43 | "examples": ["chrome", "edge", "", ""] 44 | }, 45 | "platform": { 46 | "type": "string", 47 | "examples": ["web", "desktop"] 48 | }, 49 | "stopOnEntry": { 50 | "type": "boolean", 51 | "description": "Pause debugger on entry.", 52 | "default": false 53 | } 54 | }, 55 | "required": ["program", "type", "adapter"], 56 | "additionalProperties": false 57 | } 58 | -------------------------------------------------------------------------------- /.github/workflows/bump_version.yml: -------------------------------------------------------------------------------- 1 | # Generated from xtask::workflows::extensions::bump_version within the Zed repository. 2 | # Rebuild with `cargo xtask workflows`. 3 | name: extensions::bump_version 4 | on: 5 | pull_request: 6 | types: 7 | - labeled 8 | push: 9 | branches: 10 | - main 11 | paths-ignore: 12 | - .github/** 13 | workflow_dispatch: {} 14 | jobs: 15 | determine_bump_type: 16 | runs-on: namespace-profile-16x32-ubuntu-2204 17 | steps: 18 | - id: get-bump-type 19 | name: extensions::bump_version::get_bump_type 20 | run: | 21 | if [ "$HAS_MAJOR_LABEL" = "true" ]; then 22 | bump_type="major" 23 | elif [ "$HAS_MINOR_LABEL" = "true" ]; then 24 | bump_type="minor" 25 | else 26 | bump_type="patch" 27 | fi 28 | echo "bump_type=$bump_type" >> $GITHUB_OUTPUT 29 | shell: bash -euxo pipefail {0} 30 | env: 31 | HAS_MAJOR_LABEL: |- 32 | ${{ (github.event.action == 'labeled' && github.event.label.name == 'major') || 33 | (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'major')) }} 34 | HAS_MINOR_LABEL: |- 35 | ${{ (github.event.action == 'labeled' && github.event.label.name == 'minor') || 36 | (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'minor')) }} 37 | outputs: 38 | bump_type: ${{ steps.get-bump-type.outputs.bump_type }} 39 | call_bump_version: 40 | needs: 41 | - determine_bump_type 42 | if: github.event.action != 'labeled' || needs.determine_bump_type.outputs.bump_type != 'patch' 43 | uses: zed-industries/zed/.github/workflows/extension_bump.yml@main 44 | secrets: 45 | app-id: ${{ secrets.ZED_ZIPPY_APP_ID }} 46 | app-secret: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }} 47 | with: 48 | bump-type: ${{ needs.determine_bump_type.outputs.bump_type }} 49 | force-bump: true 50 | concurrency: 51 | group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}labels 52 | cancel-in-progress: true 53 | -------------------------------------------------------------------------------- /languages/dart/runnables.scm: -------------------------------------------------------------------------------- 1 | ; Flutter main 2 | ( 3 | ( 4 | (import_or_export 5 | (library_import 6 | (import_specification 7 | ("import" 8 | (configurable_uri 9 | (uri 10 | (string_literal) @_import 11 | (#match? @_import "package:flutter/(material|widgets|cupertino).dart") 12 | (#not-match? @_import "package:flutter_test/flutter_test.dart") 13 | (#not-match? @_import "package:test/test.dart") 14 | )))))) 15 | ( 16 | (function_signature 17 | name: (_) @run 18 | ) 19 | (#eq? @run "main") 20 | ) 21 | (#set! tag flutter-main) 22 | ) 23 | ) 24 | 25 | ; Flutter test main 26 | ( 27 | ( 28 | (import_or_export 29 | (library_import 30 | (import_specification 31 | ("import" 32 | (configurable_uri 33 | (uri 34 | (string_literal) @_import 35 | (#match? @_import "package:flutter_test/flutter_test.dart") 36 | )))))) 37 | ( 38 | (function_signature 39 | name: (_) @run 40 | ) 41 | (#eq? @run "main") 42 | ) 43 | (#set! tag flutter-test-main) 44 | ) 45 | ) 46 | 47 | ; Dart test file 48 | ( 49 | ( 50 | (import_or_export 51 | (library_import 52 | (import_specification 53 | ("import" 54 | (configurable_uri 55 | (uri 56 | (string_literal) @_import 57 | (#match? @_import "package:test/test.dart") 58 | )))))) 59 | ( 60 | (function_signature 61 | name: (_) @run 62 | ) 63 | (#eq? @run "main") 64 | ) 65 | (#set! tag dart-test-file) 66 | ) 67 | ) 68 | 69 | ; Dart test group 70 | ( 71 | ( 72 | (import_or_export 73 | (library_import 74 | (import_specification 75 | ("import" 76 | (configurable_uri 77 | (uri 78 | (string_literal) @_import 79 | (#match? @_import "package:test/test.dart") 80 | )))))) 81 | ( 82 | (function_body 83 | (block 84 | (expression_statement 85 | ( 86 | (identifier) @run (#eq? @run "group") 87 | ))))) 88 | (#set! tag dart-test-group) 89 | ) 90 | ) 91 | 92 | ; Dart test single 93 | ( 94 | ( 95 | (import_or_export 96 | (library_import 97 | (import_specification 98 | ("import" 99 | (configurable_uri 100 | (uri 101 | (string_literal) @_import 102 | (#match? @_import "package:test/test.dart") 103 | )))))) 104 | ( 105 | (function_body 106 | (block 107 | (expression_statement 108 | (selector 109 | (argument_part 110 | (arguments 111 | (argument 112 | (function_expression 113 | (function_expression_body 114 | (block 115 | (expression_statement 116 | ( 117 | (identifier) @run (#eq? @run "test") 118 | ))))))))))))) 119 | (#set! tag dart-test-single) 120 | ) 121 | ) 122 | -------------------------------------------------------------------------------- /languages/dart/highlights.scm: -------------------------------------------------------------------------------- 1 | (identifier) @variable 2 | (dotted_identifier_list) @string 3 | 4 | ; Methods 5 | ; -------------------- 6 | (super) @function 7 | 8 | (function_expression_body (identifier) @type) 9 | ; ((identifier)(selector (argument_part)) @function) 10 | 11 | (((identifier) @function (#match? @function "^_?[a-z]")) 12 | . (selector . (argument_part))) @function 13 | 14 | ; Annotations 15 | ; -------------------- 16 | (annotation 17 | name: (identifier) @attribute) 18 | 19 | ; Operators and Tokens 20 | ; -------------------- 21 | (template_substitution 22 | "$" @punctuation.special 23 | "{" @punctuation.special 24 | "}" @punctuation.special) @none 25 | 26 | (template_substitution 27 | "$" @punctuation.special 28 | (identifier_dollar_escaped) @variable) @none 29 | 30 | (escape_sequence) @string.escape 31 | 32 | [ 33 | "@" 34 | "=>" 35 | ".." 36 | "??" 37 | "==" 38 | "?" 39 | ":" 40 | "&&" 41 | "%" 42 | "<" 43 | ">" 44 | "=" 45 | ">=" 46 | "<=" 47 | "||" 48 | (multiplicative_operator) 49 | (increment_operator) 50 | (is_operator) 51 | (prefix_operator) 52 | (equality_operator) 53 | (additive_operator) 54 | ] @operator 55 | 56 | [ 57 | "(" 58 | ")" 59 | "[" 60 | "]" 61 | "{" 62 | "}" 63 | ] @punctuation.bracket 64 | 65 | ; Delimiters 66 | ; -------------------- 67 | [ 68 | ";" 69 | "." 70 | "," 71 | ] @punctuation.delimiter 72 | 73 | ; Types 74 | ; -------------------- 75 | (class_definition 76 | name: (identifier) @type) 77 | (constructor_signature 78 | name: (identifier) @type) 79 | (scoped_identifier 80 | scope: (identifier) @type) 81 | (function_signature 82 | name: (identifier) @function.method) 83 | 84 | (enum_declaration 85 | name: (identifier) @type) 86 | (enum_constant 87 | name: (identifier) @property) 88 | 89 | ((scoped_identifier 90 | scope: (identifier) @type 91 | name: (identifier) @type) 92 | (#match? @type "^[a-zA-Z]")) 93 | 94 | (type_identifier) @type 95 | 96 | (type_alias 97 | (type_identifier) @type.definition) 98 | 99 | ; Variables 100 | ; -------------------- 101 | ; var keyword 102 | (inferred_type) @keyword 103 | 104 | ((identifier) @type 105 | (#match? @type "^_?[A-Z].*[a-z]")) 106 | 107 | ; properties 108 | (unconditional_assignable_selector 109 | (identifier) @property) 110 | 111 | (conditional_assignable_selector 112 | (identifier) @property) 113 | 114 | (cascade_selector 115 | (identifier) @property) 116 | 117 | (getter_signature 118 | (identifier) @property) 119 | (setter_signature 120 | name: (identifier) @property) 121 | 122 | ((selector 123 | (unconditional_assignable_selector (identifier) @function.method)) 124 | . (selector (argument_part (arguments))) 125 | ) 126 | 127 | ((selector 128 | (conditional_assignable_selector (identifier) @function.method)) 129 | . (selector (argument_part (arguments))) 130 | ) 131 | 132 | ((cascade_section 133 | (cascade_selector (identifier) @function.method) 134 | . (argument_part (arguments))) 135 | ) 136 | 137 | ; Some methods do not have a selector as a parent of the conditional_assignable_selector 138 | ; For example, super methods. 139 | ((unconditional_assignable_selector (identifier) @function.method) 140 | . (selector (argument_part (arguments))) 141 | ) 142 | 143 | ((conditional_assignable_selector (identifier) @function.method) 144 | . (selector (argument_part (arguments))) 145 | ) 146 | 147 | ; assignments 148 | (assignment_expression 149 | left: (assignable_expression) @variable) 150 | 151 | (this) @variable.builtin 152 | 153 | ; Parameters 154 | ; -------------------- 155 | (formal_parameter 156 | (identifier) @variable.parameter) 157 | 158 | (named_argument 159 | (label 160 | (identifier) @variable.parameter)) 161 | 162 | ; Literals 163 | ; -------------------- 164 | [ 165 | (hex_integer_literal) 166 | (decimal_integer_literal) 167 | (decimal_floating_point_literal) 168 | ; TODO: inaccessible nodes 169 | ; (octal_integer_literal) 170 | ; (hex_floating_point_literal) 171 | ] @number 172 | 173 | (symbol_literal) @string.special.symbol 174 | 175 | (string_literal) @string 176 | (true) @boolean 177 | (false) @boolean 178 | (null_literal) @constant.builtin 179 | 180 | (comment) @comment 181 | 182 | (documentation_comment) @comment.documentation 183 | 184 | ; Keywords 185 | ; -------------------- 186 | [ 187 | "import" 188 | "library" 189 | "export" 190 | "as" 191 | "show" 192 | "hide" 193 | ] @keyword.import 194 | 195 | ; Reserved words (cannot be used as identifiers) 196 | [ 197 | (case_builtin) 198 | (void_type) 199 | "late" 200 | "required" 201 | "extension" 202 | "on" 203 | "class" 204 | "enum" 205 | "extends" 206 | "in" 207 | "is" 208 | "new" 209 | "super" 210 | "with" 211 | "Function" 212 | ] @keyword.definition 213 | 214 | "return" @keyword.return 215 | 216 | ; Built in identifiers: 217 | ; alone these are marked as keywords 218 | [ 219 | (part_of_builtin) 220 | "deferred" 221 | "factory" 222 | "get" 223 | "implements" 224 | "interface" 225 | "library" 226 | "operator" 227 | "mixin" 228 | "part" 229 | "set" 230 | "typedef" 231 | ] @keyword 232 | 233 | [ 234 | "async" 235 | "async*" 236 | "sync*" 237 | "await" 238 | "yield" 239 | ] @keyword.coroutine 240 | 241 | [ 242 | (const_builtin) 243 | (final_builtin) 244 | "abstract" 245 | "covariant" 246 | "dynamic" 247 | "external" 248 | "static" 249 | "final" 250 | "base" 251 | "sealed" 252 | ] @keyword.modifier ; could be @type.qualifier 253 | 254 | ; when used as an identifier: 255 | ((identifier) @variable.builtin 256 | (#any-of? @variable.builtin 257 | "abstract" 258 | "as" 259 | "covariant" 260 | "deferred" 261 | "dynamic" 262 | "export" 263 | "external" 264 | "factory" 265 | "Function" 266 | "get" 267 | "implements" 268 | "import" 269 | "interface" 270 | "library" 271 | "operator" 272 | "mixin" 273 | "part" 274 | "set" 275 | "static" 276 | "typedef")) 277 | 278 | [ 279 | "if" 280 | "else" 281 | "switch" 282 | "default" 283 | ] @keyword.conditional 284 | 285 | [ 286 | "try" 287 | "throw" 288 | "catch" 289 | "finally" 290 | (break_statement) 291 | ] @keyword.exception 292 | 293 | [ 294 | "do" 295 | "while" 296 | "continue" 297 | "for" 298 | ] @keyword.repeat 299 | -------------------------------------------------------------------------------- /src/dart.rs: -------------------------------------------------------------------------------- 1 | use zed::lsp::CompletionKind; 2 | use zed::settings::LspSettings; 3 | use zed::{CodeLabel, CodeLabelSpan}; 4 | use zed_extension_api::serde_json::json; 5 | use zed_extension_api::{ 6 | self as zed, current_platform, serde_json, DebugAdapterBinary, DebugTaskDefinition, Os, Result, 7 | StartDebuggingRequestArguments, StartDebuggingRequestArgumentsRequest, Worktree, 8 | }; 9 | 10 | struct DartBinary { 11 | pub path: String, 12 | pub args: Option>, 13 | } 14 | 15 | struct DartExtension; 16 | 17 | impl DartExtension { 18 | fn language_server_binary( 19 | &mut self, 20 | _language_server_id: &zed::LanguageServerId, 21 | worktree: &zed::Worktree, 22 | ) -> Result { 23 | let binary_settings = LspSettings::for_worktree("dart", worktree) 24 | .ok() 25 | .and_then(|lsp_settings| lsp_settings.binary); 26 | let binary_args = binary_settings 27 | .as_ref() 28 | .and_then(|binary_settings| binary_settings.arguments.clone()); 29 | 30 | if let Some(path) = binary_settings.and_then(|binary_settings| binary_settings.path) { 31 | return Ok(DartBinary { 32 | path, 33 | args: binary_args, 34 | }); 35 | } 36 | 37 | if let Some(path) = worktree.which("dart") { 38 | return Ok(DartBinary { 39 | path, 40 | args: binary_args, 41 | }); 42 | } 43 | 44 | Err( 45 | "dart must be installed from dart.dev/get-dart or pointed to by the LSP binary settings" 46 | .to_string(), 47 | ) 48 | } 49 | } 50 | 51 | impl zed::Extension for DartExtension { 52 | fn new() -> Self { 53 | Self 54 | } 55 | 56 | /// ref: 57 | /// https://github.com/zed-industries/zed/blob/main/crates/dap_adapters/src/gdb.rs 58 | fn get_dap_binary( 59 | &mut self, 60 | _adapter_name: String, 61 | config: DebugTaskDefinition, 62 | _user_provided_debug_adapter_path: Option, 63 | worktree: &Worktree, 64 | ) -> Result { 65 | let user_config: serde_json::Value = serde_json::from_str(&config.config) 66 | .map_err(|e| format!("Failed to parse debug config: {e}"))?; 67 | 68 | let program = user_config 69 | .get("program") 70 | .and_then(|v| v.as_str()) 71 | .unwrap_or("lib/main.dart"); 72 | 73 | let args = user_config 74 | .get("args") 75 | .and_then(|v| v.as_array()) 76 | .map(|arr| { 77 | arr.iter() 78 | .filter_map(|v| v.as_str()) 79 | .map(|s| s.to_string()) 80 | .collect::>() 81 | }) 82 | .unwrap_or_default(); 83 | 84 | let use_fvm = user_config 85 | .get("useFvm") 86 | .and_then(|v| v.as_bool()) 87 | .unwrap_or(false); 88 | 89 | // Get debug_mode from user config (flutter or dart) 90 | let debug_mode = user_config 91 | .get("type") 92 | .and_then(|v| v.as_str()) 93 | .filter(|s| !s.trim().is_empty()) // Filter out empty strings 94 | .ok_or_else(|| "type is required and cannot be empty or null".to_string())?; 95 | 96 | let (os, _) = current_platform(); 97 | let tool = if debug_mode == "flutter" { 98 | match os { 99 | Os::Windows => "flutter.bat", 100 | _ => "flutter", 101 | } 102 | } else { 103 | match os { 104 | Os::Windows => "dart.bat", 105 | _ => "dart", 106 | } 107 | }; 108 | 109 | let (command, arguments) = if use_fvm { 110 | ( 111 | "fvm".to_string(), 112 | vec![tool.to_string(), "debug_adapter".to_string()], 113 | ) 114 | } else { 115 | (tool.to_string(), vec!["debug_adapter".to_string()]) 116 | }; 117 | 118 | let device_id = user_config 119 | .get("device_id") 120 | .and_then(|v| v.as_str()) 121 | .unwrap_or("chrome"); 122 | 123 | let platform = user_config 124 | .get("platform") 125 | .and_then(|v| v.as_str()) 126 | .unwrap_or("web"); 127 | 128 | let cwd = user_config 129 | .get("cwd") 130 | .and_then(|v| v.as_str()) 131 | .map(|s| s.to_string()) 132 | .or_else(|| Some(worktree.root_path())); 133 | 134 | let config_json = json!({ 135 | "type": tool, 136 | "request": "launch", 137 | "program": program, 138 | "cwd": cwd.clone().unwrap_or_default(), 139 | "args": args, 140 | "flutterMode": "debug", 141 | "deviceId": device_id, 142 | "platform": platform, 143 | "stopOnEntry": false 144 | }) 145 | .to_string(); 146 | 147 | let debug_adapter_binary = DebugAdapterBinary { 148 | command: Some(command), 149 | arguments, 150 | envs: vec![], // Add any Dart-specific env vars if needed 151 | cwd, 152 | connection: None, 153 | request_args: StartDebuggingRequestArguments { 154 | configuration: config_json, 155 | request: StartDebuggingRequestArgumentsRequest::Launch, 156 | }, // request_args: StartDebuggingRequestArguments:, 157 | }; 158 | Result::Ok(debug_adapter_binary) 159 | } 160 | 161 | fn dap_request_kind( 162 | &mut self, 163 | _adapter_name: String, 164 | _config: serde_json::Value, 165 | ) -> Result { 166 | Ok(StartDebuggingRequestArgumentsRequest::Launch) 167 | } 168 | 169 | fn language_server_command( 170 | &mut self, 171 | language_server_id: &zed::LanguageServerId, 172 | worktree: &zed::Worktree, 173 | ) -> Result { 174 | let dart_binary = self.language_server_binary(language_server_id, worktree)?; 175 | 176 | Ok(zed::Command { 177 | command: dart_binary.path, 178 | args: dart_binary.args.unwrap_or_else(|| { 179 | vec!["language-server".to_string(), "--protocol=lsp".to_string()] 180 | }), 181 | env: Default::default(), 182 | }) 183 | } 184 | 185 | fn language_server_workspace_configuration( 186 | &mut self, 187 | _language_server_id: &zed::LanguageServerId, 188 | worktree: &zed::Worktree, 189 | ) -> Result> { 190 | let settings = LspSettings::for_worktree("dart", worktree) 191 | .ok() 192 | .and_then(|lsp_settings| lsp_settings.settings.clone()) 193 | .unwrap_or_default(); 194 | 195 | Ok(Some(serde_json::json!({ 196 | "dart": settings 197 | }))) 198 | } 199 | 200 | fn label_for_completion( 201 | &self, 202 | _language_server_id: &zed::LanguageServerId, 203 | completion: zed::lsp::Completion, 204 | ) -> Option { 205 | let arrow = " → "; 206 | 207 | match completion.kind? { 208 | CompletionKind::Class => Some(CodeLabel { 209 | filter_range: (0..completion.label.len()).into(), 210 | spans: vec![CodeLabelSpan::literal( 211 | completion.label, 212 | Some("type".into()), 213 | )], 214 | code: String::new(), 215 | }), 216 | CompletionKind::Function | CompletionKind::Constructor | CompletionKind::Method => { 217 | let mut parts = completion.detail.as_ref()?.split(arrow); 218 | let (name, _) = completion.label.split_once('(')?; 219 | let parameter_list = parts.next()?; 220 | let return_type = parts.next()?; 221 | let fn_name = " a"; 222 | let fat_arrow = " => "; 223 | let call_expr = "();"; 224 | 225 | let code = 226 | format!("{return_type}{fn_name}{parameter_list}{fat_arrow}{name}{call_expr}"); 227 | 228 | let parameter_list_start = return_type.len() + fn_name.len(); 229 | 230 | Some(CodeLabel { 231 | spans: vec![ 232 | CodeLabelSpan::code_range( 233 | code.len() - call_expr.len() - name.len()..code.len() - call_expr.len(), 234 | ), 235 | CodeLabelSpan::code_range( 236 | parameter_list_start..parameter_list_start + parameter_list.len(), 237 | ), 238 | CodeLabelSpan::literal(arrow, None), 239 | CodeLabelSpan::code_range(0..return_type.len()), 240 | ], 241 | filter_range: (0..name.len()).into(), 242 | code, 243 | }) 244 | } 245 | CompletionKind::Property => { 246 | let class_start = "class A {"; 247 | let get = " get "; 248 | let property_end = " => a; }"; 249 | let ty = completion.detail?; 250 | let name = completion.label; 251 | 252 | let code = format!("{class_start}{ty}{get}{name}{property_end}"); 253 | let name_start = class_start.len() + ty.len() + get.len(); 254 | 255 | Some(CodeLabel { 256 | spans: vec![ 257 | CodeLabelSpan::code_range(name_start..name_start + name.len()), 258 | CodeLabelSpan::literal(arrow, None), 259 | CodeLabelSpan::code_range(class_start.len()..class_start.len() + ty.len()), 260 | ], 261 | filter_range: (0..name.len()).into(), 262 | code, 263 | }) 264 | } 265 | CompletionKind::Variable => { 266 | let name = completion.label; 267 | 268 | Some(CodeLabel { 269 | filter_range: (0..name.len()).into(), 270 | spans: vec![CodeLabelSpan::literal(name, Some("variable".into()))], 271 | code: String::new(), 272 | }) 273 | } 274 | _ => None, 275 | } 276 | } 277 | } 278 | 279 | zed::register_extension!(DartExtension); 280 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2022-2024 Zed Industries, Inc. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "adler2" 7 | version = "2.0.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 10 | 11 | [[package]] 12 | name = "anyhow" 13 | version = "1.0.100" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" 16 | 17 | [[package]] 18 | name = "auditable-serde" 19 | version = "0.8.0" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "5c7bf8143dfc3c0258df908843e169b5cc5fcf76c7718bd66135ef4a9cd558c5" 22 | dependencies = [ 23 | "semver", 24 | "serde", 25 | "serde_json", 26 | "topological-sort", 27 | ] 28 | 29 | [[package]] 30 | name = "bitflags" 31 | version = "2.10.0" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 34 | 35 | [[package]] 36 | name = "cfg-if" 37 | version = "1.0.4" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 40 | 41 | [[package]] 42 | name = "crc32fast" 43 | version = "1.5.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" 46 | dependencies = [ 47 | "cfg-if", 48 | ] 49 | 50 | [[package]] 51 | name = "displaydoc" 52 | version = "0.2.5" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 55 | dependencies = [ 56 | "proc-macro2", 57 | "quote", 58 | "syn", 59 | ] 60 | 61 | [[package]] 62 | name = "equivalent" 63 | version = "1.0.2" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 66 | 67 | [[package]] 68 | name = "flate2" 69 | version = "1.1.5" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" 72 | dependencies = [ 73 | "crc32fast", 74 | "miniz_oxide", 75 | ] 76 | 77 | [[package]] 78 | name = "foldhash" 79 | version = "0.1.5" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" 82 | 83 | [[package]] 84 | name = "form_urlencoded" 85 | version = "1.2.2" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 88 | dependencies = [ 89 | "percent-encoding", 90 | ] 91 | 92 | [[package]] 93 | name = "futures" 94 | version = "0.3.31" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" 97 | dependencies = [ 98 | "futures-channel", 99 | "futures-core", 100 | "futures-executor", 101 | "futures-io", 102 | "futures-sink", 103 | "futures-task", 104 | "futures-util", 105 | ] 106 | 107 | [[package]] 108 | name = "futures-channel" 109 | version = "0.3.31" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 112 | dependencies = [ 113 | "futures-core", 114 | "futures-sink", 115 | ] 116 | 117 | [[package]] 118 | name = "futures-core" 119 | version = "0.3.31" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 122 | 123 | [[package]] 124 | name = "futures-executor" 125 | version = "0.3.31" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" 128 | dependencies = [ 129 | "futures-core", 130 | "futures-task", 131 | "futures-util", 132 | ] 133 | 134 | [[package]] 135 | name = "futures-io" 136 | version = "0.3.31" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 139 | 140 | [[package]] 141 | name = "futures-macro" 142 | version = "0.3.31" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" 145 | dependencies = [ 146 | "proc-macro2", 147 | "quote", 148 | "syn", 149 | ] 150 | 151 | [[package]] 152 | name = "futures-sink" 153 | version = "0.3.31" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 156 | 157 | [[package]] 158 | name = "futures-task" 159 | version = "0.3.31" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 162 | 163 | [[package]] 164 | name = "futures-util" 165 | version = "0.3.31" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 168 | dependencies = [ 169 | "futures-channel", 170 | "futures-core", 171 | "futures-io", 172 | "futures-macro", 173 | "futures-sink", 174 | "futures-task", 175 | "memchr", 176 | "pin-project-lite", 177 | "pin-utils", 178 | "slab", 179 | ] 180 | 181 | [[package]] 182 | name = "hashbrown" 183 | version = "0.15.5" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 186 | dependencies = [ 187 | "foldhash", 188 | ] 189 | 190 | [[package]] 191 | name = "hashbrown" 192 | version = "0.16.1" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" 195 | 196 | [[package]] 197 | name = "heck" 198 | version = "0.5.0" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 201 | 202 | [[package]] 203 | name = "icu_collections" 204 | version = "2.1.1" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" 207 | dependencies = [ 208 | "displaydoc", 209 | "potential_utf", 210 | "yoke", 211 | "zerofrom", 212 | "zerovec", 213 | ] 214 | 215 | [[package]] 216 | name = "icu_locale_core" 217 | version = "2.1.1" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" 220 | dependencies = [ 221 | "displaydoc", 222 | "litemap", 223 | "tinystr", 224 | "writeable", 225 | "zerovec", 226 | ] 227 | 228 | [[package]] 229 | name = "icu_normalizer" 230 | version = "2.1.1" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" 233 | dependencies = [ 234 | "icu_collections", 235 | "icu_normalizer_data", 236 | "icu_properties", 237 | "icu_provider", 238 | "smallvec", 239 | "zerovec", 240 | ] 241 | 242 | [[package]] 243 | name = "icu_normalizer_data" 244 | version = "2.1.1" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" 247 | 248 | [[package]] 249 | name = "icu_properties" 250 | version = "2.1.2" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" 253 | dependencies = [ 254 | "icu_collections", 255 | "icu_locale_core", 256 | "icu_properties_data", 257 | "icu_provider", 258 | "zerotrie", 259 | "zerovec", 260 | ] 261 | 262 | [[package]] 263 | name = "icu_properties_data" 264 | version = "2.1.2" 265 | source = "registry+https://github.com/rust-lang/crates.io-index" 266 | checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" 267 | 268 | [[package]] 269 | name = "icu_provider" 270 | version = "2.1.1" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" 273 | dependencies = [ 274 | "displaydoc", 275 | "icu_locale_core", 276 | "writeable", 277 | "yoke", 278 | "zerofrom", 279 | "zerotrie", 280 | "zerovec", 281 | ] 282 | 283 | [[package]] 284 | name = "id-arena" 285 | version = "2.2.1" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" 288 | 289 | [[package]] 290 | name = "idna" 291 | version = "1.1.0" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" 294 | dependencies = [ 295 | "idna_adapter", 296 | "smallvec", 297 | "utf8_iter", 298 | ] 299 | 300 | [[package]] 301 | name = "idna_adapter" 302 | version = "1.2.1" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 305 | dependencies = [ 306 | "icu_normalizer", 307 | "icu_properties", 308 | ] 309 | 310 | [[package]] 311 | name = "indexmap" 312 | version = "2.12.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" 315 | dependencies = [ 316 | "equivalent", 317 | "hashbrown 0.16.1", 318 | "serde", 319 | "serde_core", 320 | ] 321 | 322 | [[package]] 323 | name = "itoa" 324 | version = "1.0.15" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 327 | 328 | [[package]] 329 | name = "leb128fmt" 330 | version = "0.1.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" 333 | 334 | [[package]] 335 | name = "litemap" 336 | version = "0.8.1" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" 339 | 340 | [[package]] 341 | name = "log" 342 | version = "0.4.29" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 345 | 346 | [[package]] 347 | name = "memchr" 348 | version = "2.7.6" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 351 | 352 | [[package]] 353 | name = "miniz_oxide" 354 | version = "0.8.9" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" 357 | dependencies = [ 358 | "adler2", 359 | "simd-adler32", 360 | ] 361 | 362 | [[package]] 363 | name = "once_cell" 364 | version = "1.21.3" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 367 | 368 | [[package]] 369 | name = "percent-encoding" 370 | version = "2.3.2" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 373 | 374 | [[package]] 375 | name = "pin-project-lite" 376 | version = "0.2.16" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 379 | 380 | [[package]] 381 | name = "pin-utils" 382 | version = "0.1.0" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 385 | 386 | [[package]] 387 | name = "potential_utf" 388 | version = "0.1.4" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" 391 | dependencies = [ 392 | "zerovec", 393 | ] 394 | 395 | [[package]] 396 | name = "prettyplease" 397 | version = "0.2.37" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" 400 | dependencies = [ 401 | "proc-macro2", 402 | "syn", 403 | ] 404 | 405 | [[package]] 406 | name = "proc-macro2" 407 | version = "1.0.103" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" 410 | dependencies = [ 411 | "unicode-ident", 412 | ] 413 | 414 | [[package]] 415 | name = "quote" 416 | version = "1.0.42" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 419 | dependencies = [ 420 | "proc-macro2", 421 | ] 422 | 423 | [[package]] 424 | name = "ryu" 425 | version = "1.0.20" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 428 | 429 | [[package]] 430 | name = "semver" 431 | version = "1.0.27" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 434 | dependencies = [ 435 | "serde", 436 | "serde_core", 437 | ] 438 | 439 | [[package]] 440 | name = "serde" 441 | version = "1.0.228" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 444 | dependencies = [ 445 | "serde_core", 446 | "serde_derive", 447 | ] 448 | 449 | [[package]] 450 | name = "serde_core" 451 | version = "1.0.228" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 454 | dependencies = [ 455 | "serde_derive", 456 | ] 457 | 458 | [[package]] 459 | name = "serde_derive" 460 | version = "1.0.228" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 463 | dependencies = [ 464 | "proc-macro2", 465 | "quote", 466 | "syn", 467 | ] 468 | 469 | [[package]] 470 | name = "serde_json" 471 | version = "1.0.145" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" 474 | dependencies = [ 475 | "itoa", 476 | "memchr", 477 | "ryu", 478 | "serde", 479 | "serde_core", 480 | ] 481 | 482 | [[package]] 483 | name = "simd-adler32" 484 | version = "0.3.8" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" 487 | 488 | [[package]] 489 | name = "slab" 490 | version = "0.4.11" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" 493 | 494 | [[package]] 495 | name = "smallvec" 496 | version = "1.15.1" 497 | source = "registry+https://github.com/rust-lang/crates.io-index" 498 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 499 | 500 | [[package]] 501 | name = "spdx" 502 | version = "0.10.9" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "c3e17e880bafaeb362a7b751ec46bdc5b61445a188f80e0606e68167cd540fa3" 505 | dependencies = [ 506 | "smallvec", 507 | ] 508 | 509 | [[package]] 510 | name = "stable_deref_trait" 511 | version = "1.2.1" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" 514 | 515 | [[package]] 516 | name = "syn" 517 | version = "2.0.111" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" 520 | dependencies = [ 521 | "proc-macro2", 522 | "quote", 523 | "unicode-ident", 524 | ] 525 | 526 | [[package]] 527 | name = "synstructure" 528 | version = "0.13.2" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 531 | dependencies = [ 532 | "proc-macro2", 533 | "quote", 534 | "syn", 535 | ] 536 | 537 | [[package]] 538 | name = "tinystr" 539 | version = "0.8.2" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" 542 | dependencies = [ 543 | "displaydoc", 544 | "zerovec", 545 | ] 546 | 547 | [[package]] 548 | name = "topological-sort" 549 | version = "0.2.2" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" 552 | 553 | [[package]] 554 | name = "unicode-ident" 555 | version = "1.0.22" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 558 | 559 | [[package]] 560 | name = "unicode-xid" 561 | version = "0.2.6" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" 564 | 565 | [[package]] 566 | name = "url" 567 | version = "2.5.7" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" 570 | dependencies = [ 571 | "form_urlencoded", 572 | "idna", 573 | "percent-encoding", 574 | "serde", 575 | ] 576 | 577 | [[package]] 578 | name = "utf8_iter" 579 | version = "1.0.4" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 582 | 583 | [[package]] 584 | name = "wasm-encoder" 585 | version = "0.227.1" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822" 588 | dependencies = [ 589 | "leb128fmt", 590 | "wasmparser", 591 | ] 592 | 593 | [[package]] 594 | name = "wasm-metadata" 595 | version = "0.227.1" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "ce1ef0faabbbba6674e97a56bee857ccddf942785a336c8b47b42373c922a91d" 598 | dependencies = [ 599 | "anyhow", 600 | "auditable-serde", 601 | "flate2", 602 | "indexmap", 603 | "serde", 604 | "serde_derive", 605 | "serde_json", 606 | "spdx", 607 | "url", 608 | "wasm-encoder", 609 | "wasmparser", 610 | ] 611 | 612 | [[package]] 613 | name = "wasmparser" 614 | version = "0.227.1" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2" 617 | dependencies = [ 618 | "bitflags", 619 | "hashbrown 0.15.5", 620 | "indexmap", 621 | "semver", 622 | ] 623 | 624 | [[package]] 625 | name = "wit-bindgen" 626 | version = "0.41.0" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "10fb6648689b3929d56bbc7eb1acf70c9a42a29eb5358c67c10f54dbd5d695de" 629 | dependencies = [ 630 | "wit-bindgen-rt", 631 | "wit-bindgen-rust-macro", 632 | ] 633 | 634 | [[package]] 635 | name = "wit-bindgen-core" 636 | version = "0.41.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "92fa781d4f2ff6d3f27f3cc9b74a73327b31ca0dc4a3ef25a0ce2983e0e5af9b" 639 | dependencies = [ 640 | "anyhow", 641 | "heck", 642 | "wit-parser", 643 | ] 644 | 645 | [[package]] 646 | name = "wit-bindgen-rt" 647 | version = "0.41.0" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "c4db52a11d4dfb0a59f194c064055794ee6564eb1ced88c25da2cf76e50c5621" 650 | dependencies = [ 651 | "bitflags", 652 | "futures", 653 | "once_cell", 654 | ] 655 | 656 | [[package]] 657 | name = "wit-bindgen-rust" 658 | version = "0.41.0" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "9d0809dc5ba19e2e98661bf32fc0addc5a3ca5bf3a6a7083aa6ba484085ff3ce" 661 | dependencies = [ 662 | "anyhow", 663 | "heck", 664 | "indexmap", 665 | "prettyplease", 666 | "syn", 667 | "wasm-metadata", 668 | "wit-bindgen-core", 669 | "wit-component", 670 | ] 671 | 672 | [[package]] 673 | name = "wit-bindgen-rust-macro" 674 | version = "0.41.0" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "ad19eec017904e04c60719592a803ee5da76cb51c81e3f6fbf9457f59db49799" 677 | dependencies = [ 678 | "anyhow", 679 | "prettyplease", 680 | "proc-macro2", 681 | "quote", 682 | "syn", 683 | "wit-bindgen-core", 684 | "wit-bindgen-rust", 685 | ] 686 | 687 | [[package]] 688 | name = "wit-component" 689 | version = "0.227.1" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "635c3adc595422cbf2341a17fb73a319669cc8d33deed3a48368a841df86b676" 692 | dependencies = [ 693 | "anyhow", 694 | "bitflags", 695 | "indexmap", 696 | "log", 697 | "serde", 698 | "serde_derive", 699 | "serde_json", 700 | "wasm-encoder", 701 | "wasm-metadata", 702 | "wasmparser", 703 | "wit-parser", 704 | ] 705 | 706 | [[package]] 707 | name = "wit-parser" 708 | version = "0.227.1" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11" 711 | dependencies = [ 712 | "anyhow", 713 | "id-arena", 714 | "indexmap", 715 | "log", 716 | "semver", 717 | "serde", 718 | "serde_derive", 719 | "serde_json", 720 | "unicode-xid", 721 | "wasmparser", 722 | ] 723 | 724 | [[package]] 725 | name = "writeable" 726 | version = "0.6.2" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" 729 | 730 | [[package]] 731 | name = "yoke" 732 | version = "0.8.1" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" 735 | dependencies = [ 736 | "stable_deref_trait", 737 | "yoke-derive", 738 | "zerofrom", 739 | ] 740 | 741 | [[package]] 742 | name = "yoke-derive" 743 | version = "0.8.1" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" 746 | dependencies = [ 747 | "proc-macro2", 748 | "quote", 749 | "syn", 750 | "synstructure", 751 | ] 752 | 753 | [[package]] 754 | name = "zed_dart" 755 | version = "0.3.2" 756 | dependencies = [ 757 | "zed_extension_api", 758 | ] 759 | 760 | [[package]] 761 | name = "zed_extension_api" 762 | version = "0.7.0" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "0729d50b4ca0a7e28e590bbe32e3ca0194d97ef654961451a424c661a366fca0" 765 | dependencies = [ 766 | "serde", 767 | "serde_json", 768 | "wit-bindgen", 769 | ] 770 | 771 | [[package]] 772 | name = "zerofrom" 773 | version = "0.1.6" 774 | source = "registry+https://github.com/rust-lang/crates.io-index" 775 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 776 | dependencies = [ 777 | "zerofrom-derive", 778 | ] 779 | 780 | [[package]] 781 | name = "zerofrom-derive" 782 | version = "0.1.6" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 785 | dependencies = [ 786 | "proc-macro2", 787 | "quote", 788 | "syn", 789 | "synstructure", 790 | ] 791 | 792 | [[package]] 793 | name = "zerotrie" 794 | version = "0.2.3" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" 797 | dependencies = [ 798 | "displaydoc", 799 | "yoke", 800 | "zerofrom", 801 | ] 802 | 803 | [[package]] 804 | name = "zerovec" 805 | version = "0.11.5" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" 808 | dependencies = [ 809 | "yoke", 810 | "zerofrom", 811 | "zerovec-derive", 812 | ] 813 | 814 | [[package]] 815 | name = "zerovec-derive" 816 | version = "0.11.2" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" 819 | dependencies = [ 820 | "proc-macro2", 821 | "quote", 822 | "syn", 823 | ] 824 | --------------------------------------------------------------------------------