aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yaml82
-rw-r--r--.gitignore3
-rw-r--r--Cargo.lock701
-rw-r--r--Cargo.toml7
-rw-r--r--README.md1
-rw-r--r--crates/expect/Cargo.toml14
-rw-r--r--crates/expect/src/lib.rs356
-rw-r--r--crates/flycheck/Cargo.toml (renamed from crates/ra_flycheck/Cargo.toml)3
-rw-r--r--crates/flycheck/src/lib.rs317
-rw-r--r--crates/paths/Cargo.toml9
-rw-r--r--crates/paths/src/lib.rs217
-rw-r--r--crates/ra_arena/Cargo.toml1
-rw-r--r--crates/ra_arena/src/lib.rs3
-rw-r--r--crates/ra_assists/Cargo.toml1
-rw-r--r--crates/ra_assists/src/assist_config.rs5
-rw-r--r--crates/ra_assists/src/assist_context.rs87
-rw-r--r--crates/ra_assists/src/ast_transform.rs18
-rw-r--r--crates/ra_assists/src/handlers/add_custom_impl.rs4
-rw-r--r--crates/ra_assists/src/handlers/add_explicit_type.rs10
-rw-r--r--crates/ra_assists/src/handlers/add_impl.rs98
-rw-r--r--crates/ra_assists/src/handlers/add_missing_impl_members.rs35
-rw-r--r--crates/ra_assists/src/handlers/add_turbo_fish.rs13
-rw-r--r--crates/ra_assists/src/handlers/apply_demorgan.rs17
-rw-r--r--crates/ra_assists/src/handlers/auto_import.rs279
-rw-r--r--crates/ra_assists/src/handlers/change_return_type_to_result.rs37
-rw-r--r--crates/ra_assists/src/handlers/change_visibility.rs48
-rw-r--r--crates/ra_assists/src/handlers/early_return.rs156
-rw-r--r--crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs321
-rw-r--r--crates/ra_assists/src/handlers/extract_variable.rs (renamed from crates/ra_assists/src/handlers/introduce_variable.rs)270
-rw-r--r--crates/ra_assists/src/handlers/fill_match_arms.rs257
-rw-r--r--crates/ra_assists/src/handlers/fix_visibility.rs208
-rw-r--r--crates/ra_assists/src/handlers/flip_binexpr.rs21
-rw-r--r--crates/ra_assists/src/handlers/flip_comma.rs15
-rw-r--r--crates/ra_assists/src/handlers/flip_trait_bound.rs15
-rw-r--r--crates/ra_assists/src/handlers/generate_derive.rs (renamed from crates/ra_assists/src/handlers/add_derive.rs)63
-rw-r--r--crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs (renamed from crates/ra_assists/src/handlers/add_from_impl_for_enum.rs)24
-rw-r--r--crates/ra_assists/src/handlers/generate_function.rs (renamed from crates/ra_assists/src/handlers/add_function.rs)91
-rw-r--r--crates/ra_assists/src/handlers/generate_impl.rs109
-rw-r--r--crates/ra_assists/src/handlers/generate_new.rs (renamed from crates/ra_assists/src/handlers/add_new.rs)46
-rw-r--r--crates/ra_assists/src/handlers/inline_local_variable.rs24
-rw-r--r--crates/ra_assists/src/handlers/introduce_named_lifetime.rs (renamed from crates/ra_assists/src/handlers/change_lifetime_anon_to_named.rs)85
-rw-r--r--crates/ra_assists/src/handlers/invert_if.rs4
-rw-r--r--crates/ra_assists/src/handlers/merge_imports.rs25
-rw-r--r--crates/ra_assists/src/handlers/merge_match_arms.rs50
-rw-r--r--crates/ra_assists/src/handlers/move_bounds.rs55
-rw-r--r--crates/ra_assists/src/handlers/move_guard.rs29
-rw-r--r--crates/ra_assists/src/handlers/raw_string.rs135
-rw-r--r--crates/ra_assists/src/handlers/remove_dbg.rs4
-rw-r--r--crates/ra_assists/src/handlers/remove_mut.rs13
-rw-r--r--crates/ra_assists/src/handlers/reorder_fields.rs27
-rw-r--r--crates/ra_assists/src/handlers/replace_if_let_with_match.rs81
-rw-r--r--crates/ra_assists/src/handlers/replace_let_with_if_let.rs41
-rw-r--r--crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs282
-rw-r--r--crates/ra_assists/src/handlers/replace_unwrap_with_match.rs60
-rw-r--r--crates/ra_assists/src/handlers/split_import.rs14
-rw-r--r--crates/ra_assists/src/handlers/unwrap_block.rs168
-rw-r--r--crates/ra_assists/src/lib.rs62
-rw-r--r--crates/ra_assists/src/tests.rs88
-rw-r--r--crates/ra_assists/src/tests/generated.rs297
-rw-r--r--crates/ra_assists/src/utils.rs16
-rw-r--r--crates/ra_assists/src/utils/insert_use.rs24
-rw-r--r--crates/ra_cfg/Cargo.toml1
-rw-r--r--crates/ra_cfg/src/lib.rs10
-rw-r--r--crates/ra_db/Cargo.toml6
-rw-r--r--crates/ra_db/src/fixture.rs188
-rw-r--r--crates/ra_db/src/input.rs161
-rw-r--r--crates/ra_db/src/lib.rs73
-rw-r--r--crates/ra_flycheck/src/lib.rs302
-rw-r--r--crates/ra_fmt/Cargo.toml1
-rw-r--r--crates/ra_hir/Cargo.toml2
-rw-r--r--crates/ra_hir/src/code_model.rs231
-rw-r--r--crates/ra_hir/src/db.rs18
-rw-r--r--crates/ra_hir/src/diagnostics.rs4
-rw-r--r--crates/ra_hir/src/has_source.rs10
-rw-r--r--crates/ra_hir/src/lib.rs21
-rw-r--r--crates/ra_hir/src/semantics.rs329
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs12
-rw-r--r--crates/ra_hir/src/source_analyzer.rs60
-rw-r--r--crates/ra_hir_def/Cargo.toml6
-rw-r--r--crates/ra_hir_def/src/adt.rs94
-rw-r--r--crates/ra_hir_def/src/attr.rs57
-rw-r--r--crates/ra_hir_def/src/body.rs67
-rw-r--r--crates/ra_hir_def/src/body/lower.rs159
-rw-r--r--crates/ra_hir_def/src/body/scope.rs140
-rw-r--r--crates/ra_hir_def/src/data.rs384
-rw-r--r--crates/ra_hir_def/src/db.rs25
-rw-r--r--crates/ra_hir_def/src/diagnostics.rs3
-rw-r--r--crates/ra_hir_def/src/docs.rs50
-rw-r--r--crates/ra_hir_def/src/expr.rs5
-rw-r--r--crates/ra_hir_def/src/find_path.rs247
-rw-r--r--crates/ra_hir_def/src/generics.rs62
-rw-r--r--crates/ra_hir_def/src/import_map.rs737
-rw-r--r--crates/ra_hir_def/src/item_scope.rs174
-rw-r--r--crates/ra_hir_def/src/item_tree.rs754
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs708
-rw-r--r--crates/ra_hir_def/src/item_tree/tests.rs439
-rw-r--r--crates/ra_hir_def/src/lib.rs166
-rw-r--r--crates/ra_hir_def/src/nameres.rs12
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs514
-rw-r--r--crates/ra_hir_def/src/nameres/mod_resolution.rs121
-rw-r--r--crates/ra_hir_def/src/nameres/raw.rs482
-rw-r--r--crates/ra_hir_def/src/nameres/tests.rs25
-rw-r--r--crates/ra_hir_def/src/nameres/tests/globs.rs137
-rw-r--r--crates/ra_hir_def/src/nameres/tests/incremental.rs38
-rw-r--r--crates/ra_hir_def/src/nameres/tests/macros.rs24
-rw-r--r--crates/ra_hir_def/src/nameres/tests/mod_resolution.rs28
-rw-r--r--crates/ra_hir_def/src/path.rs37
-rw-r--r--crates/ra_hir_def/src/per_ns.rs10
-rw-r--r--crates/ra_hir_def/src/resolver.rs8
-rw-r--r--crates/ra_hir_def/src/src.rs31
-rw-r--r--crates/ra_hir_def/src/test_db.rs51
-rw-r--r--crates/ra_hir_def/src/type_ref.rs13
-rw-r--r--crates/ra_hir_def/src/visibility.rs21
-rw-r--r--crates/ra_hir_expand/Cargo.toml2
-rw-r--r--crates/ra_hir_expand/src/ast_id_map.rs13
-rw-r--r--crates/ra_hir_expand/src/builtin_derive.rs31
-rw-r--r--crates/ra_hir_expand/src/builtin_macro.rs111
-rw-r--r--crates/ra_hir_expand/src/diagnostics.rs2
-rw-r--r--crates/ra_hir_expand/src/eager.rs32
-rw-r--r--crates/ra_hir_expand/src/lib.rs30
-rw-r--r--crates/ra_hir_expand/src/name.rs5
-rw-r--r--crates/ra_hir_expand/src/test_db.rs44
-rw-r--r--crates/ra_hir_ty/Cargo.toml11
-rw-r--r--crates/ra_hir_ty/src/_match.rs2085
-rw-r--r--crates/ra_hir_ty/src/autoderef.rs15
-rw-r--r--crates/ra_hir_ty/src/db.rs61
-rw-r--r--crates/ra_hir_ty/src/diagnostics.rs327
-rw-r--r--crates/ra_hir_ty/src/diagnostics/expr.rs (renamed from crates/ra_hir_ty/src/expr.rs)277
-rw-r--r--crates/ra_hir_ty/src/diagnostics/match_check.rs1421
-rw-r--r--crates/ra_hir_ty/src/diagnostics/unsafe_check.rs173
-rw-r--r--crates/ra_hir_ty/src/display.rs78
-rw-r--r--crates/ra_hir_ty/src/infer.rs89
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs133
-rw-r--r--crates/ra_hir_ty/src/infer/pat.rs42
-rw-r--r--crates/ra_hir_ty/src/infer/path.rs5
-rw-r--r--crates/ra_hir_ty/src/infer/unify.rs55
-rw-r--r--crates/ra_hir_ty/src/lib.rs268
-rw-r--r--crates/ra_hir_ty/src/lower.rs329
-rw-r--r--crates/ra_hir_ty/src/method_resolution.rs393
-rw-r--r--crates/ra_hir_ty/src/primitive.rs54
-rw-r--r--crates/ra_hir_ty/src/test_db.rs129
-rw-r--r--crates/ra_hir_ty/src/tests.rs311
-rw-r--r--crates/ra_hir_ty/src/tests/coercion.rs690
-rw-r--r--crates/ra_hir_ty/src/tests/display_source_code.rs49
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs236
-rw-r--r--crates/ra_hir_ty/src/tests/method_resolution.rs590
-rw-r--r--crates/ra_hir_ty/src/tests/never_type.rs308
-rw-r--r--crates/ra_hir_ty/src/tests/patterns.rs652
-rw-r--r--crates/ra_hir_ty/src/tests/regression.rs527
-rw-r--r--crates/ra_hir_ty/src/tests/simple.rs1818
-rw-r--r--crates/ra_hir_ty/src/tests/traits.rs2041
-rw-r--r--crates/ra_hir_ty/src/traits.rs113
-rw-r--r--crates/ra_hir_ty/src/traits/builtin.rs377
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs294
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/interner.rs32
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/mapping.rs286
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/tls.rs33
-rw-r--r--crates/ra_hir_ty/src/utils.rs46
-rw-r--r--crates/ra_ide/Cargo.toml4
-rw-r--r--crates/ra_ide/src/call_hierarchy.rs214
-rw-r--r--crates/ra_ide/src/call_info.rs549
-rw-r--r--crates/ra_ide/src/completion.rs91
-rw-r--r--crates/ra_ide/src/completion/complete_attribute.rs861
-rw-r--r--crates/ra_ide/src/completion/complete_dot.rs994
-rw-r--r--crates/ra_ide/src/completion/complete_fn_param.rs131
-rw-r--r--crates/ra_ide/src/completion/complete_keyword.rs1102
-rw-r--r--crates/ra_ide/src/completion/complete_macro_in_item_position.rs137
-rw-r--r--crates/ra_ide/src/completion/complete_pattern.rs126
-rw-r--r--crates/ra_ide/src/completion/complete_postfix.rs639
-rw-r--r--crates/ra_ide/src/completion/complete_qualified_path.rs1506
-rw-r--r--crates/ra_ide/src/completion/complete_record.rs546
-rw-r--r--crates/ra_ide/src/completion/complete_snippet.rs106
-rw-r--r--crates/ra_ide/src/completion/complete_trait_impl.rs464
-rw-r--r--crates/ra_ide/src/completion/complete_unqualified_path.rs1615
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs83
-rw-r--r--crates/ra_ide/src/completion/completion_item.rs32
-rw-r--r--crates/ra_ide/src/completion/patterns.rs194
-rw-r--r--crates/ra_ide/src/completion/presentation.rs1639
-rw-r--r--crates/ra_ide/src/completion/test_utils.rs111
-rw-r--r--crates/ra_ide/src/diagnostics.rs880
-rw-r--r--crates/ra_ide/src/display.rs29
-rw-r--r--crates/ra_ide/src/display/function_signature.rs120
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs134
-rw-r--r--crates/ra_ide/src/display/structure.rs429
-rw-r--r--crates/ra_ide/src/expand_macro.rs241
-rw-r--r--crates/ra_ide/src/extend_selection.rs12
-rw-r--r--crates/ra_ide/src/folding_ranges.rs174
-rw-r--r--crates/ra_ide/src/goto_definition.rs1164
-rw-r--r--crates/ra_ide/src/goto_implementation.rs197
-rw-r--r--crates/ra_ide/src/goto_type_definition.rs132
-rw-r--r--crates/ra_ide/src/hover.rs2625
-rw-r--r--crates/ra_ide/src/inlay_hints.rs992
-rw-r--r--crates/ra_ide/src/join_lines.rs5
-rw-r--r--crates/ra_ide/src/lib.rs87
-rw-r--r--crates/ra_ide/src/markup.rs38
-rw-r--r--crates/ra_ide/src/matching_brace.rs33
-rw-r--r--crates/ra_ide/src/mock_analysis.rs214
-rw-r--r--crates/ra_ide/src/parent_module.rs13
-rw-r--r--crates/ra_ide/src/prime_caches.rs2
-rw-r--r--crates/ra_ide/src/references.rs515
-rw-r--r--crates/ra_ide/src/references/rename.rs1210
-rw-r--r--crates/ra_ide/src/runnables.rs898
-rw-r--r--crates/ra_ide/src/snapshots/highlight_injection.html41
-rw-r--r--crates/ra_ide/src/snapshots/highlight_strings.html84
-rw-r--r--crates/ra_ide/src/snapshots/highlighting.html101
-rw-r--r--crates/ra_ide/src/snapshots/rainbow_highlighting.html42
-rw-r--r--crates/ra_ide/src/ssr.rs618
-rw-r--r--crates/ra_ide/src/status.rs28
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs333
-rw-r--r--crates/ra_ide/src/syntax_highlighting/html.rs11
-rw-r--r--crates/ra_ide/src/syntax_highlighting/injection.rs188
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tags.rs18
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tests.rs201
-rw-r--r--crates/ra_ide/src/syntax_tree.rs12
-rw-r--r--crates/ra_ide/src/typing.rs44
-rw-r--r--crates/ra_ide/src/typing/on_enter.rs15
-rw-r--r--crates/ra_ide/test_data/highlight_doctest.html102
-rw-r--r--crates/ra_ide/test_data/highlight_injection.html48
-rw-r--r--crates/ra_ide/test_data/highlight_strings.html96
-rw-r--r--crates/ra_ide/test_data/highlight_unsafe.html54
-rw-r--r--crates/ra_ide/test_data/highlighting.html128
-rw-r--r--crates/ra_ide/test_data/rainbow_highlighting.html49
-rw-r--r--crates/ra_ide_db/Cargo.toml1
-rw-r--r--crates/ra_ide_db/src/change.rs254
-rw-r--r--crates/ra_ide_db/src/defs.rs69
-rw-r--r--crates/ra_ide_db/src/imports_locator.rs84
-rw-r--r--crates/ra_ide_db/src/lib.rs80
-rw-r--r--crates/ra_ide_db/src/search.rs16
-rw-r--r--crates/ra_ide_db/src/source_change.rs31
-rw-r--r--crates/ra_ide_db/src/symbol_index.rs138
-rw-r--r--crates/ra_mbe/Cargo.toml1
-rw-r--r--crates/ra_mbe/src/lib.rs6
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs2
-rw-r--r--crates/ra_mbe/src/parser.rs5
-rw-r--r--crates/ra_parser/Cargo.toml1
-rw-r--r--crates/ra_parser/src/grammar.rs12
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs6
-rw-r--r--crates/ra_parser/src/grammar/items.rs20
-rw-r--r--crates/ra_parser/src/grammar/paths.rs15
-rw-r--r--crates/ra_parser/src/grammar/patterns.rs8
-rw-r--r--crates/ra_parser/src/grammar/type_params.rs11
-rw-r--r--crates/ra_parser/src/grammar/types.rs16
-rw-r--r--crates/ra_parser/src/parser.rs15
-rw-r--r--crates/ra_parser/src/syntax_kind.rs5
-rw-r--r--crates/ra_proc_macro/Cargo.toml1
-rw-r--r--crates/ra_proc_macro_srv/Cargo.toml2
-rw-r--r--crates/ra_proc_macro_srv/src/dylib.rs2
-rw-r--r--crates/ra_proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt2
-rw-r--r--crates/ra_proc_macro_srv/src/tests/mod.rs6
-rw-r--r--crates/ra_proc_macro_srv/src/tests/utils.rs7
-rw-r--r--crates/ra_prof/Cargo.toml8
-rw-r--r--crates/ra_prof/src/lib.rs13
-rw-r--r--crates/ra_project_model/Cargo.toml3
-rw-r--r--crates/ra_project_model/src/cargo_workspace.rs79
-rw-r--r--crates/ra_project_model/src/json_project.rs56
-rw-r--r--crates/ra_project_model/src/lib.rs220
-rw-r--r--crates/ra_project_model/src/project_json.rs129
-rw-r--r--crates/ra_project_model/src/sysroot.rs28
-rw-r--r--crates/ra_ssr/Cargo.toml20
-rw-r--r--crates/ra_ssr/src/errors.rs29
-rw-r--r--crates/ra_ssr/src/lib.rs285
-rw-r--r--crates/ra_ssr/src/matching.rs623
-rw-r--r--crates/ra_ssr/src/parsing.rs343
-rw-r--r--crates/ra_ssr/src/replacing.rs66
-rw-r--r--crates/ra_ssr/src/tests.rs582
-rw-r--r--crates/ra_syntax/Cargo.toml4
-rw-r--r--crates/ra_syntax/src/algo.rs12
-rw-r--r--crates/ra_syntax/src/ast.rs8
-rw-r--r--crates/ra_syntax/src/ast/edit.rs36
-rw-r--r--crates/ra_syntax/src/ast/expr_extensions.rs5
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs16
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs276
-rw-r--r--crates/ra_syntax/src/ast/generated/tokens.rs8
-rw-r--r--crates/ra_syntax/src/ast/make.rs4
-rw-r--r--crates/ra_syntax/src/ast/tokens.rs69
-rw-r--r--crates/ra_syntax/src/ast/traits.rs13
-rw-r--r--crates/ra_syntax/src/lib.rs38
-rw-r--r--crates/ra_syntax/src/parsing.rs32
-rw-r--r--crates/ra_syntax/src/parsing/lexer.rs24
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs5
-rw-r--r--crates/ra_syntax/src/parsing/text_token_source.rs89
-rw-r--r--crates/ra_syntax/src/parsing/text_tree_sink.rs5
-rw-r--r--crates/ra_syntax/src/syntax_node.rs4
-rw-r--r--crates/ra_syntax/src/tests.rs182
-rw-r--r--crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast5
-rw-r--r--crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast74
-rw-r--r--crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast15
-rw-r--r--crates/ra_syntax/test_data/parser/err/0043_default_const.rast40
-rw-r--r--crates/ra_syntax/test_data/parser/err/0043_default_const.rs3
-rw-r--r--crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast240
-rw-r--r--crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs9
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/expr/err/0000_truncated_add.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/expr/err/0000_truncated_add.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/expr/ok/0000_add.rast8
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/expr/ok/0000_add.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/item/err/0000_extra_keyword.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/item/err/0000_extra_keyword.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rast12
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/item/ok/0000_fn.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/err/0000_reserved_word.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/err/0000_reserved_word.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/err/0001_expression.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/err/0001_expression.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/ok/0000_single_ident.rast4
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/ok/0000_single_ident.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/ok/0001_multipart.rast14
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/path/ok/0001_multipart.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/err/0000_reserved_word.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/err/0000_reserved_word.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/err/0001_missing_paren.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/err/0001_missing_paren.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/ok/0000_enum.rast10
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/pattern/ok/0000_enum.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/type/err/0000_missing_close.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/type/err/0000_missing_close.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rast22
-rw-r--r--crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast34
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rast15
-rw-r--r--crates/ra_syntax/test_data/parser/inline/err/0015_empty_segment.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast117
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rs2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast292
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rs5
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rast40
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_fn.rs3
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rast18
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0163_default_unsafe_impl.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast38
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rs1
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0066_default_const.rast44
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0066_default_const.rs3
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rast392
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0067_where_for_pred.rs30
-rw-r--r--crates/ra_text_edit/Cargo.toml1
-rw-r--r--crates/ra_toolchain/Cargo.toml4
-rw-r--r--crates/ra_toolchain/src/lib.rs25
-rw-r--r--crates/ra_tt/Cargo.toml2
-rw-r--r--crates/ra_tt/src/buffer.rs5
-rw-r--r--crates/ra_tt/src/lib.rs19
-rw-r--r--crates/rust-analyzer/Cargo.toml22
-rw-r--r--crates/rust-analyzer/build.rs5
-rw-r--r--crates/rust-analyzer/src/bin/args.rs95
-rw-r--r--crates/rust-analyzer/src/bin/main.rs84
-rw-r--r--crates/rust-analyzer/src/caps.rs25
-rw-r--r--crates/rust-analyzer/src/cargo_target_spec.rs133
-rw-r--r--crates/rust-analyzer/src/cli.rs12
-rw-r--r--crates/rust-analyzer/src/cli/analysis_bench.rs70
-rw-r--r--crates/rust-analyzer/src/cli/analysis_stats.rs80
-rw-r--r--crates/rust-analyzer/src/cli/diagnostics.rs80
-rw-r--r--crates/rust-analyzer/src/cli/load_cargo.rs187
-rw-r--r--crates/rust-analyzer/src/cli/ssr.rs71
-rw-r--r--crates/rust-analyzer/src/config.rs348
-rw-r--r--crates/rust-analyzer/src/diagnostics.rs72
-rw-r--r--crates/rust-analyzer/src/diagnostics/to_proto.rs499
-rw-r--r--crates/rust-analyzer/src/dispatch.rs170
-rw-r--r--crates/rust-analyzer/src/from_proto.rs42
-rw-r--r--crates/rust-analyzer/src/global_state.rs292
-rw-r--r--crates/rust-analyzer/src/handlers.rs (renamed from crates/rust-analyzer/src/main_loop/handlers.rs)988
-rw-r--r--crates/rust-analyzer/src/lib.rs66
-rw-r--r--crates/rust-analyzer/src/line_endings.rs52
-rw-r--r--crates/rust-analyzer/src/lsp_ext.rs123
-rw-r--r--crates/rust-analyzer/src/lsp_utils.rs195
-rw-r--r--crates/rust-analyzer/src/main_loop.rs1444
-rw-r--r--crates/rust-analyzer/src/main_loop/pending_requests.rs75
-rw-r--r--crates/rust-analyzer/src/main_loop/subscriptions.rs22
-rw-r--r--crates/rust-analyzer/src/reload.rs324
-rw-r--r--crates/rust-analyzer/src/request_metrics.rs37
-rw-r--r--crates/rust-analyzer/src/semantic_tokens.rs6
-rw-r--r--crates/rust-analyzer/src/thread_pool.rs35
-rw-r--r--crates/rust-analyzer/src/to_proto.rs276
-rw-r--r--crates/rust-analyzer/src/vfs_glob.rs98
-rw-r--r--crates/rust-analyzer/src/world.rs343
-rw-r--r--crates/rust-analyzer/test_data/clippy_pass_by_ref.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_clippy_pass_by_ref.snap)18
-rw-r--r--crates/rust-analyzer/test_data/handles_macro_location.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_handles_macro_location.snap)18
-rw-r--r--crates/rust-analyzer/test_data/macro_compiler_error.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_macro_compiler_error.snap)18
-rw-r--r--crates/rust-analyzer/test_data/rustc_incompatible_type_for_trait.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_incompatible_type_for_trait.snap)18
-rw-r--r--crates/rust-analyzer/test_data/rustc_mismatched_type.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_mismatched_type.snap)18
-rw-r--r--crates/rust-analyzer/test_data/rustc_unused_variable.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_unused_variable.snap)24
-rw-r--r--crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt71
-rw-r--r--crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt71
-rw-r--r--crates/rust-analyzer/test_data/rustc_wrong_number_of_parameters.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_rustc_wrong_number_of_parameters.snap)18
-rw-r--r--crates/rust-analyzer/test_data/snap_multi_line_fix.txt (renamed from crates/rust-analyzer/src/diagnostics/snapshots/rust_analyzer__diagnostics__to_proto__tests__snap_multi_line_fix.snap)24
-rw-r--r--crates/rust-analyzer/tests/heavy_tests/main.rs285
-rw-r--r--crates/rust-analyzer/tests/heavy_tests/support.rs91
-rw-r--r--crates/stdx/Cargo.toml1
-rw-r--r--crates/stdx/src/lib.rs111
-rw-r--r--crates/stdx/src/macros.rs40
-rw-r--r--crates/test_utils/Cargo.toml6
-rw-r--r--crates/test_utils/src/fixture.rs142
-rw-r--r--crates/test_utils/src/lib.rs501
-rw-r--r--crates/test_utils/src/mark.rs4
-rw-r--r--crates/vfs-notify/Cargo.toml21
-rw-r--r--crates/vfs-notify/src/include.rs42
-rw-r--r--crates/vfs-notify/src/lib.rs230
-rw-r--r--crates/vfs/Cargo.toml15
-rw-r--r--crates/vfs/src/file_set.rs172
-rw-r--r--crates/vfs/src/lib.rs140
-rw-r--r--crates/vfs/src/loader.rs71
-rw-r--r--crates/vfs/src/path_interner.rs31
-rw-r--r--crates/vfs/src/vfs_path.rs146
-rw-r--r--docs/dev/README.md278
-rw-r--r--docs/dev/lsp-extensions.md150
-rw-r--r--docs/dev/lsp-features.md72
-rw-r--r--docs/user/generated_assists.adoc1015
-rw-r--r--docs/user/generated_features.adoc298
-rw-r--r--docs/user/manual.adoc123
-rw-r--r--editors/code/package-lock.json972
-rw-r--r--editors/code/package.json171
-rw-r--r--editors/code/rollup.config.js10
-rw-r--r--editors/code/rust.tmGrammar.json4
-rw-r--r--editors/code/src/client.ts109
-rw-r--r--editors/code/src/commands.ts155
-rw-r--r--editors/code/src/config.ts36
-rw-r--r--editors/code/src/ctx.ts43
-rw-r--r--editors/code/src/debug.ts129
-rw-r--r--editors/code/src/lsp_ext.ts41
-rw-r--r--editors/code/src/main.ts88
-rw-r--r--editors/code/src/net.ts54
-rw-r--r--editors/code/src/persistent_state.ts2
-rw-r--r--editors/code/src/run.ts155
-rw-r--r--editors/code/src/status_display.ts100
-rw-r--r--editors/code/src/tasks.ts112
-rw-r--r--editors/code/src/toolchain.ts (renamed from editors/code/src/cargo.ts)117
-rw-r--r--editors/code/src/util.ts64
-rw-r--r--editors/code/tests/unit/index.ts4
-rw-r--r--editors/code/tests/unit/launch_config.test.ts14
-rw-r--r--editors/code/tests/unit/runnable_env.test.ts118
-rw-r--r--editors/code/tsconfig.json2
-rw-r--r--xtask/Cargo.toml2
-rw-r--r--xtask/src/ast_src.rs2
-rw-r--r--xtask/src/codegen.rs6
-rw-r--r--xtask/src/codegen/gen_assists_docs.rs11
-rw-r--r--xtask/src/codegen/gen_syntax.rs6
-rw-r--r--xtask/src/dist.rs31
-rw-r--r--xtask/src/install.rs16
-rw-r--r--xtask/src/lib.rs55
-rw-r--r--xtask/src/main.rs28
-rw-r--r--xtask/src/not_bash.rs17
-rw-r--r--xtask/src/release.rs103
-rw-r--r--xtask/tests/tidy.rs87
442 files changed, 39318 insertions, 30822 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index ed9191c49..20663196d 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -16,25 +16,25 @@ env:
16 RUSTUP_MAX_RETRIES: 10 16 RUSTUP_MAX_RETRIES: 10
17 17
18jobs: 18jobs:
19 rust-audit: 19 # rust-audit:
20 name: Audit Rust vulnerabilities 20 # name: Audit Rust vulnerabilities
21 runs-on: ubuntu-latest 21 # runs-on: ubuntu-latest
22 steps: 22 # steps:
23 - name: Checkout repository 23 # - name: Checkout repository
24 uses: actions/checkout@v2 24 # uses: actions/checkout@v2
25 25
26 - uses: actions-rs/[email protected] 26 # - uses: actions-rs/[email protected]
27 with: 27 # with:
28 crate: cargo-audit 28 # crate: cargo-audit
29 use-tool-cache: true 29 # use-tool-cache: true
30 30
31 - run: cargo audit 31 # - run: cargo audit
32 32
33 rust: 33 rust:
34 name: Rust 34 name: Rust
35 runs-on: ${{ matrix.os }} 35 runs-on: ${{ matrix.os }}
36 env: 36 env:
37 CC: deny_c 37 CC: deny_c
38 38
39 strategy: 39 strategy:
40 fail-fast: false 40 fail-fast: false
@@ -64,26 +64,22 @@ jobs:
64 - if: matrix.os == 'ubuntu-latest' 64 - if: matrix.os == 'ubuntu-latest'
65 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/ 65 run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
66 66
67 - name: Cache cargo registry 67 - name: Cache cargo directories
68 uses: actions/cache@v1 68 uses: actions/cache@v2
69 with:
70 path: ~/.cargo/registry
71 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
72
73 - name: Cache cargo index
74 uses: actions/cache@v1
75 with: 69 with:
76 path: ~/.cargo/git 70 path: |
77 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} 71 ~/.cargo/registry
72 ~/.cargo/git
73 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
78 74
79 - name: Cache cargo target dir 75 - name: Cache cargo target dir
80 uses: actions/cache@v1 76 uses: actions/cache@v2
81 with: 77 with:
82 path: target 78 path: target
83 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} 79 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
84 80
85 - name: Compile 81 - name: Compile
86 run: cargo test --no-run 82 run: cargo test --no-run --locked
87 83
88 - name: Test 84 - name: Test
89 run: cargo test 85 run: cargo test
@@ -95,6 +91,36 @@ jobs:
95 if: matrix.os == 'windows-latest' 91 if: matrix.os == 'windows-latest'
96 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe 92 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
97 93
94 # Weird target to catch non-portable code
95 rust-power:
96 name: Rust Power
97 runs-on: ubuntu-latest
98
99 steps:
100 - name: Checkout repository
101 uses: actions/checkout@v2
102
103 - name: Install Rust toolchain
104 uses: actions-rs/toolchain@v1
105 with:
106 toolchain: stable
107 profile: minimal
108 override: true
109 target: 'powerpc-unknown-linux-gnu'
110
111 - run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
112
113 - name: Cache cargo directories
114 uses: actions/cache@v2
115 with:
116 path: |
117 ~/.cargo/registry
118 ~/.cargo/git
119 key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
120
121 - name: Check
122 run: cargo check --target=powerpc-unknown-linux-gnu --all-targets
123
98 typescript: 124 typescript:
99 name: TypeScript 125 name: TypeScript
100 strategy: 126 strategy:
@@ -103,7 +129,7 @@ jobs:
103 os: [ubuntu-latest, windows-latest, macos-latest] 129 os: [ubuntu-latest, windows-latest, macos-latest]
104 130
105 runs-on: ${{ matrix.os }} 131 runs-on: ${{ matrix.os }}
106 132
107 steps: 133 steps:
108 - name: Checkout repository 134 - name: Checkout repository
109 uses: actions/checkout@v2 135 uses: actions/checkout@v2
@@ -116,9 +142,9 @@ jobs:
116 - run: npm ci 142 - run: npm ci
117 working-directory: ./editors/code 143 working-directory: ./editors/code
118 144
119 - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; } 145# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
120 if: runner.os == 'Linux' 146# if: runner.os == 'Linux'
121 working-directory: ./editors/code 147# working-directory: ./editors/code
122 148
123 - run: npm run lint 149 - run: npm run lint
124 working-directory: ./editors/code 150 working-directory: ./editors/code
diff --git a/.gitignore b/.gitignore
index dab51647d..472fe1a13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,5 @@ crates/*/target
7*.log 7*.log
8*.iml 8*.iml
9.vscode/settings.json 9.vscode/settings.json
10*.html 10generated_assists.adoc
11generated_features.adoc
diff --git a/Cargo.lock b/Cargo.lock
index 9981a2e33..cde82397c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,23 +2,47 @@
2# It is not intended for manual editing. 2# It is not intended for manual editing.
3[[package]] 3[[package]]
4name = "addr2line" 4name = "addr2line"
5version = "0.12.1" 5version = "0.13.0"
6source = "registry+https://github.com/rust-lang/crates.io-index" 6source = "registry+https://github.com/rust-lang/crates.io-index"
7checksum = "a49806b9dadc843c61e7c97e72490ad7f7220ae249012fbda9ad0609457c0543" 7checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
8dependencies = [ 8dependencies = [
9 "gimli", 9 "gimli",
10] 10]
11 11
12[[package]] 12[[package]]
13name = "adler"
14version = "0.2.3"
15source = "registry+https://github.com/rust-lang/crates.io-index"
16checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
17
18[[package]]
13name = "aho-corasick" 19name = "aho-corasick"
14version = "0.7.10" 20version = "0.7.13"
15source = "registry+https://github.com/rust-lang/crates.io-index" 21source = "registry+https://github.com/rust-lang/crates.io-index"
16checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" 22checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
17dependencies = [ 23dependencies = [
18 "memchr", 24 "memchr",
19] 25]
20 26
21[[package]] 27[[package]]
28name = "ansi_term"
29version = "0.11.0"
30source = "registry+https://github.com/rust-lang/crates.io-index"
31checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
32dependencies = [
33 "winapi 0.3.9",
34]
35
36[[package]]
37name = "ansi_term"
38version = "0.12.1"
39source = "registry+https://github.com/rust-lang/crates.io-index"
40checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
41dependencies = [
42 "winapi 0.3.9",
43]
44
45[[package]]
22name = "anyhow" 46name = "anyhow"
23version = "1.0.31" 47version = "1.0.31"
24source = "registry+https://github.com/rust-lang/crates.io-index" 48source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -44,7 +68,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
44dependencies = [ 68dependencies = [
45 "hermit-abi", 69 "hermit-abi",
46 "libc", 70 "libc",
47 "winapi 0.3.8", 71 "winapi 0.3.9",
48] 72]
49 73
50[[package]] 74[[package]]
@@ -55,22 +79,23 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
55 79
56[[package]] 80[[package]]
57name = "backtrace" 81name = "backtrace"
58version = "0.3.48" 82version = "0.3.50"
59source = "registry+https://github.com/rust-lang/crates.io-index" 83source = "registry+https://github.com/rust-lang/crates.io-index"
60checksum = "0df2f85c8a2abbe3b7d7e748052fdd9b76a0458fdeb16ad4223f5eca78c7c130" 84checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293"
61dependencies = [ 85dependencies = [
62 "addr2line", 86 "addr2line",
63 "cfg-if", 87 "cfg-if",
64 "libc", 88 "libc",
89 "miniz_oxide",
65 "object", 90 "object",
66 "rustc-demangle", 91 "rustc-demangle",
67] 92]
68 93
69[[package]] 94[[package]]
70name = "base64" 95name = "base64"
71version = "0.12.1" 96version = "0.12.3"
72source = "registry+https://github.com/rust-lang/crates.io-index" 97source = "registry+https://github.com/rust-lang/crates.io-index"
73checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" 98checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
74 99
75[[package]] 100[[package]]
76name = "bitflags" 101name = "bitflags"
@@ -88,6 +113,12 @@ dependencies = [
88] 113]
89 114
90[[package]] 115[[package]]
116name = "byteorder"
117version = "1.3.4"
118source = "registry+https://github.com/rust-lang/crates.io-index"
119checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
120
121[[package]]
91name = "cargo_metadata" 122name = "cargo_metadata"
92version = "0.10.0" 123version = "0.10.0"
93source = "registry+https://github.com/rust-lang/crates.io-index" 124source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -101,9 +132,9 @@ dependencies = [
101 132
102[[package]] 133[[package]]
103name = "cc" 134name = "cc"
104version = "1.0.54" 135version = "1.0.58"
105source = "registry+https://github.com/rust-lang/crates.io-index" 136source = "registry+https://github.com/rust-lang/crates.io-index"
106checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" 137checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
107 138
108[[package]] 139[[package]]
109name = "cfg-if" 140name = "cfg-if"
@@ -113,8 +144,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
113 144
114[[package]] 145[[package]]
115name = "chalk-derive" 146name = "chalk-derive"
116version = "0.10.1-dev" 147version = "0.17.0"
117source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c" 148source = "registry+https://github.com/rust-lang/crates.io-index"
149checksum = "9396f12a23b1a40d5019aa81bc0cbd7ccd2c9736d6bc4afc95868533c2346dcb"
118dependencies = [ 150dependencies = [
119 "proc-macro2", 151 "proc-macro2",
120 "quote", 152 "quote",
@@ -123,86 +155,95 @@ dependencies = [
123] 155]
124 156
125[[package]] 157[[package]]
126name = "chalk-engine" 158name = "chalk-ir"
127version = "0.10.1-dev" 159version = "0.17.0"
128source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c" 160source = "registry+https://github.com/rust-lang/crates.io-index"
161checksum = "87e9c67d500717d65ede27affb7ae40efe240d86fbefff1006fe0ffb62d4caf9"
129dependencies = [ 162dependencies = [
130 "chalk-derive", 163 "chalk-derive",
131 "chalk-ir", 164 "lazy_static",
132 "rustc-hash",
133] 165]
134 166
135[[package]] 167[[package]]
136name = "chalk-ir" 168name = "chalk-recursive"
137version = "0.10.1-dev" 169version = "0.17.0"
138source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c" 170source = "registry+https://github.com/rust-lang/crates.io-index"
171checksum = "a8fd2ac0fc06c857b95614d229bbe8ea317d1d94a7e8b9442a3f05c9a2c2d5f4"
139dependencies = [ 172dependencies = [
140 "chalk-derive", 173 "chalk-derive",
141 "lazy_static", 174 "chalk-ir",
175 "chalk-solve",
176 "rustc-hash",
177 "tracing",
142] 178]
143 179
144[[package]] 180[[package]]
145name = "chalk-solve" 181name = "chalk-solve"
146version = "0.10.1-dev" 182version = "0.17.0"
147source = "git+https://github.com/rust-lang/chalk.git?rev=329b7f3fdd2431ed6f6778cde53f22374c7d094c#329b7f3fdd2431ed6f6778cde53f22374c7d094c" 183source = "registry+https://github.com/rust-lang/crates.io-index"
184checksum = "2a79166f2405c1e51eadcc1344f5ee833c7b391532dd78f64a0731a9a123cc58"
148dependencies = [ 185dependencies = [
149 "chalk-derive", 186 "chalk-derive",
150 "chalk-engine",
151 "chalk-ir", 187 "chalk-ir",
152 "ena", 188 "ena",
153 "itertools", 189 "itertools",
154 "petgraph", 190 "petgraph",
155 "rustc-hash", 191 "rustc-hash",
192 "tracing",
193 "tracing-subscriber",
194 "tracing-tree",
156] 195]
157 196
158[[package]] 197[[package]]
159name = "clicolors-control" 198name = "chrono"
160version = "1.0.1" 199version = "0.4.13"
161source = "registry+https://github.com/rust-lang/crates.io-index" 200source = "registry+https://github.com/rust-lang/crates.io-index"
162checksum = "90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e" 201checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6"
163dependencies = [ 202dependencies = [
164 "atty", 203 "num-integer",
165 "lazy_static", 204 "num-traits",
166 "libc", 205 "time",
167 "winapi 0.3.8",
168] 206]
169 207
170[[package]] 208[[package]]
171name = "cloudabi" 209name = "cloudabi"
172version = "0.0.3" 210version = "0.1.0"
173source = "registry+https://github.com/rust-lang/crates.io-index" 211source = "registry+https://github.com/rust-lang/crates.io-index"
174checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 212checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
175dependencies = [ 213dependencies = [
176 "bitflags", 214 "bitflags",
177] 215]
178 216
179[[package]] 217[[package]]
218name = "cmake"
219version = "0.1.44"
220source = "registry+https://github.com/rust-lang/crates.io-index"
221checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb"
222dependencies = [
223 "cc",
224]
225
226[[package]]
180name = "console" 227name = "console"
181version = "0.10.3" 228version = "0.11.3"
182source = "registry+https://github.com/rust-lang/crates.io-index" 229source = "registry+https://github.com/rust-lang/crates.io-index"
183checksum = "2586208b33573b7f76ccfbe5adb076394c88deaf81b84d7213969805b0a952a7" 230checksum = "8c0994e656bba7b922d8dd1245db90672ffb701e684e45be58f20719d69abc5a"
184dependencies = [ 231dependencies = [
185 "clicolors-control",
186 "encode_unicode", 232 "encode_unicode",
187 "lazy_static", 233 "lazy_static",
188 "libc", 234 "libc",
189 "terminal_size", 235 "terminal_size",
190 "termios", 236 "termios",
191 "winapi 0.3.8", 237 "winapi 0.3.9",
192] 238]
193 239
194[[package]] 240[[package]]
195name = "crossbeam" 241name = "crc32fast"
196version = "0.7.3" 242version = "1.2.0"
197source = "registry+https://github.com/rust-lang/crates.io-index" 243source = "registry+https://github.com/rust-lang/crates.io-index"
198checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" 244checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
199dependencies = [ 245dependencies = [
200 "cfg-if", 246 "cfg-if",
201 "crossbeam-channel",
202 "crossbeam-deque",
203 "crossbeam-epoch",
204 "crossbeam-queue",
205 "crossbeam-utils",
206] 247]
207 248
208[[package]] 249[[package]]
@@ -243,12 +284,13 @@ dependencies = [
243 284
244[[package]] 285[[package]]
245name = "crossbeam-queue" 286name = "crossbeam-queue"
246version = "0.2.2" 287version = "0.2.3"
247source = "registry+https://github.com/rust-lang/crates.io-index" 288source = "registry+https://github.com/rust-lang/crates.io-index"
248checksum = "ab6bffe714b6bb07e42f201352c34f51fefd355ace793f9e638ebd52d23f98d2" 289checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
249dependencies = [ 290dependencies = [
250 "cfg-if", 291 "cfg-if",
251 "crossbeam-utils", 292 "crossbeam-utils",
293 "maybe-uninit",
252] 294]
253 295
254[[package]] 296[[package]]
@@ -276,9 +318,9 @@ checksum = "69b26e475fd29098530e709294e94e661974c851aed42512793f120fed4e199f"
276 318
277[[package]] 319[[package]]
278name = "dtoa" 320name = "dtoa"
279version = "0.4.5" 321version = "0.4.6"
280source = "registry+https://github.com/rust-lang/crates.io-index" 322source = "registry+https://github.com/rust-lang/crates.io-index"
281checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" 323checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b"
282 324
283[[package]] 325[[package]]
284name = "either" 326name = "either"
@@ -311,6 +353,15 @@ dependencies = [
311] 353]
312 354
313[[package]] 355[[package]]
356name = "expect"
357version = "0.1.0"
358dependencies = [
359 "difference",
360 "once_cell",
361 "stdx",
362]
363
364[[package]]
314name = "filetime" 365name = "filetime"
315version = "0.2.10" 366version = "0.2.10"
316source = "registry+https://github.com/rust-lang/crates.io-index" 367source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -319,7 +370,7 @@ dependencies = [
319 "cfg-if", 370 "cfg-if",
320 "libc", 371 "libc",
321 "redox_syscall", 372 "redox_syscall",
322 "winapi 0.3.8", 373 "winapi 0.3.9",
323] 374]
324 375
325[[package]] 376[[package]]
@@ -329,6 +380,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
329checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" 380checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
330 381
331[[package]] 382[[package]]
383name = "flate2"
384version = "1.0.16"
385source = "registry+https://github.com/rust-lang/crates.io-index"
386checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e"
387dependencies = [
388 "cfg-if",
389 "crc32fast",
390 "libc",
391 "miniz_oxide",
392]
393
394[[package]]
395name = "flycheck"
396version = "0.1.0"
397dependencies = [
398 "cargo_metadata",
399 "crossbeam-channel",
400 "jod-thread",
401 "log",
402 "ra_toolchain",
403 "serde_json",
404]
405
406[[package]]
332name = "fnv" 407name = "fnv"
333version = "1.0.7" 408version = "1.0.7"
334source = "registry+https://github.com/rust-lang/crates.io-index" 409source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -342,9 +417,9 @@ checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"
342 417
343[[package]] 418[[package]]
344name = "fsevent" 419name = "fsevent"
345version = "0.4.0" 420version = "2.0.2"
346source = "registry+https://github.com/rust-lang/crates.io-index" 421source = "registry+https://github.com/rust-lang/crates.io-index"
347checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" 422checksum = "97f347202c95c98805c216f9e1df210e8ebaec9fdb2365700a43c10797a35e63"
348dependencies = [ 423dependencies = [
349 "bitflags", 424 "bitflags",
350 "fsevent-sys", 425 "fsevent-sys",
@@ -352,9 +427,9 @@ dependencies = [
352 427
353[[package]] 428[[package]]
354name = "fsevent-sys" 429name = "fsevent-sys"
355version = "2.0.1" 430version = "3.0.2"
356source = "registry+https://github.com/rust-lang/crates.io-index" 431source = "registry+https://github.com/rust-lang/crates.io-index"
357checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" 432checksum = "77a29c77f1ca394c3e73a9a5d24cfcabb734682d9634fc398f2204a63c994120"
358dependencies = [ 433dependencies = [
359 "libc", 434 "libc",
360] 435]
@@ -394,9 +469,9 @@ dependencies = [
394 469
395[[package]] 470[[package]]
396name = "gimli" 471name = "gimli"
397version = "0.21.0" 472version = "0.22.0"
398source = "registry+https://github.com/rust-lang/crates.io-index" 473source = "registry+https://github.com/rust-lang/crates.io-index"
399checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" 474checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
400 475
401[[package]] 476[[package]]
402name = "globset" 477name = "globset"
@@ -433,9 +508,9 @@ dependencies = [
433 508
434[[package]] 509[[package]]
435name = "hermit-abi" 510name = "hermit-abi"
436version = "0.1.13" 511version = "0.1.15"
437source = "registry+https://github.com/rust-lang/crates.io-index" 512source = "registry+https://github.com/rust-lang/crates.io-index"
438checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" 513checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
439dependencies = [ 514dependencies = [
440 "libc", 515 "libc",
441] 516]
@@ -446,7 +521,7 @@ version = "0.5.3"
446source = "registry+https://github.com/rust-lang/crates.io-index" 521source = "registry+https://github.com/rust-lang/crates.io-index"
447checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" 522checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
448dependencies = [ 523dependencies = [
449 "winapi 0.3.8", 524 "winapi 0.3.9",
450] 525]
451 526
452[[package]] 527[[package]]
@@ -462,18 +537,18 @@ dependencies = [
462 537
463[[package]] 538[[package]]
464name = "indexmap" 539name = "indexmap"
465version = "1.3.2" 540version = "1.4.0"
466source = "registry+https://github.com/rust-lang/crates.io-index" 541source = "registry+https://github.com/rust-lang/crates.io-index"
467checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" 542checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe"
468dependencies = [ 543dependencies = [
469 "autocfg", 544 "autocfg",
470] 545]
471 546
472[[package]] 547[[package]]
473name = "inotify" 548name = "inotify"
474version = "0.7.0" 549version = "0.8.3"
475source = "registry+https://github.com/rust-lang/crates.io-index" 550source = "registry+https://github.com/rust-lang/crates.io-index"
476checksum = "24e40d6fd5d64e2082e0c796495c8ef5ad667a96d03e5aaa0becfd9d47bcbfb8" 551checksum = "46dd0a94b393c730779ccfd2a872b67b1eb67be3fc33082e733bdb38b5fde4d4"
477dependencies = [ 552dependencies = [
478 "bitflags", 553 "bitflags",
479 "inotify-sys", 554 "inotify-sys",
@@ -491,9 +566,9 @@ dependencies = [
491 566
492[[package]] 567[[package]]
493name = "insta" 568name = "insta"
494version = "0.16.0" 569version = "0.16.1"
495source = "registry+https://github.com/rust-lang/crates.io-index" 570source = "registry+https://github.com/rust-lang/crates.io-index"
496checksum = "8386e795fb3927131ea4cede203c529a333652eb6dc4ff29616b832b27e9b096" 571checksum = "617e921abc813f96a3b00958c079e7bf1e2db998f8a04f1546dd967373a418ee"
497dependencies = [ 572dependencies = [
498 "console", 573 "console",
499 "difference", 574 "difference",
@@ -504,6 +579,12 @@ dependencies = [
504] 579]
505 580
506[[package]] 581[[package]]
582name = "instant"
583version = "0.1.6"
584source = "registry+https://github.com/rust-lang/crates.io-index"
585checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"
586
587[[package]]
507name = "iovec" 588name = "iovec"
508version = "0.1.4" 589version = "0.1.4"
509source = "registry+https://github.com/rust-lang/crates.io-index" 590source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -523,9 +604,9 @@ dependencies = [
523 604
524[[package]] 605[[package]]
525name = "itoa" 606name = "itoa"
526version = "0.4.5" 607version = "0.4.6"
527source = "registry+https://github.com/rust-lang/crates.io-index" 608source = "registry+https://github.com/rust-lang/crates.io-index"
528checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 609checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
529 610
530[[package]] 611[[package]]
531name = "jemalloc-ctl" 612name = "jemalloc-ctl"
@@ -561,9 +642,9 @@ dependencies = [
561 642
562[[package]] 643[[package]]
563name = "jod-thread" 644name = "jod-thread"
564version = "0.1.1" 645version = "0.1.2"
565source = "registry+https://github.com/rust-lang/crates.io-index" 646source = "registry+https://github.com/rust-lang/crates.io-index"
566checksum = "4022656272c3e564a7cdebcaaba6518d844b0d0c1836597196efb5bfeb98bb49" 647checksum = "8b23360e99b8717f20aaa4598f5a6541efbe30630039fbc7706cf954a87947ae"
567 648
568[[package]] 649[[package]]
569name = "kernel32-sys" 650name = "kernel32-sys"
@@ -589,9 +670,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
589 670
590[[package]] 671[[package]]
591name = "libc" 672name = "libc"
592version = "0.2.71" 673version = "0.2.72"
593source = "registry+https://github.com/rust-lang/crates.io-index" 674source = "registry+https://github.com/rust-lang/crates.io-index"
594checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" 675checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701"
595 676
596[[package]] 677[[package]]
597name = "libloading" 678name = "libloading"
@@ -599,7 +680,16 @@ version = "0.6.2"
599source = "registry+https://github.com/rust-lang/crates.io-index" 680source = "registry+https://github.com/rust-lang/crates.io-index"
600checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" 681checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c"
601dependencies = [ 682dependencies = [
602 "winapi 0.3.8", 683 "winapi 0.3.9",
684]
685
686[[package]]
687name = "libmimalloc-sys"
688version = "0.1.15"
689source = "registry+https://github.com/rust-lang/crates.io-index"
690checksum = "a27252ec1d0c4e0dd6142cbc572da50b363ab56fc334f7aa8fadf295b2e24e74"
691dependencies = [
692 "cmake",
603] 693]
604 694
605[[package]] 695[[package]]
@@ -610,9 +700,9 @@ checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
610 700
611[[package]] 701[[package]]
612name = "lock_api" 702name = "lock_api"
613version = "0.3.4" 703version = "0.4.1"
614source = "registry+https://github.com/rust-lang/crates.io-index" 704source = "registry+https://github.com/rust-lang/crates.io-index"
615checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" 705checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
616dependencies = [ 706dependencies = [
617 "scopeguard", 707 "scopeguard",
618] 708]
@@ -628,9 +718,9 @@ dependencies = [
628 718
629[[package]] 719[[package]]
630name = "lsp-server" 720name = "lsp-server"
631version = "0.3.2" 721version = "0.3.3"
632source = "registry+https://github.com/rust-lang/crates.io-index" 722source = "registry+https://github.com/rust-lang/crates.io-index"
633checksum = "dccec31bfd027ac0dd288a78e19005fd89624d9099456e284b5241316a6c3072" 723checksum = "53b4ace8ebe5d2aff3687ce0ed507f6020d6a47a7de2b0d3d664ea237ffb0c62"
634dependencies = [ 724dependencies = [
635 "crossbeam-channel", 725 "crossbeam-channel",
636 "log", 726 "log",
@@ -640,9 +730,9 @@ dependencies = [
640 730
641[[package]] 731[[package]]
642name = "lsp-types" 732name = "lsp-types"
643version = "0.74.2" 733version = "0.77.0"
644source = "registry+https://github.com/rust-lang/crates.io-index" 734source = "registry+https://github.com/rust-lang/crates.io-index"
645checksum = "b360754e89e0e13c114245131382ba921d4ff1efabb918e549422938aaa8d392" 735checksum = "897c6c8930fbf12b67deffc83729287bb379dd5e5a4bd0ae2d81eff8d6503db6"
646dependencies = [ 736dependencies = [
647 "base64", 737 "base64",
648 "bitflags", 738 "bitflags",
@@ -653,6 +743,15 @@ dependencies = [
653] 743]
654 744
655[[package]] 745[[package]]
746name = "matchers"
747version = "0.0.1"
748source = "registry+https://github.com/rust-lang/crates.io-index"
749checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
750dependencies = [
751 "regex-automata",
752]
753
754[[package]]
656name = "matches" 755name = "matches"
657version = "0.1.8" 756version = "0.1.8"
658source = "registry+https://github.com/rust-lang/crates.io-index" 757source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -677,19 +776,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
677checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" 776checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
678dependencies = [ 777dependencies = [
679 "libc", 778 "libc",
680 "winapi 0.3.8", 779 "winapi 0.3.9",
681] 780]
682 781
683[[package]] 782[[package]]
684name = "memoffset" 783name = "memoffset"
685version = "0.5.4" 784version = "0.5.5"
686source = "registry+https://github.com/rust-lang/crates.io-index" 785source = "registry+https://github.com/rust-lang/crates.io-index"
687checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" 786checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f"
688dependencies = [ 787dependencies = [
689 "autocfg", 788 "autocfg",
690] 789]
691 790
692[[package]] 791[[package]]
792name = "mimalloc"
793version = "0.1.19"
794source = "registry+https://github.com/rust-lang/crates.io-index"
795checksum = "6c52de2069999f01bd26436564dbe7de3a87898feeb7a0d0ff9eb20a05bb7ca0"
796dependencies = [
797 "libmimalloc-sys",
798]
799
800[[package]]
801name = "miniz_oxide"
802version = "0.4.0"
803source = "registry+https://github.com/rust-lang/crates.io-index"
804checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f"
805dependencies = [
806 "adler",
807]
808
809[[package]]
693name = "mio" 810name = "mio"
694version = "0.6.22" 811version = "0.6.22"
695source = "registry+https://github.com/rust-lang/crates.io-index" 812source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -740,16 +857,18 @@ checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
740dependencies = [ 857dependencies = [
741 "cfg-if", 858 "cfg-if",
742 "libc", 859 "libc",
743 "winapi 0.3.8", 860 "winapi 0.3.9",
744] 861]
745 862
746[[package]] 863[[package]]
747name = "notify" 864name = "notify"
748version = "4.0.15" 865version = "5.0.0-pre.3"
749source = "registry+https://github.com/rust-lang/crates.io-index" 866source = "registry+https://github.com/rust-lang/crates.io-index"
750checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" 867checksum = "77d03607cf88b4b160ba0e9ed425fff3cee3b55ac813f0c685b3a3772da37d0e"
751dependencies = [ 868dependencies = [
869 "anymap",
752 "bitflags", 870 "bitflags",
871 "crossbeam-channel",
753 "filetime", 872 "filetime",
754 "fsevent", 873 "fsevent",
755 "fsevent-sys", 874 "fsevent-sys",
@@ -758,7 +877,26 @@ dependencies = [
758 "mio", 877 "mio",
759 "mio-extras", 878 "mio-extras",
760 "walkdir", 879 "walkdir",
761 "winapi 0.3.8", 880 "winapi 0.3.9",
881]
882
883[[package]]
884name = "num-integer"
885version = "0.1.43"
886source = "registry+https://github.com/rust-lang/crates.io-index"
887checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
888dependencies = [
889 "autocfg",
890 "num-traits",
891]
892
893[[package]]
894name = "num-traits"
895version = "0.2.12"
896source = "registry+https://github.com/rust-lang/crates.io-index"
897checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
898dependencies = [
899 "autocfg",
762] 900]
763 901
764[[package]] 902[[package]]
@@ -773,9 +911,9 @@ dependencies = [
773 911
774[[package]] 912[[package]]
775name = "object" 913name = "object"
776version = "0.19.0" 914version = "0.20.0"
777source = "registry+https://github.com/rust-lang/crates.io-index" 915source = "registry+https://github.com/rust-lang/crates.io-index"
778checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" 916checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
779 917
780[[package]] 918[[package]]
781name = "once_cell" 919name = "once_cell"
@@ -785,33 +923,35 @@ checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
785 923
786[[package]] 924[[package]]
787name = "parking_lot" 925name = "parking_lot"
788version = "0.10.2" 926version = "0.11.0"
789source = "registry+https://github.com/rust-lang/crates.io-index" 927source = "registry+https://github.com/rust-lang/crates.io-index"
790checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" 928checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
791dependencies = [ 929dependencies = [
930 "instant",
792 "lock_api", 931 "lock_api",
793 "parking_lot_core", 932 "parking_lot_core",
794] 933]
795 934
796[[package]] 935[[package]]
797name = "parking_lot_core" 936name = "parking_lot_core"
798version = "0.7.2" 937version = "0.8.0"
799source = "registry+https://github.com/rust-lang/crates.io-index" 938source = "registry+https://github.com/rust-lang/crates.io-index"
800checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" 939checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
801dependencies = [ 940dependencies = [
802 "cfg-if", 941 "cfg-if",
803 "cloudabi", 942 "cloudabi",
943 "instant",
804 "libc", 944 "libc",
805 "redox_syscall", 945 "redox_syscall",
806 "smallvec", 946 "smallvec",
807 "winapi 0.3.8", 947 "winapi 0.3.9",
808] 948]
809 949
810[[package]] 950[[package]]
811name = "paste" 951name = "paste"
812version = "0.1.15" 952version = "0.1.18"
813source = "registry+https://github.com/rust-lang/crates.io-index" 953source = "registry+https://github.com/rust-lang/crates.io-index"
814checksum = "d53181dcd37421c08d3b69f887784956674d09c3f9a47a04fece2b130a5b346b" 954checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
815dependencies = [ 955dependencies = [
816 "paste-impl", 956 "paste-impl",
817 "proc-macro-hack", 957 "proc-macro-hack",
@@ -819,17 +959,18 @@ dependencies = [
819 959
820[[package]] 960[[package]]
821name = "paste-impl" 961name = "paste-impl"
822version = "0.1.15" 962version = "0.1.18"
823source = "registry+https://github.com/rust-lang/crates.io-index" 963source = "registry+https://github.com/rust-lang/crates.io-index"
824checksum = "05ca490fa1c034a71412b4d1edcb904ec5a0981a4426c9eb2128c0fda7a68d17" 964checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
825dependencies = [ 965dependencies = [
826 "proc-macro-hack", 966 "proc-macro-hack",
827 "proc-macro2",
828 "quote",
829 "syn",
830] 967]
831 968
832[[package]] 969[[package]]
970name = "paths"
971version = "0.1.0"
972
973[[package]]
833name = "percent-encoding" 974name = "percent-encoding"
834version = "2.1.0" 975version = "2.1.0"
835source = "registry+https://github.com/rust-lang/crates.io-index" 976source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -847,9 +988,9 @@ dependencies = [
847 988
848[[package]] 989[[package]]
849name = "pico-args" 990name = "pico-args"
850version = "0.3.1" 991version = "0.3.3"
851source = "registry+https://github.com/rust-lang/crates.io-index" 992source = "registry+https://github.com/rust-lang/crates.io-index"
852checksum = "3ad1f1b834a05d42dae330066e9699a173b28185b3bdc3dbf14ca239585de8cc" 993checksum = "1b1eee8b1f4966c8343d7ca0f5a8452cd35d5610a2e0efbe2a68cae44bef2046"
853 994
854[[package]] 995[[package]]
855name = "plain" 996name = "plain"
@@ -871,18 +1012,18 @@ checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4"
871 1012
872[[package]] 1013[[package]]
873name = "proc-macro2" 1014name = "proc-macro2"
874version = "1.0.17" 1015version = "1.0.18"
875source = "registry+https://github.com/rust-lang/crates.io-index" 1016source = "registry+https://github.com/rust-lang/crates.io-index"
876checksum = "1502d12e458c49a4c9cbff560d0fe0060c252bc29799ed94ca2ed4bb665a0101" 1017checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
877dependencies = [ 1018dependencies = [
878 "unicode-xid", 1019 "unicode-xid",
879] 1020]
880 1021
881[[package]] 1022[[package]]
882name = "quote" 1023name = "quote"
883version = "1.0.6" 1024version = "1.0.7"
884source = "registry+https://github.com/rust-lang/crates.io-index" 1025source = "registry+https://github.com/rust-lang/crates.io-index"
885checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" 1026checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
886dependencies = [ 1027dependencies = [
887 "proc-macro2", 1028 "proc-macro2",
888] 1029]
@@ -927,22 +1068,11 @@ dependencies = [
927 "ra_prof", 1068 "ra_prof",
928 "ra_syntax", 1069 "ra_syntax",
929 "ra_tt", 1070 "ra_tt",
930 "relative-path",
931 "rustc-hash", 1071 "rustc-hash",
932 "salsa", 1072 "salsa",
1073 "stdx",
933 "test_utils", 1074 "test_utils",
934] 1075 "vfs",
935
936[[package]]
937name = "ra_flycheck"
938version = "0.1.0"
939dependencies = [
940 "cargo_metadata",
941 "crossbeam-channel",
942 "jod-thread",
943 "log",
944 "ra_toolchain",
945 "serde_json",
946] 1076]
947 1077
948[[package]] 1078[[package]]
@@ -968,6 +1098,7 @@ dependencies = [
968 "ra_prof", 1098 "ra_prof",
969 "ra_syntax", 1099 "ra_syntax",
970 "rustc-hash", 1100 "rustc-hash",
1101 "stdx",
971] 1102]
972 1103
973[[package]] 1104[[package]]
@@ -977,7 +1108,11 @@ dependencies = [
977 "anymap", 1108 "anymap",
978 "drop_bomb", 1109 "drop_bomb",
979 "either", 1110 "either",
1111 "expect",
1112 "fst",
1113 "indexmap",
980 "insta", 1114 "insta",
1115 "itertools",
981 "log", 1116 "log",
982 "once_cell", 1117 "once_cell",
983 "ra_arena", 1118 "ra_arena",
@@ -989,6 +1124,7 @@ dependencies = [
989 "ra_syntax", 1124 "ra_syntax",
990 "ra_tt", 1125 "ra_tt",
991 "rustc-hash", 1126 "rustc-hash",
1127 "smallvec",
992 "stdx", 1128 "stdx",
993 "test_utils", 1129 "test_utils",
994] 1130]
@@ -1006,6 +1142,7 @@ dependencies = [
1006 "ra_prof", 1142 "ra_prof",
1007 "ra_syntax", 1143 "ra_syntax",
1008 "ra_tt", 1144 "ra_tt",
1145 "rustc-hash",
1009 "test_utils", 1146 "test_utils",
1010] 1147]
1011 1148
@@ -1015,8 +1152,10 @@ version = "0.1.0"
1015dependencies = [ 1152dependencies = [
1016 "arrayvec", 1153 "arrayvec",
1017 "chalk-ir", 1154 "chalk-ir",
1155 "chalk-recursive",
1018 "chalk-solve", 1156 "chalk-solve",
1019 "ena", 1157 "ena",
1158 "expect",
1020 "insta", 1159 "insta",
1021 "itertools", 1160 "itertools",
1022 "log", 1161 "log",
@@ -1031,6 +1170,9 @@ dependencies = [
1031 "smallvec", 1170 "smallvec",
1032 "stdx", 1171 "stdx",
1033 "test_utils", 1172 "test_utils",
1173 "tracing",
1174 "tracing-subscriber",
1175 "tracing-tree",
1034] 1176]
1035 1177
1036[[package]] 1178[[package]]
@@ -1038,8 +1180,8 @@ name = "ra_ide"
1038version = "0.1.0" 1180version = "0.1.0"
1039dependencies = [ 1181dependencies = [
1040 "either", 1182 "either",
1183 "expect",
1041 "indexmap", 1184 "indexmap",
1042 "insta",
1043 "itertools", 1185 "itertools",
1044 "log", 1186 "log",
1045 "ra_assists", 1187 "ra_assists",
@@ -1049,6 +1191,7 @@ dependencies = [
1049 "ra_hir", 1191 "ra_hir",
1050 "ra_ide_db", 1192 "ra_ide_db",
1051 "ra_prof", 1193 "ra_prof",
1194 "ra_ssr",
1052 "ra_syntax", 1195 "ra_syntax",
1053 "ra_text_edit", 1196 "ra_text_edit",
1054 "rand", 1197 "rand",
@@ -1119,6 +1262,7 @@ dependencies = [
1119 "memmap", 1262 "memmap",
1120 "ra_mbe", 1263 "ra_mbe",
1121 "ra_proc_macro", 1264 "ra_proc_macro",
1265 "ra_toolchain",
1122 "ra_tt", 1266 "ra_tt",
1123 "serde_derive", 1267 "serde_derive",
1124 "test_utils", 1268 "test_utils",
@@ -1131,6 +1275,7 @@ dependencies = [
1131 "backtrace", 1275 "backtrace",
1132 "jemalloc-ctl", 1276 "jemalloc-ctl",
1133 "jemallocator", 1277 "jemallocator",
1278 "mimalloc",
1134 "once_cell", 1279 "once_cell",
1135 "ra_arena", 1280 "ra_arena",
1136] 1281]
@@ -1142,6 +1287,7 @@ dependencies = [
1142 "anyhow", 1287 "anyhow",
1143 "cargo_metadata", 1288 "cargo_metadata",
1144 "log", 1289 "log",
1290 "paths",
1145 "ra_arena", 1291 "ra_arena",
1146 "ra_cfg", 1292 "ra_cfg",
1147 "ra_db", 1293 "ra_db",
@@ -1150,6 +1296,20 @@ dependencies = [
1150 "rustc-hash", 1296 "rustc-hash",
1151 "serde", 1297 "serde",
1152 "serde_json", 1298 "serde_json",
1299 "stdx",
1300]
1301
1302[[package]]
1303name = "ra_ssr"
1304version = "0.1.0"
1305dependencies = [
1306 "ra_db",
1307 "ra_hir",
1308 "ra_ide_db",
1309 "ra_syntax",
1310 "ra_text_edit",
1311 "rustc-hash",
1312 "test_utils",
1153] 1313]
1154 1314
1155[[package]] 1315[[package]]
@@ -1157,10 +1317,12 @@ name = "ra_syntax"
1157version = "0.1.0" 1317version = "0.1.0"
1158dependencies = [ 1318dependencies = [
1159 "arrayvec", 1319 "arrayvec",
1320 "expect",
1160 "itertools", 1321 "itertools",
1161 "once_cell", 1322 "once_cell",
1162 "ra_parser", 1323 "ra_parser",
1163 "ra_text_edit", 1324 "ra_text_edit",
1325 "rayon",
1164 "rowan", 1326 "rowan",
1165 "rustc-ap-rustc_lexer", 1327 "rustc-ap-rustc_lexer",
1166 "rustc-hash", 1328 "rustc-hash",
@@ -1190,22 +1352,7 @@ name = "ra_tt"
1190version = "0.1.0" 1352version = "0.1.0"
1191dependencies = [ 1353dependencies = [
1192 "smol_str", 1354 "smol_str",
1193] 1355 "stdx",
1194
1195[[package]]
1196name = "ra_vfs"
1197version = "0.6.1"
1198source = "registry+https://github.com/rust-lang/crates.io-index"
1199checksum = "cbf31a173fc77ec59c27cf39af6baa137b40f4dbd45a8b3eccb1b2e4cfc922c1"
1200dependencies = [
1201 "crossbeam-channel",
1202 "jod-thread",
1203 "log",
1204 "notify",
1205 "parking_lot",
1206 "relative-path",
1207 "rustc-hash",
1208 "walkdir",
1209] 1356]
1210 1357
1211[[package]] 1358[[package]]
@@ -1261,10 +1408,11 @@ dependencies = [
1261 1408
1262[[package]] 1409[[package]]
1263name = "rayon" 1410name = "rayon"
1264version = "1.3.0" 1411version = "1.3.1"
1265source = "registry+https://github.com/rust-lang/crates.io-index" 1412source = "registry+https://github.com/rust-lang/crates.io-index"
1266checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" 1413checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080"
1267dependencies = [ 1414dependencies = [
1415 "autocfg",
1268 "crossbeam-deque", 1416 "crossbeam-deque",
1269 "either", 1417 "either",
1270 "rayon-core", 1418 "rayon-core",
@@ -1272,9 +1420,9 @@ dependencies = [
1272 1420
1273[[package]] 1421[[package]]
1274name = "rayon-core" 1422name = "rayon-core"
1275version = "1.7.0" 1423version = "1.7.1"
1276source = "registry+https://github.com/rust-lang/crates.io-index" 1424source = "registry+https://github.com/rust-lang/crates.io-index"
1277checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" 1425checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280"
1278dependencies = [ 1426dependencies = [
1279 "crossbeam-deque", 1427 "crossbeam-deque",
1280 "crossbeam-queue", 1428 "crossbeam-queue",
@@ -1285,9 +1433,9 @@ dependencies = [
1285 1433
1286[[package]] 1434[[package]]
1287name = "redox_syscall" 1435name = "redox_syscall"
1288version = "0.1.56" 1436version = "0.1.57"
1289source = "registry+https://github.com/rust-lang/crates.io-index" 1437source = "registry+https://github.com/rust-lang/crates.io-index"
1290checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 1438checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1291 1439
1292[[package]] 1440[[package]]
1293name = "regex" 1441name = "regex"
@@ -1302,24 +1450,28 @@ dependencies = [
1302] 1450]
1303 1451
1304[[package]] 1452[[package]]
1305name = "regex-syntax" 1453name = "regex-automata"
1306version = "0.6.18" 1454version = "0.1.9"
1307source = "registry+https://github.com/rust-lang/crates.io-index" 1455source = "registry+https://github.com/rust-lang/crates.io-index"
1308checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" 1456checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4"
1457dependencies = [
1458 "byteorder",
1459 "regex-syntax",
1460]
1309 1461
1310[[package]] 1462[[package]]
1311name = "relative-path" 1463name = "regex-syntax"
1312version = "1.0.0" 1464version = "0.6.18"
1313source = "registry+https://github.com/rust-lang/crates.io-index" 1465source = "registry+https://github.com/rust-lang/crates.io-index"
1314checksum = "bedde000f40f2921ce439ea165c9c53fd629bfa115140c72e22aceacb4a21954" 1466checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
1315 1467
1316[[package]] 1468[[package]]
1317name = "remove_dir_all" 1469name = "remove_dir_all"
1318version = "0.5.2" 1470version = "0.5.3"
1319source = "registry+https://github.com/rust-lang/crates.io-index" 1471source = "registry+https://github.com/rust-lang/crates.io-index"
1320checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" 1472checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
1321dependencies = [ 1473dependencies = [
1322 "winapi 0.3.8", 1474 "winapi 0.3.9",
1323] 1475]
1324 1476
1325[[package]] 1477[[package]]
@@ -1341,8 +1493,9 @@ dependencies = [
1341 "anyhow", 1493 "anyhow",
1342 "crossbeam-channel", 1494 "crossbeam-channel",
1343 "env_logger", 1495 "env_logger",
1496 "expect",
1497 "flycheck",
1344 "globset", 1498 "globset",
1345 "insta",
1346 "itertools", 1499 "itertools",
1347 "jod-thread", 1500 "jod-thread",
1348 "log", 1501 "log",
@@ -1352,21 +1505,22 @@ dependencies = [
1352 "pico-args", 1505 "pico-args",
1353 "ra_cfg", 1506 "ra_cfg",
1354 "ra_db", 1507 "ra_db",
1355 "ra_flycheck",
1356 "ra_hir", 1508 "ra_hir",
1357 "ra_hir_def", 1509 "ra_hir_def",
1358 "ra_hir_ty", 1510 "ra_hir_ty",
1359 "ra_ide", 1511 "ra_ide",
1512 "ra_ide_db",
1360 "ra_mbe", 1513 "ra_mbe",
1361 "ra_proc_macro_srv", 1514 "ra_proc_macro_srv",
1362 "ra_prof", 1515 "ra_prof",
1363 "ra_project_model", 1516 "ra_project_model",
1517 "ra_ssr",
1364 "ra_syntax", 1518 "ra_syntax",
1365 "ra_text_edit", 1519 "ra_text_edit",
1520 "ra_toolchain",
1366 "ra_tt", 1521 "ra_tt",
1367 "ra_vfs",
1368 "rand", 1522 "rand",
1369 "relative-path", 1523 "rayon",
1370 "rustc-hash", 1524 "rustc-hash",
1371 "serde", 1525 "serde",
1372 "serde_json", 1526 "serde_json",
@@ -1374,14 +1528,16 @@ dependencies = [
1374 "tempfile", 1528 "tempfile",
1375 "test_utils", 1529 "test_utils",
1376 "threadpool", 1530 "threadpool",
1377 "winapi 0.3.8", 1531 "vfs",
1532 "vfs-notify",
1533 "winapi 0.3.9",
1378] 1534]
1379 1535
1380[[package]] 1536[[package]]
1381name = "rustc-ap-rustc_lexer" 1537name = "rustc-ap-rustc_lexer"
1382version = "661.0.0" 1538version = "666.0.0"
1383source = "registry+https://github.com/rust-lang/crates.io-index" 1539source = "registry+https://github.com/rust-lang/crates.io-index"
1384checksum = "a6d88abd7c634b52557e46fc7ba47644f0cbe45c358c33f51c532d60d1da239e" 1540checksum = "4e00c526f9f8430ea4cd2178d25b02bfc7debe6677350c57292f92f50e65d2fe"
1385dependencies = [ 1541dependencies = [
1386 "unicode-xid", 1542 "unicode-xid",
1387] 1543]
@@ -1400,18 +1556,19 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
1400 1556
1401[[package]] 1557[[package]]
1402name = "ryu" 1558name = "ryu"
1403version = "1.0.4" 1559version = "1.0.5"
1404source = "registry+https://github.com/rust-lang/crates.io-index" 1560source = "registry+https://github.com/rust-lang/crates.io-index"
1405checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 1561checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
1406 1562
1407[[package]] 1563[[package]]
1408name = "salsa" 1564name = "salsa"
1409version = "0.14.1" 1565version = "0.15.0"
1410source = "registry+https://github.com/rust-lang/crates.io-index" 1566source = "registry+https://github.com/rust-lang/crates.io-index"
1411checksum = "4a006c56096acaaa5e82e5974c28d05ff1e84aa70615f19c53fecf8a1afb2fd2" 1567checksum = "885b4b99dde959decc84e85dd943bd140b4aabd62db2f8206ef5270f77ec20b9"
1412dependencies = [ 1568dependencies = [
1413 "crossbeam", 1569 "crossbeam-utils",
1414 "indexmap", 1570 "indexmap",
1571 "lock_api",
1415 "log", 1572 "log",
1416 "parking_lot", 1573 "parking_lot",
1417 "rand", 1574 "rand",
@@ -1422,9 +1579,9 @@ dependencies = [
1422 1579
1423[[package]] 1580[[package]]
1424name = "salsa-macros" 1581name = "salsa-macros"
1425version = "0.14.1" 1582version = "0.15.0"
1426source = "registry+https://github.com/rust-lang/crates.io-index" 1583source = "registry+https://github.com/rust-lang/crates.io-index"
1427checksum = "038a09b6271446f1123f142fe7e5bef6d4687c4cf82e6986be574c2af3745530" 1584checksum = "2c280ac85b15ac214b86ac4b407626a48e6a1c4f90769a582fec74aa57942b9f"
1428dependencies = [ 1585dependencies = [
1429 "heck", 1586 "heck",
1430 "proc-macro2", 1587 "proc-macro2",
@@ -1491,18 +1648,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1491 1648
1492[[package]] 1649[[package]]
1493name = "serde" 1650name = "serde"
1494version = "1.0.111" 1651version = "1.0.114"
1495source = "registry+https://github.com/rust-lang/crates.io-index" 1652source = "registry+https://github.com/rust-lang/crates.io-index"
1496checksum = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d" 1653checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3"
1497dependencies = [ 1654dependencies = [
1498 "serde_derive", 1655 "serde_derive",
1499] 1656]
1500 1657
1501[[package]] 1658[[package]]
1502name = "serde_derive" 1659name = "serde_derive"
1503version = "1.0.111" 1660version = "1.0.114"
1504source = "registry+https://github.com/rust-lang/crates.io-index" 1661source = "registry+https://github.com/rust-lang/crates.io-index"
1505checksum = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250" 1662checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e"
1506dependencies = [ 1663dependencies = [
1507 "proc-macro2", 1664 "proc-macro2",
1508 "quote", 1665 "quote",
@@ -1511,9 +1668,9 @@ dependencies = [
1511 1668
1512[[package]] 1669[[package]]
1513name = "serde_json" 1670name = "serde_json"
1514version = "1.0.53" 1671version = "1.0.56"
1515source = "registry+https://github.com/rust-lang/crates.io-index" 1672source = "registry+https://github.com/rust-lang/crates.io-index"
1516checksum = "993948e75b189211a9b31a7528f950c6adc21f9720b6438ff80a7fa2f864cea2" 1673checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3"
1517dependencies = [ 1674dependencies = [
1518 "itoa", 1675 "itoa",
1519 "ryu", 1676 "ryu",
@@ -1522,9 +1679,9 @@ dependencies = [
1522 1679
1523[[package]] 1680[[package]]
1524name = "serde_repr" 1681name = "serde_repr"
1525version = "0.1.5" 1682version = "0.1.6"
1526source = "registry+https://github.com/rust-lang/crates.io-index" 1683source = "registry+https://github.com/rust-lang/crates.io-index"
1527checksum = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" 1684checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76"
1528dependencies = [ 1685dependencies = [
1529 "proc-macro2", 1686 "proc-macro2",
1530 "quote", 1687 "quote",
@@ -1533,9 +1690,9 @@ dependencies = [
1533 1690
1534[[package]] 1691[[package]]
1535name = "serde_yaml" 1692name = "serde_yaml"
1536version = "0.8.12" 1693version = "0.8.13"
1537source = "registry+https://github.com/rust-lang/crates.io-index" 1694source = "registry+https://github.com/rust-lang/crates.io-index"
1538checksum = "16c7a592a1ec97c9c1c68d75b6e537dcbf60c7618e038e7841e00af1d9ccf0c4" 1695checksum = "ae3e2dd40a7cdc18ca80db804b7f461a39bb721160a85c9a1fa30134bf3c02a5"
1539dependencies = [ 1696dependencies = [
1540 "dtoa", 1697 "dtoa",
1541 "linked-hash-map", 1698 "linked-hash-map",
@@ -1544,6 +1701,15 @@ dependencies = [
1544] 1701]
1545 1702
1546[[package]] 1703[[package]]
1704name = "sharded-slab"
1705version = "0.0.9"
1706source = "registry+https://github.com/rust-lang/crates.io-index"
1707checksum = "06d5a3f5166fb5b42a5439f2eee8b9de149e235961e3eb21c5808fc3ea17ff3e"
1708dependencies = [
1709 "lazy_static",
1710]
1711
1712[[package]]
1547name = "slab" 1713name = "slab"
1548version = "0.4.2" 1714version = "0.4.2"
1549source = "registry+https://github.com/rust-lang/crates.io-index" 1715source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1551,15 +1717,15 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
1551 1717
1552[[package]] 1718[[package]]
1553name = "smallvec" 1719name = "smallvec"
1554version = "1.4.0" 1720version = "1.4.1"
1555source = "registry+https://github.com/rust-lang/crates.io-index" 1721source = "registry+https://github.com/rust-lang/crates.io-index"
1556checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" 1722checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f"
1557 1723
1558[[package]] 1724[[package]]
1559name = "smol_str" 1725name = "smol_str"
1560version = "0.1.15" 1726version = "0.1.16"
1561source = "registry+https://github.com/rust-lang/crates.io-index" 1727source = "registry+https://github.com/rust-lang/crates.io-index"
1562checksum = "34836c9a295c62c2ce3514471117c5cb269891e8421b2aafdd910050576c4d8b" 1728checksum = "2f7909a1d8bc166a862124d84fdc11bda0ea4ed3157ccca662296919c2972db1"
1563dependencies = [ 1729dependencies = [
1564 "serde", 1730 "serde",
1565] 1731]
@@ -1576,9 +1742,9 @@ checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f"
1576 1742
1577[[package]] 1743[[package]]
1578name = "syn" 1744name = "syn"
1579version = "1.0.29" 1745version = "1.0.34"
1580source = "registry+https://github.com/rust-lang/crates.io-index" 1746source = "registry+https://github.com/rust-lang/crates.io-index"
1581checksum = "bb37da98a55b1d08529362d9cbb863be17556873df2585904ab9d2bc951291d0" 1747checksum = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b"
1582dependencies = [ 1748dependencies = [
1583 "proc-macro2", 1749 "proc-macro2",
1584 "quote", 1750 "quote",
@@ -1587,9 +1753,9 @@ dependencies = [
1587 1753
1588[[package]] 1754[[package]]
1589name = "synstructure" 1755name = "synstructure"
1590version = "0.12.3" 1756version = "0.12.4"
1591source = "registry+https://github.com/rust-lang/crates.io-index" 1757source = "registry+https://github.com/rust-lang/crates.io-index"
1592checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" 1758checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
1593dependencies = [ 1759dependencies = [
1594 "proc-macro2", 1760 "proc-macro2",
1595 "quote", 1761 "quote",
@@ -1608,17 +1774,26 @@ dependencies = [
1608 "rand", 1774 "rand",
1609 "redox_syscall", 1775 "redox_syscall",
1610 "remove_dir_all", 1776 "remove_dir_all",
1611 "winapi 0.3.8", 1777 "winapi 0.3.9",
1778]
1779
1780[[package]]
1781name = "termcolor"
1782version = "1.1.0"
1783source = "registry+https://github.com/rust-lang/crates.io-index"
1784checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
1785dependencies = [
1786 "winapi-util",
1612] 1787]
1613 1788
1614[[package]] 1789[[package]]
1615name = "terminal_size" 1790name = "terminal_size"
1616version = "0.1.12" 1791version = "0.1.13"
1617source = "registry+https://github.com/rust-lang/crates.io-index" 1792source = "registry+https://github.com/rust-lang/crates.io-index"
1618checksum = "8038f95fc7a6f351163f4b964af631bd26c9e828f7db085f2a84aca56f70d13b" 1793checksum = "9a14cd9f8c72704232f0bfc8455c0e861f0ad4eb60cc9ec8a170e231414c1e13"
1619dependencies = [ 1794dependencies = [
1620 "libc", 1795 "libc",
1621 "winapi 0.3.8", 1796 "winapi 0.3.9",
1622] 1797]
1623 1798
1624[[package]] 1799[[package]]
@@ -1635,10 +1810,9 @@ name = "test_utils"
1635version = "0.1.0" 1810version = "0.1.0"
1636dependencies = [ 1811dependencies = [
1637 "difference", 1812 "difference",
1638 "ra_cfg",
1639 "relative-path",
1640 "rustc-hash", 1813 "rustc-hash",
1641 "serde_json", 1814 "serde_json",
1815 "stdx",
1642 "text-size", 1816 "text-size",
1643] 1817]
1644 1818
@@ -1673,6 +1847,108 @@ dependencies = [
1673] 1847]
1674 1848
1675[[package]] 1849[[package]]
1850name = "time"
1851version = "0.1.43"
1852source = "registry+https://github.com/rust-lang/crates.io-index"
1853checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
1854dependencies = [
1855 "libc",
1856 "winapi 0.3.9",
1857]
1858
1859[[package]]
1860name = "tinyvec"
1861version = "0.3.3"
1862source = "registry+https://github.com/rust-lang/crates.io-index"
1863checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed"
1864
1865[[package]]
1866name = "tracing"
1867version = "0.1.16"
1868source = "registry+https://github.com/rust-lang/crates.io-index"
1869checksum = "c2e2a2de6b0d5cbb13fc21193a2296888eaab62b6044479aafb3c54c01c29fcd"
1870dependencies = [
1871 "cfg-if",
1872 "tracing-attributes",
1873 "tracing-core",
1874]
1875
1876[[package]]
1877name = "tracing-attributes"
1878version = "0.1.9"
1879source = "registry+https://github.com/rust-lang/crates.io-index"
1880checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b"
1881dependencies = [
1882 "proc-macro2",
1883 "quote",
1884 "syn",
1885]
1886
1887[[package]]
1888name = "tracing-core"
1889version = "0.1.11"
1890source = "registry+https://github.com/rust-lang/crates.io-index"
1891checksum = "94ae75f0d28ae10786f3b1895c55fe72e79928fd5ccdebb5438c75e93fec178f"
1892dependencies = [
1893 "lazy_static",
1894]
1895
1896[[package]]
1897name = "tracing-log"
1898version = "0.1.1"
1899source = "registry+https://github.com/rust-lang/crates.io-index"
1900checksum = "5e0f8c7178e13481ff6765bd169b33e8d554c5d2bbede5e32c356194be02b9b9"
1901dependencies = [
1902 "lazy_static",
1903 "log",
1904 "tracing-core",
1905]
1906
1907[[package]]
1908name = "tracing-serde"
1909version = "0.1.1"
1910source = "registry+https://github.com/rust-lang/crates.io-index"
1911checksum = "b6ccba2f8f16e0ed268fc765d9b7ff22e965e7185d32f8f1ec8294fe17d86e79"
1912dependencies = [
1913 "serde",
1914 "tracing-core",
1915]
1916
1917[[package]]
1918name = "tracing-subscriber"
1919version = "0.2.7"
1920source = "registry+https://github.com/rust-lang/crates.io-index"
1921checksum = "c72c8cf3ec4ed69fef614d011a5ae4274537a8a8c59133558029bd731eb71659"
1922dependencies = [
1923 "ansi_term 0.11.0",
1924 "chrono",
1925 "lazy_static",
1926 "matchers",
1927 "regex",
1928 "serde",
1929 "serde_json",
1930 "sharded-slab",
1931 "smallvec",
1932 "tracing-core",
1933 "tracing-log",
1934 "tracing-serde",
1935]
1936
1937[[package]]
1938name = "tracing-tree"
1939version = "0.1.4"
1940source = "registry+https://github.com/rust-lang/crates.io-index"
1941checksum = "37ee7f0f53ed2093971a698db799ef56a2dfd89b32e3aeb5165f0e637a02be04"
1942dependencies = [
1943 "ansi_term 0.12.1",
1944 "atty",
1945 "chrono",
1946 "termcolor",
1947 "tracing",
1948 "tracing-subscriber",
1949]
1950
1951[[package]]
1676name = "unicode-bidi" 1952name = "unicode-bidi"
1677version = "0.3.4" 1953version = "0.3.4"
1678source = "registry+https://github.com/rust-lang/crates.io-index" 1954source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1683,11 +1959,11 @@ dependencies = [
1683 1959
1684[[package]] 1960[[package]]
1685name = "unicode-normalization" 1961name = "unicode-normalization"
1686version = "0.1.12" 1962version = "0.1.13"
1687source = "registry+https://github.com/rust-lang/crates.io-index" 1963source = "registry+https://github.com/rust-lang/crates.io-index"
1688checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" 1964checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
1689dependencies = [ 1965dependencies = [
1690 "smallvec", 1966 "tinyvec",
1691] 1967]
1692 1968
1693[[package]] 1969[[package]]
@@ -1698,9 +1974,9 @@ checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
1698 1974
1699[[package]] 1975[[package]]
1700name = "unicode-xid" 1976name = "unicode-xid"
1701version = "0.2.0" 1977version = "0.2.1"
1702source = "registry+https://github.com/rust-lang/crates.io-index" 1978source = "registry+https://github.com/rust-lang/crates.io-index"
1703checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1979checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
1704 1980
1705[[package]] 1981[[package]]
1706name = "url" 1982name = "url"
@@ -1715,13 +1991,37 @@ dependencies = [
1715] 1991]
1716 1992
1717[[package]] 1993[[package]]
1994name = "vfs"
1995version = "0.1.0"
1996dependencies = [
1997 "fst",
1998 "paths",
1999 "rustc-hash",
2000]
2001
2002[[package]]
2003name = "vfs-notify"
2004version = "0.1.0"
2005dependencies = [
2006 "crossbeam-channel",
2007 "globset",
2008 "jod-thread",
2009 "log",
2010 "notify",
2011 "paths",
2012 "rustc-hash",
2013 "vfs",
2014 "walkdir",
2015]
2016
2017[[package]]
1718name = "walkdir" 2018name = "walkdir"
1719version = "2.3.1" 2019version = "2.3.1"
1720source = "registry+https://github.com/rust-lang/crates.io-index" 2020source = "registry+https://github.com/rust-lang/crates.io-index"
1721checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" 2021checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
1722dependencies = [ 2022dependencies = [
1723 "same-file", 2023 "same-file",
1724 "winapi 0.3.8", 2024 "winapi 0.3.9",
1725 "winapi-util", 2025 "winapi-util",
1726] 2026]
1727 2027
@@ -1739,9 +2039,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
1739 2039
1740[[package]] 2040[[package]]
1741name = "winapi" 2041name = "winapi"
1742version = "0.3.8" 2042version = "0.3.9"
1743source = "registry+https://github.com/rust-lang/crates.io-index" 2043source = "registry+https://github.com/rust-lang/crates.io-index"
1744checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 2044checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1745dependencies = [ 2045dependencies = [
1746 "winapi-i686-pc-windows-gnu", 2046 "winapi-i686-pc-windows-gnu",
1747 "winapi-x86_64-pc-windows-gnu", 2047 "winapi-x86_64-pc-windows-gnu",
@@ -1765,7 +2065,7 @@ version = "0.1.5"
1765source = "registry+https://github.com/rust-lang/crates.io-index" 2065source = "registry+https://github.com/rust-lang/crates.io-index"
1766checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2066checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1767dependencies = [ 2067dependencies = [
1768 "winapi 0.3.8", 2068 "winapi 0.3.9",
1769] 2069]
1770 2070
1771[[package]] 2071[[package]]
@@ -1789,6 +2089,7 @@ name = "xtask"
1789version = "0.1.0" 2089version = "0.1.0"
1790dependencies = [ 2090dependencies = [
1791 "anyhow", 2091 "anyhow",
2092 "flate2",
1792 "pico-args", 2093 "pico-args",
1793 "proc-macro2", 2094 "proc-macro2",
1794 "quote", 2095 "quote",
@@ -1797,9 +2098,9 @@ dependencies = [
1797 2098
1798[[package]] 2099[[package]]
1799name = "yaml-rust" 2100name = "yaml-rust"
1800version = "0.4.3" 2101version = "0.4.4"
1801source = "registry+https://github.com/rust-lang/crates.io-index" 2102source = "registry+https://github.com/rust-lang/crates.io-index"
1802checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" 2103checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d"
1803dependencies = [ 2104dependencies = [
1804 "linked-hash-map", 2105 "linked-hash-map",
1805] 2106]
diff --git a/Cargo.toml b/Cargo.toml
index 5278b5a16..612e6809f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,9 +24,16 @@ opt-level = 0
24opt-level = 0 24opt-level = 0
25[profile.release.package.salsa-macros] 25[profile.release.package.salsa-macros]
26opt-level = 0 26opt-level = 0
27[profile.release.package.tracing-attributes]
28opt-level = 0
27[profile.release.package.xtask] 29[profile.release.package.xtask]
28opt-level = 0 30opt-level = 0
29 31
32# Gzipping the artifacts is up to 10 times faster with optimizations (`cargo xtask dist`).
33# `miniz_oxide` is the direct dependency of `flate2` which does all the heavy lifting
34[profile.dev.package.miniz_oxide]
35opt-level = 3
36
30[patch.'crates-io'] 37[patch.'crates-io']
31# rowan = { path = "../rowan" } 38# rowan = { path = "../rowan" }
32 39
diff --git a/README.md b/README.md
index 1e7c3e9b4..7ba705e73 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@ Work on rust-analyzer is sponsored by
12 12
13[<img src="https://user-images.githubusercontent.com/1711539/58105231-cf306900-7bee-11e9-83d8-9f1102e59d29.png" alt="Ferrous Systems" width="300">](https://ferrous-systems.com/) 13[<img src="https://user-images.githubusercontent.com/1711539/58105231-cf306900-7bee-11e9-83d8-9f1102e59d29.png" alt="Ferrous Systems" width="300">](https://ferrous-systems.com/)
14- [Mozilla](https://www.mozilla.org/en-US/) 14- [Mozilla](https://www.mozilla.org/en-US/)
15- [Embark Studios](https://embark-studios.com/)
15- [freiheit.com](https://www.freiheit.com) 16- [freiheit.com](https://www.freiheit.com)
16 17
17## Quick Start 18## Quick Start
diff --git a/crates/expect/Cargo.toml b/crates/expect/Cargo.toml
new file mode 100644
index 000000000..77775630d
--- /dev/null
+++ b/crates/expect/Cargo.toml
@@ -0,0 +1,14 @@
1[package]
2name = "expect"
3version = "0.1.0"
4authors = ["rust-analyzer developers"]
5edition = "2018"
6license = "MIT OR Apache-2.0"
7
8[lib]
9doctest = false
10
11[dependencies]
12once_cell = "1"
13difference = "2"
14stdx = { path = "../stdx" }
diff --git a/crates/expect/src/lib.rs b/crates/expect/src/lib.rs
new file mode 100644
index 000000000..21a458d47
--- /dev/null
+++ b/crates/expect/src/lib.rs
@@ -0,0 +1,356 @@
1//! Snapshot testing library, see
2//! https://github.com/rust-analyzer/rust-analyzer/pull/5101
3use std::{
4 collections::HashMap,
5 env, fmt, fs, mem,
6 ops::Range,
7 panic,
8 path::{Path, PathBuf},
9 sync::Mutex,
10};
11
12use difference::Changeset;
13use once_cell::sync::Lazy;
14use stdx::{lines_with_ends, trim_indent};
15
16const HELP: &str = "
17You can update all `expect![[]]` tests by running:
18
19 env UPDATE_EXPECT=1 cargo test
20
21To update a single test, place the cursor on `expect` token and use `run` feature of rust-analyzer.
22";
23
24fn update_expect() -> bool {
25 env::var("UPDATE_EXPECT").is_ok()
26}
27
28/// expect![[r#"inline snapshot"#]]
29#[macro_export]
30macro_rules! expect {
31 [[$data:literal]] => {$crate::Expect {
32 position: $crate::Position {
33 file: file!(),
34 line: line!(),
35 column: column!(),
36 },
37 data: $data,
38 }};
39 [[]] => { $crate::expect![[""]] };
40}
41
42/// expect_file!["/crates/foo/test_data/bar.html"]
43#[macro_export]
44macro_rules! expect_file {
45 [$path:expr] => {$crate::ExpectFile {
46 path: std::path::PathBuf::from($path)
47 }};
48}
49
50#[derive(Debug)]
51pub struct Expect {
52 pub position: Position,
53 pub data: &'static str,
54}
55
56#[derive(Debug)]
57pub struct ExpectFile {
58 pub path: PathBuf,
59}
60
61#[derive(Debug)]
62pub struct Position {
63 pub file: &'static str,
64 pub line: u32,
65 pub column: u32,
66}
67
68impl fmt::Display for Position {
69 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
70 write!(f, "{}:{}:{}", self.file, self.line, self.column)
71 }
72}
73
74impl Expect {
75 pub fn assert_eq(&self, actual: &str) {
76 let trimmed = self.trimmed();
77 if &trimmed == actual {
78 return;
79 }
80 Runtime::fail_expect(self, &trimmed, actual);
81 }
82 pub fn assert_debug_eq(&self, actual: &impl fmt::Debug) {
83 let actual = format!("{:#?}\n", actual);
84 self.assert_eq(&actual)
85 }
86
87 fn trimmed(&self) -> String {
88 if !self.data.contains('\n') {
89 return self.data.to_string();
90 }
91 trim_indent(self.data)
92 }
93
94 fn locate(&self, file: &str) -> Location {
95 let mut target_line = None;
96 let mut line_start = 0;
97 for (i, line) in lines_with_ends(file).enumerate() {
98 if i == self.position.line as usize - 1 {
99 let pat = "expect![[";
100 let offset = line.find(pat).unwrap();
101 let literal_start = line_start + offset + pat.len();
102 let indent = line.chars().take_while(|&it| it == ' ').count();
103 target_line = Some((literal_start, indent));
104 break;
105 }
106 line_start += line.len();
107 }
108 let (literal_start, line_indent) = target_line.unwrap();
109 let literal_length =
110 file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`.");
111 let literal_range = literal_start..literal_start + literal_length;
112 Location { line_indent, literal_range }
113 }
114}
115
116impl ExpectFile {
117 pub fn assert_eq(&self, actual: &str) {
118 let expected = self.read();
119 if actual == expected {
120 return;
121 }
122 Runtime::fail_file(self, &expected, actual);
123 }
124 pub fn assert_debug_eq(&self, actual: &impl fmt::Debug) {
125 let actual = format!("{:#?}\n", actual);
126 self.assert_eq(&actual)
127 }
128 fn read(&self) -> String {
129 fs::read_to_string(self.abs_path()).unwrap_or_default().replace("\r\n", "\n")
130 }
131 fn write(&self, contents: &str) {
132 fs::write(self.abs_path(), contents).unwrap()
133 }
134 fn abs_path(&self) -> PathBuf {
135 WORKSPACE_ROOT.join(&self.path)
136 }
137}
138
139#[derive(Default)]
140struct Runtime {
141 help_printed: bool,
142 per_file: HashMap<&'static str, FileRuntime>,
143}
144static RT: Lazy<Mutex<Runtime>> = Lazy::new(Default::default);
145
146impl Runtime {
147 fn fail_expect(expect: &Expect, expected: &str, actual: &str) {
148 let mut rt = RT.lock().unwrap_or_else(|poisoned| poisoned.into_inner());
149 if update_expect() {
150 println!("\x1b[1m\x1b[92mupdating\x1b[0m: {}", expect.position);
151 rt.per_file
152 .entry(expect.position.file)
153 .or_insert_with(|| FileRuntime::new(expect))
154 .update(expect, actual);
155 return;
156 }
157 rt.panic(expect.position.to_string(), expected, actual);
158 }
159
160 fn fail_file(expect: &ExpectFile, expected: &str, actual: &str) {
161 let mut rt = RT.lock().unwrap_or_else(|poisoned| poisoned.into_inner());
162 if update_expect() {
163 println!("\x1b[1m\x1b[92mupdating\x1b[0m: {}", expect.path.display());
164 expect.write(actual);
165 return;
166 }
167 rt.panic(expect.path.display().to_string(), expected, actual);
168 }
169
170 fn panic(&mut self, position: String, expected: &str, actual: &str) {
171 let print_help = !mem::replace(&mut self.help_printed, true);
172 let help = if print_help { HELP } else { "" };
173
174 let diff = Changeset::new(actual, expected, "\n");
175
176 println!(
177 "\n
178\x1b[1m\x1b[91merror\x1b[97m: expect test failed\x1b[0m
179 \x1b[1m\x1b[34m-->\x1b[0m {}
180{}
181\x1b[1mExpect\x1b[0m:
182----
183{}
184----
185
186\x1b[1mActual\x1b[0m:
187----
188{}
189----
190
191\x1b[1mDiff\x1b[0m:
192----
193{}
194----
195",
196 position, help, expected, actual, diff
197 );
198 // Use resume_unwind instead of panic!() to prevent a backtrace, which is unnecessary noise.
199 panic::resume_unwind(Box::new(()));
200 }
201}
202
203struct FileRuntime {
204 path: PathBuf,
205 original_text: String,
206 patchwork: Patchwork,
207}
208
209impl FileRuntime {
210 fn new(expect: &Expect) -> FileRuntime {
211 let path = WORKSPACE_ROOT.join(expect.position.file);
212 let original_text = fs::read_to_string(&path).unwrap();
213 let patchwork = Patchwork::new(original_text.clone());
214 FileRuntime { path, original_text, patchwork }
215 }
216 fn update(&mut self, expect: &Expect, actual: &str) {
217 let loc = expect.locate(&self.original_text);
218 let patch = format_patch(loc.line_indent.clone(), actual);
219 self.patchwork.patch(loc.literal_range, &patch);
220 fs::write(&self.path, &self.patchwork.text).unwrap()
221 }
222}
223
224#[derive(Debug)]
225struct Location {
226 line_indent: usize,
227 literal_range: Range<usize>,
228}
229
230#[derive(Debug)]
231struct Patchwork {
232 text: String,
233 indels: Vec<(Range<usize>, usize)>,
234}
235
236impl Patchwork {
237 fn new(text: String) -> Patchwork {
238 Patchwork { text, indels: Vec::new() }
239 }
240 fn patch(&mut self, mut range: Range<usize>, patch: &str) {
241 self.indels.push((range.clone(), patch.len()));
242 self.indels.sort_by_key(|(delete, _insert)| delete.start);
243
244 let (delete, insert) = self
245 .indels
246 .iter()
247 .take_while(|(delete, _)| delete.start < range.start)
248 .map(|(delete, insert)| (delete.end - delete.start, insert))
249 .fold((0usize, 0usize), |(x1, y1), (x2, y2)| (x1 + x2, y1 + y2));
250
251 for pos in &mut [&mut range.start, &mut range.end] {
252 **pos -= delete;
253 **pos += insert;
254 }
255
256 self.text.replace_range(range, &patch);
257 }
258}
259
260fn format_patch(line_indent: usize, patch: &str) -> String {
261 let mut max_hashes = 0;
262 let mut cur_hashes = 0;
263 for byte in patch.bytes() {
264 if byte != b'#' {
265 cur_hashes = 0;
266 continue;
267 }
268 cur_hashes += 1;
269 max_hashes = max_hashes.max(cur_hashes);
270 }
271 let hashes = &"#".repeat(max_hashes + 1);
272 let indent = &" ".repeat(line_indent);
273 let is_multiline = patch.contains('\n');
274
275 let mut buf = String::new();
276 buf.push('r');
277 buf.push_str(hashes);
278 buf.push('"');
279 if is_multiline {
280 buf.push('\n');
281 }
282 let mut final_newline = false;
283 for line in lines_with_ends(patch) {
284 if is_multiline && !line.trim().is_empty() {
285 buf.push_str(indent);
286 buf.push_str(" ");
287 }
288 buf.push_str(line);
289 final_newline = line.ends_with('\n');
290 }
291 if final_newline {
292 buf.push_str(indent);
293 }
294 buf.push('"');
295 buf.push_str(hashes);
296 buf
297}
298
299static WORKSPACE_ROOT: Lazy<PathBuf> = Lazy::new(|| {
300 let my_manifest =
301 env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned());
302 // Heuristic, see https://github.com/rust-lang/cargo/issues/3946
303 Path::new(&my_manifest)
304 .ancestors()
305 .filter(|it| it.join("Cargo.toml").exists())
306 .last()
307 .unwrap()
308 .to_path_buf()
309});
310
311#[cfg(test)]
312mod tests {
313 use super::*;
314
315 #[test]
316 fn test_format_patch() {
317 let patch = format_patch(0, "hello\nworld\n");
318 expect![[r##"
319 r#"
320 hello
321 world
322 "#"##]]
323 .assert_eq(&patch);
324
325 let patch = format_patch(4, "single line");
326 expect![[r##"r#"single line"#"##]].assert_eq(&patch);
327 }
328
329 #[test]
330 fn test_patchwork() {
331 let mut patchwork = Patchwork::new("one two three".to_string());
332 patchwork.patch(4..7, "zwei");
333 patchwork.patch(0..3, "один");
334 patchwork.patch(8..13, "3");
335 expect![[r#"
336 Patchwork {
337 text: "один zwei 3",
338 indels: [
339 (
340 0..3,
341 8,
342 ),
343 (
344 4..7,
345 4,
346 ),
347 (
348 8..13,
349 1,
350 ),
351 ],
352 }
353 "#]]
354 .assert_debug_eq(&patchwork);
355 }
356}
diff --git a/crates/ra_flycheck/Cargo.toml b/crates/flycheck/Cargo.toml
index 1aa39bade..bea485694 100644
--- a/crates/ra_flycheck/Cargo.toml
+++ b/crates/flycheck/Cargo.toml
@@ -1,8 +1,9 @@
1[package] 1[package]
2edition = "2018" 2edition = "2018"
3name = "ra_flycheck" 3name = "flycheck"
4version = "0.1.0" 4version = "0.1.0"
5authors = ["rust-analyzer developers"] 5authors = ["rust-analyzer developers"]
6license = "MIT OR Apache-2.0"
6 7
7[lib] 8[lib]
8doctest = false 9doctest = false
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
new file mode 100644
index 000000000..6804d9bda
--- /dev/null
+++ b/crates/flycheck/src/lib.rs
@@ -0,0 +1,317 @@
1//! cargo_check provides the functionality needed to run `cargo check` or
2//! another compatible command (f.x. clippy) in a background thread and provide
3//! LSP diagnostics based on the output of the command.
4
5use std::{
6 fmt,
7 io::{self, BufReader},
8 ops,
9 path::PathBuf,
10 process::{self, Command, Stdio},
11 time::Duration,
12};
13
14use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
15
16pub use cargo_metadata::diagnostic::{
17 Applicability, Diagnostic, DiagnosticCode, DiagnosticLevel, DiagnosticSpan,
18 DiagnosticSpanMacroExpansion,
19};
20
21#[derive(Clone, Debug, PartialEq, Eq)]
22pub enum FlycheckConfig {
23 CargoCommand {
24 command: String,
25 all_targets: bool,
26 all_features: bool,
27 features: Vec<String>,
28 extra_args: Vec<String>,
29 },
30 CustomCommand {
31 command: String,
32 args: Vec<String>,
33 },
34}
35
36impl fmt::Display for FlycheckConfig {
37 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
38 match self {
39 FlycheckConfig::CargoCommand { command, .. } => write!(f, "cargo {}", command),
40 FlycheckConfig::CustomCommand { command, args } => {
41 write!(f, "{} {}", command, args.join(" "))
42 }
43 }
44 }
45}
46
47/// Flycheck wraps the shared state and communication machinery used for
48/// running `cargo check` (or other compatible command) and providing
49/// diagnostics based on the output.
50/// The spawned thread is shut down when this struct is dropped.
51#[derive(Debug)]
52pub struct FlycheckHandle {
53 // XXX: drop order is significant
54 sender: Sender<Restart>,
55 thread: jod_thread::JoinHandle,
56}
57
58impl FlycheckHandle {
59 pub fn spawn(
60 sender: Box<dyn Fn(Message) + Send>,
61 config: FlycheckConfig,
62 workspace_root: PathBuf,
63 ) -> FlycheckHandle {
64 let actor = FlycheckActor::new(sender, config, workspace_root);
65 let (sender, receiver) = unbounded::<Restart>();
66 let thread = jod_thread::spawn(move || actor.run(receiver));
67 FlycheckHandle { sender, thread }
68 }
69
70 /// Schedule a re-start of the cargo check worker.
71 pub fn update(&self) {
72 self.sender.send(Restart).unwrap();
73 }
74}
75
76#[derive(Debug)]
77pub enum Message {
78 /// Request adding a diagnostic with fixes included to a file
79 AddDiagnostic { workspace_root: PathBuf, diagnostic: Diagnostic },
80
81 /// Request check progress notification to client
82 Progress(Progress),
83}
84
85#[derive(Debug)]
86pub enum Progress {
87 DidStart,
88 DidCheckCrate(String),
89 DidFinish(io::Result<()>),
90 DidCancel,
91}
92
93struct Restart;
94
95struct FlycheckActor {
96 sender: Box<dyn Fn(Message) + Send>,
97 config: FlycheckConfig,
98 workspace_root: PathBuf,
99 /// WatchThread exists to wrap around the communication needed to be able to
100 /// run `cargo check` without blocking. Currently the Rust standard library
101 /// doesn't provide a way to read sub-process output without blocking, so we
102 /// have to wrap sub-processes output handling in a thread and pass messages
103 /// back over a channel.
104 cargo_handle: Option<CargoHandle>,
105}
106
107enum Event {
108 Restart(Restart),
109 CheckEvent(Option<cargo_metadata::Message>),
110}
111
112impl FlycheckActor {
113 fn new(
114 sender: Box<dyn Fn(Message) + Send>,
115 config: FlycheckConfig,
116 workspace_root: PathBuf,
117 ) -> FlycheckActor {
118 FlycheckActor { sender, config, workspace_root, cargo_handle: None }
119 }
120 fn next_event(&self, inbox: &Receiver<Restart>) -> Option<Event> {
121 let check_chan = self.cargo_handle.as_ref().map(|cargo| &cargo.receiver);
122 select! {
123 recv(inbox) -> msg => msg.ok().map(Event::Restart),
124 recv(check_chan.unwrap_or(&never())) -> msg => Some(Event::CheckEvent(msg.ok())),
125 }
126 }
127 fn run(mut self, inbox: Receiver<Restart>) {
128 while let Some(event) = self.next_event(&inbox) {
129 match event {
130 Event::Restart(Restart) => {
131 while let Ok(Restart) = inbox.recv_timeout(Duration::from_millis(50)) {}
132
133 self.cancel_check_process();
134
135 let mut command = self.check_command();
136 log::info!("restart flycheck {:?}", command);
137 command.stdout(Stdio::piped()).stderr(Stdio::null()).stdin(Stdio::null());
138 if let Ok(child) = command.spawn().map(JodChild) {
139 self.cargo_handle = Some(CargoHandle::spawn(child));
140 self.send(Message::Progress(Progress::DidStart));
141 }
142 }
143 Event::CheckEvent(None) => {
144 // Watcher finished, replace it with a never channel to
145 // avoid busy-waiting.
146 let cargo_handle = self.cargo_handle.take().unwrap();
147 let res = cargo_handle.join();
148 self.send(Message::Progress(Progress::DidFinish(res)));
149 }
150 Event::CheckEvent(Some(message)) => match message {
151 cargo_metadata::Message::CompilerArtifact(msg) => {
152 self.send(Message::Progress(Progress::DidCheckCrate(msg.target.name)));
153 }
154
155 cargo_metadata::Message::CompilerMessage(msg) => {
156 self.send(Message::AddDiagnostic {
157 workspace_root: self.workspace_root.clone(),
158 diagnostic: msg.message,
159 });
160 }
161
162 cargo_metadata::Message::BuildScriptExecuted(_)