diff options
-rw-r--r-- | .cargo/config | 12 | ||||
-rw-r--r-- | .travis.yml | 9 | ||||
-rw-r--r-- | Cargo.lock | 101 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | crates/ra_assists/src/assist_ctx.rs | 15 | ||||
-rw-r--r-- | crates/ra_assists/src/auto_import.rs | 18 | ||||
-rw-r--r-- | crates/ra_cli/src/analysis_bench.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 148 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/tests/mods.rs | 53 | ||||
-rw-r--r-- | crates/ra_ide_api/src/inlay_hints.rs | 470 | ||||
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 86 | ||||
-rw-r--r-- | crates/ra_ide_api/src/references.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide_api/src/syntax_tree.rs | 14 | ||||
-rw-r--r-- | crates/ra_ide_api/src/typing.rs | 4 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 14 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 70 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/req.rs | 4 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/world.rs | 7 | ||||
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 3 | ||||
-rw-r--r-- | crates/ra_syntax/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/tests.rs (renamed from crates/ra_syntax/tests/test.rs) | 17 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation.rs | 91 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/unescape.rs | 521 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/00012_block_comment.rs (renamed from crates/ra_syntax/tests/data/lexer/00012_block_comment.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/00012_block_comment.txt (renamed from crates/ra_syntax/tests/data/lexer/00012_block_comment.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0001_hello.rs (renamed from crates/ra_syntax/tests/data/lexer/0001_hello.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0001_hello.txt (renamed from crates/ra_syntax/tests/data/lexer/0001_hello.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0002_whitespace.rs (renamed from crates/ra_syntax/tests/data/lexer/0002_whitespace.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0002_whitespace.txt (renamed from crates/ra_syntax/tests/data/lexer/0002_whitespace.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0003_ident.rs (renamed from crates/ra_syntax/tests/data/lexer/0003_ident.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0003_ident.txt (renamed from crates/ra_syntax/tests/data/lexer/0003_ident.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0004_numbers.rs (renamed from crates/ra_syntax/tests/data/lexer/0004_numbers.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0004_numbers.txt (renamed from crates/ra_syntax/tests/data/lexer/0004_numbers.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0005_symbols.rs (renamed from crates/ra_syntax/tests/data/lexer/0005_symbols.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0005_symbols.txt (renamed from crates/ra_syntax/tests/data/lexer/0005_symbols.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0006_chars.rs (renamed from crates/ra_syntax/tests/data/lexer/0006_chars.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0006_chars.txt (renamed from crates/ra_syntax/tests/data/lexer/0006_chars.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0007_lifetimes.rs (renamed from crates/ra_syntax/tests/data/lexer/0007_lifetimes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0007_lifetimes.txt (renamed from crates/ra_syntax/tests/data/lexer/0007_lifetimes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0008_byte_strings.rs (renamed from crates/ra_syntax/tests/data/lexer/0008_byte_strings.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0008_byte_strings.txt (renamed from crates/ra_syntax/tests/data/lexer/0008_byte_strings.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0009_strings.rs (renamed from crates/ra_syntax/tests/data/lexer/0009_strings.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0009_strings.txt (renamed from crates/ra_syntax/tests/data/lexer/0009_strings.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0010_comments.rs (renamed from crates/ra_syntax/tests/data/lexer/0010_comments.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0010_comments.txt (renamed from crates/ra_syntax/tests/data/lexer/0010_comments.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0011_keywords.rs (renamed from crates/ra_syntax/tests/data/lexer/0011_keywords.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0011_keywords.txt (renamed from crates/ra_syntax/tests/data/lexer/0011_keywords.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0013_raw_strings.rs (renamed from crates/ra_syntax/tests/data/lexer/0013_raw_strings.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0013_raw_strings.txt (renamed from crates/ra_syntax/tests/data/lexer/0013_raw_strings.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0014_unclosed_char.rs (renamed from crates/ra_syntax/tests/data/lexer/0014_unclosed_char.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0014_unclosed_char.txt (renamed from crates/ra_syntax/tests/data/lexer/0014_unclosed_char.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0015_unclosed_string.rs (renamed from crates/ra_syntax/tests/data/lexer/0015_unclosed_string.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0015_unclosed_string.txt (renamed from crates/ra_syntax/tests/data/lexer/0015_unclosed_string.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0016_raw_ident.rs (renamed from crates/ra_syntax/tests/data/lexer/0016_raw_ident.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/lexer/0016_raw_ident.txt (renamed from crates/ra_syntax/tests/data/lexer/0016_raw_ident.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rs (renamed from crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.txt (renamed from crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rs (renamed from crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.txt (renamed from crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.rs (renamed from crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.txt (renamed from crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rs (renamed from crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.txt (renamed from crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rs (renamed from crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.txt (renamed from crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rs (renamed from crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0005_attribute_recover.txt (renamed from crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rs (renamed from crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.txt (renamed from crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rs (renamed from crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.txt (renamed from crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rs (renamed from crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.txt (renamed from crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rs (renamed from crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.txt (renamed from crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rs (renamed from crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.txt (renamed from crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0011_extern_struct.rs (renamed from crates/ra_syntax/tests/data/parser/err/0011_extern_struct.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0011_extern_struct.txt (renamed from crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0012_broken_lambda.txt (renamed from crates/ra_syntax/tests/data/parser/err/0012_broken_lambda.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0013_invalid_type.rs (renamed from crates/ra_syntax/tests/data/parser/err/0013_invalid_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0013_invalid_type.txt (renamed from crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rs (renamed from crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.txt (renamed from crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rs (renamed from crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0015_curly_in_params.txt (renamed from crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0016_missing_semi.rs (renamed from crates/ra_syntax/tests/data/parser/err/0016_missing_semi.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0016_missing_semi.txt (renamed from crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rs (renamed from crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.txt (renamed from crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rs (renamed from crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.txt (renamed from crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0019_let_recover.rs (renamed from crates/ra_syntax/tests/data/parser/err/0019_let_recover.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0019_let_recover.txt (renamed from crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0020_fn_recover.rs (renamed from crates/ra_syntax/tests/data/parser/err/0020_fn_recover.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0020_fn_recover.txt (renamed from crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rs (renamed from crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0021_incomplete_param.txt (renamed from crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rs (renamed from crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt (renamed from crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rs (renamed from crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.txt (renamed from crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rs (renamed from crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt (renamed from crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0025_nope.rs (renamed from crates/ra_syntax/tests/data/parser/err/0025_nope.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0025_nope.txt (renamed from crates/ra_syntax/tests/data/parser/err/0025_nope.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rs (renamed from crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0026_imp_recovery.txt (renamed from crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rs (renamed from crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.txt (renamed from crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0028_macro_2.0.rs (renamed from crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt (renamed from crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0029_field_completion.rs (renamed from crates/ra_syntax/tests/data/parser/err/0029_field_completion.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0029_field_completion.txt (renamed from crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/fuzz-failures/0000.rs (renamed from crates/ra_syntax/tests/data/parser/fuzz-failures/0000.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/fuzz-failures/0001.rs (renamed from crates/ra_syntax/tests/data/parser/fuzz-failures/0001.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/fuzz-failures/0002.rs (renamed from crates/ra_syntax/tests/data/parser/fuzz-failures/0002.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/fuzz-failures/0003.rs (renamed from crates/ra_syntax/tests/data/parser/fuzz-failures/0003.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/fuzz-failures/0004.rs (renamed from crates/ra_syntax/tests/data/parser/fuzz-failures/0004.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/err/0014_default_fn_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/err/0014_default_fn_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0001_trait_item_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0002_use_tree_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0003_where_pred_for.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0004_value_parameters_no_patterns.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0005_function_type_params.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0006_self_param.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0007_type_param_bounds.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0008_path_part.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0009_loop_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0010_extern_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0011_field_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0012_type_item_where_clause.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0013_pointer_type_mut.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0014_never_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0015_continue_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0016_unsafe_trait.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0017_array_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0018_arb_self_types.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0019_unary_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0020_use_star.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0021_impl_item_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0022_crate_visibility.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0023_placeholder_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0024_slice_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0025_slice_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0026_tuple_pat_fields.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0027_ref_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0028_impl_trait_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0029_cast_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0030_cond.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0031_while_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0032_fn_pointer_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0033_reference_type;.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0034_break_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0036_unsafe_extern_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0037_qual_paths.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0038_full_range_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0039_type_arg.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0040_crate_keyword_vis.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0041_trait_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0042_call_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0043_use_alias.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0044_block_items.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0045_param_list_opt_patterns.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0046_singleton_tuple_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0047_unsafe_default_impl.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0048_path_type_with_bounds.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0050_fn_decl.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0051_unit_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0052_path_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0053_path_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0054_field_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0054_field_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0055_literal_pattern.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0056_where_clause.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0057_const_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0058_range_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0059_match_arms_commas.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0060_extern_crate.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0061_struct_lit.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0061_struct_lit.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0062_mod_contents.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_block_neg.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0063_impl_block_neg.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0063_impl_block_neg.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0064_if_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0065_dyn_trait_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0066_match_arm.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0067_crate_path.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0068_union_items.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0069_use_tree_list_after_path.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0071_match_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0072_return_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0073_type_item_type_params.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0075_block.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0075_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0075_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0076_function_where_clause.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0077_try_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0078_type_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0079_impl_block.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0079_impl_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0080_postfix_range.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0081_for_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0082_ref_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0083_struct_items.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0084_paren_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0085_expr_literals.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0086_function_ret_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0087_unsafe_impl.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0088_break_ambiguity.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0089_extern_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0090_type_param_default.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0091_auto_trait.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0093_index_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0094_unsafe_auto_trait.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0095_placeholder_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0096_no_semi_after_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0097_default_impl.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0098_const_unsafe_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0099_param_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0100_for_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0101_unsafe_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0102_field_pat_list.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0102_field_pat_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0103_array_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0104_path_fn_trait_args.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0105_block_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0106_lambda_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0107_method_call_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0108_tuple_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0109_label.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0109_label.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0109_label.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0110_use_path.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0111_tuple_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0112_bind_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0113_nocontentexpr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0113_nocontentexpr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0114_tuple_struct_where.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0114_tuple_struct_where.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0115_pos_field_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0115_pos_field_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0115_pos_field_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0116_trait_fn_placeholder_parameter.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0116_trait_fn_placeholder_parameter.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0117_macro_call_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0118_impl_inner_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0118_impl_inner_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0118_match_guard.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0118_match_guard.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0120_match_arms_inner_attribute.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0120_match_arms_inner_attribute.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0121_match_arms_outer_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0121_match_arms_outer_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0122_generic_lifetime_type_attribute.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0123_param_list_vararg.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0123_param_list_vararg.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0124_async_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0124_async_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0125_crate_keyword_path.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0125_struct_literal_field_with_attr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0125_struct_literal_field_with_attr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0125_struct_literal_field_with_attr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0126_attr_on_expr_stmt.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0126_attr_on_expr_stmt.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0127_attr_on_last_expr_in_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0128_combined_fns.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0128_combined_fns.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0129_marco_pat.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0130_let_stmt.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0130_let_stmt.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0130_try_block_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0131_existential_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0131_existential_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rs | 5 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt | 89 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0132_default_fn_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0132_default_fn_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0134_nocontentexpr_after_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0134_nocontentexpr_after_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0135_first_array_member_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0135_first_array_member_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0136_subsequent_array_member_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0136_subsequent_array_member_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rs (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0137_await_expr.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt (renamed from crates/ra_syntax/tests/data/parser/inline/ok/0137_await_expr.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0000_empty.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0000_empty.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0000_empty.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0000_empty.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0001_struct_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0001_struct_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0001_struct_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0001_struct_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0002_struct_item_field.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0002_struct_item_field.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0004_file_shebang.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0004_file_shebang.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0004_file_shebang.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0004_file_shebang.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0005_fn_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0005_fn_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0005_fn_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0005_fn_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0006_inner_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0006_inner_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0007_extern_crate.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0007_extern_crate.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0007_extern_crate.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0008_mod_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0008_mod_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0008_mod_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0008_mod_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0009_use_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0009_use_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0009_use_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0009_use_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0010_use_path_segments.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0010_use_path_segments.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0011_outer_attribute.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0011_outer_attribute.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0012_visibility.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0012_visibility.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0012_visibility.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0012_visibility.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0013_use_path_self_super.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0013_use_path_self_super.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0014_use_tree.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0014_use_tree.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0014_use_tree.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0014_use_tree.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0015_use_tree.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0015_use_tree.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0015_use_tree.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0015_use_tree.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0016_struct_flavors.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0016_struct_flavors.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0017_attr_trailing_comma.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0017_attr_trailing_comma.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0018_struct_type_params.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0018_struct_type_params.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0019_enums.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0019_enums.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0019_enums.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0019_enums.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0020_type_param_bounds.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0020_type_param_bounds.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0021_extern_fn.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0021_extern_fn.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0021_extern_fn.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0022_empty_extern_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0022_empty_extern_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0023_static_items.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0023_static_items.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0023_static_items.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0023_static_items.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0024_const_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0024_const_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0024_const_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0024_const_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0025_extern_fn_in_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0025_extern_fn_in_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0026_const_fn_in_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0026_const_fn_in_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0027_unsafe_fn_in_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0027_unsafe_fn_in_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0028_operator_binding_power.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0028_operator_binding_power.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0029_range_forms.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0029_range_forms.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0030_string_suffixes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0030_string_suffixes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0030_traits.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0030_traits.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0030_traits.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0030_traits.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0031_extern.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0031_extern.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0031_extern.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0031_extern.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0032_where_for.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0032_where_for.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0032_where_for.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0032_where_for.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0033_label_break.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0033_label_break.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0033_label_break.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0033_label_break.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0034_crate_path_in_call.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0034_crate_path_in_call.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0035_weird_exprs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0036_fully_qualified.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0036_fully_qualified.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0037_mod.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0037_mod.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0037_mod.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0037_mod.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0038_where_pred_type.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0038_where_pred_type.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0039_raw_fn_item.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0040_raw_struct_item_field.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0041_raw_keywords.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0042_ufcs_call_list.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0042_ufcs_call_list.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0043_complex_assignment.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0043_complex_assignment.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0044_let_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0044_let_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0044_let_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0045_block_inner_attrs.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0045_block_inner_attrs.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0046_extern_inner_attributes.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0046_extern_inner_attributes.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0047_minus_in_inner_pattern.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0047_minus_in_inner_pattern.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0048_compound_assignment.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0048_compound_assignment.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0049_async_block.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0049_async_block.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0049_async_block.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0049_async_block.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rs (renamed from crates/ra_syntax/tests/data/parser/ok/0050_async_block_as_argument.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.txt (renamed from crates/ra_syntax/tests/data/parser/ok/0050_async_block_as_argument.txt) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0000.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0000.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0001.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0001.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0002.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0002.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0003.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs) | bin | 8 -> 8 bytes | |||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0004.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0004.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/reparse/fuzz-failures/0005.rs (renamed from crates/ra_syntax/tests/data/reparse/fuzz-failures/0005.rs) | 0 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/parser/inline/ok/0132_box_expr.rs | 3 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/parser/inline/ok/0132_box_expr.txt | 31 | ||||
-rw-r--r-- | crates/ra_tools/src/lib.rs | 27 | ||||
-rw-r--r-- | crates/ra_tools/src/main.rs | 141 | ||||
-rw-r--r-- | docs/dev/README.md | 10 | ||||
-rw-r--r-- | docs/user/README.md | 9 | ||||
-rw-r--r-- | editors/code/package-lock.json | 215 | ||||
-rw-r--r-- | editors/code/package.json | 30 | ||||
-rw-r--r-- | editors/code/src/commands/index.ts | 4 | ||||
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 109 | ||||
-rw-r--r-- | editors/code/src/config.ts | 5 | ||||
-rw-r--r-- | editors/code/src/extension.ts | 24 | ||||
-rw-r--r-- | editors/emacs/ra-emacs-lsp.el | 42 |
545 files changed, 1378 insertions, 1038 deletions
diff --git a/.cargo/config b/.cargo/config index 3ac2ce336..92a3acfd0 100644 --- a/.cargo/config +++ b/.cargo/config | |||
@@ -1,23 +1,23 @@ | |||
1 | [alias] | 1 | [alias] |
2 | # Automatically generates the ast and syntax kinds files | 2 | # Automatically generates the ast and syntax kinds files |
3 | gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax" | 3 | gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax" |
4 | |||
4 | # Extracts the tests from | 5 | # Extracts the tests from |
5 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" | 6 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" |
6 | # Installs ra_lsp_server | 7 | |
7 | install-lsp = "install --path crates/ra_lsp_server --force" | ||
8 | # Installs ra_lsp_server with the jemalloc feature | ||
9 | jinstall-lsp = "install --path crates/ra_lsp_server --force --features jemalloc" | ||
10 | # Installs the visual studio code extension | 8 | # Installs the visual studio code extension |
11 | install-code = "run --package ra_tools --bin ra_tools -- install-code" | 9 | install-ra = "run --package ra_tools --bin ra_tools -- install-ra" |
10 | install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias | ||
11 | |||
12 | # Formats the full repository or installs the git hook to do it automatically. | 12 | # Formats the full repository or installs the git hook to do it automatically. |
13 | format = "run --package ra_tools --bin ra_tools -- format" | 13 | format = "run --package ra_tools --bin ra_tools -- format" |
14 | format-hook = "run --package ra_tools --bin ra_tools -- format-hook" | 14 | format-hook = "run --package ra_tools --bin ra_tools -- format-hook" |
15 | |||
15 | # Run clippy | 16 | # Run clippy |
16 | lint = "run --package ra_tools --bin ra_tools -- lint" | 17 | lint = "run --package ra_tools --bin ra_tools -- lint" |
17 | 18 | ||
18 | # Runs the fuzzing test suite (currently only parser) | 19 | # Runs the fuzzing test suite (currently only parser) |
19 | fuzz-tests = "run --package ra_tools --bin ra_tools -- fuzz-tests" | 20 | fuzz-tests = "run --package ra_tools --bin ra_tools -- fuzz-tests" |
20 | 21 | ||
21 | render-test = "run --package ra_cli -- render-test" | ||
22 | # Parse a file. This should be piped the file contents | 22 | # Parse a file. This should be piped the file contents |
23 | parse = "run --package ra_cli -- parse" | 23 | parse = "run --package ra_cli -- parse" |
diff --git a/.travis.yml b/.travis.yml index e151cc8f0..87b546442 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -1,9 +1,7 @@ | |||
1 | cache: cargo | 1 | cache: cargo |
2 | before_cache: | 2 | before_cache: |
3 | # ask Cargo to clean up artifacts for workspace crates | 3 | - find ./target/debug -maxdepth 1 -type f -delete |
4 | - cargo clean $(printf -- '--package %s ' $(cd crates; ls)) | 4 | - rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} |
5 | # Cargo doesn't clean up depinfo itself, do it manually | ||
6 | - find ./target/debug -maxdepth 2 -iname '*.d' -delete | ||
7 | - rm -f ./target/.rustc_info.json | 5 | - rm -f ./target/.rustc_info.json |
8 | 6 | ||
9 | matrix: | 7 | matrix: |
@@ -43,10 +41,9 @@ matrix: | |||
43 | - xvfb | 41 | - xvfb |
44 | before_install: cd editors/code | 42 | before_install: cd editors/code |
45 | install: | 43 | install: |
46 | - npm install | 44 | - npm ci |
47 | - npm run vscode:prepublish | 45 | - npm run vscode:prepublish |
48 | script: | 46 | script: |
49 | - npm ci | ||
50 | - npm run travis | 47 | - npm run travis |
51 | env: | 48 | env: |
52 | - CXX="g++-4.9", CC="gcc-4.9" | 49 | - CXX="g++-4.9", CC="gcc-4.9" |
diff --git a/Cargo.lock b/Cargo.lock index 7c7836a13..fd4d876de 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -68,7 +68,7 @@ name = "backtrace-sys" | |||
68 | version = "0.1.31" | 68 | version = "0.1.31" |
69 | source = "registry+https://github.com/rust-lang/crates.io-index" | 69 | source = "registry+https://github.com/rust-lang/crates.io-index" |
70 | dependencies = [ | 70 | dependencies = [ |
71 | "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", | 71 | "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", |
72 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", | 72 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", |
73 | ] | 73 | ] |
74 | 74 | ||
@@ -150,7 +150,7 @@ dependencies = [ | |||
150 | 150 | ||
151 | [[package]] | 151 | [[package]] |
152 | name = "cc" | 152 | name = "cc" |
153 | version = "1.0.37" | 153 | version = "1.0.38" |
154 | source = "registry+https://github.com/rust-lang/crates.io-index" | 154 | source = "registry+https://github.com/rust-lang/crates.io-index" |
155 | 155 | ||
156 | [[package]] | 156 | [[package]] |
@@ -291,11 +291,10 @@ dependencies = [ | |||
291 | 291 | ||
292 | [[package]] | 292 | [[package]] |
293 | name = "crossbeam-channel" | 293 | name = "crossbeam-channel" |
294 | version = "0.3.8" | 294 | version = "0.3.9" |
295 | source = "registry+https://github.com/rust-lang/crates.io-index" | 295 | source = "registry+https://github.com/rust-lang/crates.io-index" |
296 | dependencies = [ | 296 | dependencies = [ |
297 | "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 297 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", |
298 | "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", | ||
299 | ] | 298 | ] |
300 | 299 | ||
301 | [[package]] | 300 | [[package]] |
@@ -303,21 +302,21 @@ name = "crossbeam-deque" | |||
303 | version = "0.6.3" | 302 | version = "0.6.3" |
304 | source = "registry+https://github.com/rust-lang/crates.io-index" | 303 | source = "registry+https://github.com/rust-lang/crates.io-index" |
305 | dependencies = [ | 304 | dependencies = [ |
306 | "crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", | 305 | "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", |
307 | "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 306 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", |
308 | ] | 307 | ] |
309 | 308 | ||
310 | [[package]] | 309 | [[package]] |
311 | name = "crossbeam-epoch" | 310 | name = "crossbeam-epoch" |
312 | version = "0.7.1" | 311 | version = "0.7.2" |
313 | source = "registry+https://github.com/rust-lang/crates.io-index" | 312 | source = "registry+https://github.com/rust-lang/crates.io-index" |
314 | dependencies = [ | 313 | dependencies = [ |
315 | "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", | 314 | "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", |
316 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | 315 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", |
317 | "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 316 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", |
318 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 317 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
319 | "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | 318 | "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", |
320 | "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | 319 | "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
321 | ] | 320 | ] |
322 | 321 | ||
323 | [[package]] | 322 | [[package]] |
@@ -325,12 +324,12 @@ name = "crossbeam-queue" | |||
325 | version = "0.1.2" | 324 | version = "0.1.2" |
326 | source = "registry+https://github.com/rust-lang/crates.io-index" | 325 | source = "registry+https://github.com/rust-lang/crates.io-index" |
327 | dependencies = [ | 326 | dependencies = [ |
328 | "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 327 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", |
329 | ] | 328 | ] |
330 | 329 | ||
331 | [[package]] | 330 | [[package]] |
332 | name = "crossbeam-utils" | 331 | name = "crossbeam-utils" |
333 | version = "0.6.5" | 332 | version = "0.6.6" |
334 | source = "registry+https://github.com/rust-lang/crates.io-index" | 333 | source = "registry+https://github.com/rust-lang/crates.io-index" |
335 | dependencies = [ | 334 | dependencies = [ |
336 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | 335 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -353,7 +352,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
353 | dependencies = [ | 352 | dependencies = [ |
354 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 353 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
355 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 354 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
356 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 355 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
357 | ] | 356 | ] |
358 | 357 | ||
359 | [[package]] | 358 | [[package]] |
@@ -443,7 +442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
443 | dependencies = [ | 442 | dependencies = [ |
444 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 443 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
445 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 444 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
446 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 445 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
447 | "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", | 446 | "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", |
448 | ] | 447 | ] |
449 | 448 | ||
@@ -537,7 +536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
537 | name = "gen_lsp_server" | 536 | name = "gen_lsp_server" |
538 | version = "0.2.0" | 537 | version = "0.2.0" |
539 | dependencies = [ | 538 | dependencies = [ |
540 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 539 | "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", |
541 | "flexi_logger 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", | 540 | "flexi_logger 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", |
542 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", | 541 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", |
543 | "lsp-types 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", | 542 | "lsp-types 0.59.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -687,7 +686,7 @@ name = "jemalloc-sys" | |||
687 | version = "0.3.2" | 686 | version = "0.3.2" |
688 | source = "registry+https://github.com/rust-lang/crates.io-index" | 687 | source = "registry+https://github.com/rust-lang/crates.io-index" |
689 | dependencies = [ | 688 | dependencies = [ |
690 | "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", | 689 | "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", |
691 | "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 690 | "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
692 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", | 691 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", |
693 | ] | 692 | ] |
@@ -804,8 +803,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
804 | 803 | ||
805 | [[package]] | 804 | [[package]] |
806 | name = "memoffset" | 805 | name = "memoffset" |
807 | version = "0.2.1" | 806 | version = "0.5.1" |
808 | source = "registry+https://github.com/rust-lang/crates.io-index" | 807 | source = "registry+https://github.com/rust-lang/crates.io-index" |
808 | dependencies = [ | ||
809 | "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
810 | ] | ||
809 | 811 | ||
810 | [[package]] | 812 | [[package]] |
811 | name = "mio" | 813 | name = "mio" |
@@ -886,7 +888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
886 | dependencies = [ | 888 | dependencies = [ |
887 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 889 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
888 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 890 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
889 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 891 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
890 | ] | 892 | ] |
891 | 893 | ||
892 | [[package]] | 894 | [[package]] |
@@ -1006,7 +1008,7 @@ dependencies = [ | |||
1006 | "proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1008 | "proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1007 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1009 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1008 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1010 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1009 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1011 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1010 | ] | 1012 | ] |
1011 | 1013 | ||
1012 | [[package]] | 1014 | [[package]] |
@@ -1040,7 +1042,7 @@ dependencies = [ | |||
1040 | "pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1042 | "pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1041 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1043 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1042 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1044 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1043 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1045 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1044 | ] | 1046 | ] |
1045 | 1047 | ||
1046 | [[package]] | 1048 | [[package]] |
@@ -1074,7 +1076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1074 | dependencies = [ | 1076 | dependencies = [ |
1075 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1077 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1076 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1078 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1077 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1079 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1078 | ] | 1080 | ] |
1079 | 1081 | ||
1080 | [[package]] | 1082 | [[package]] |
@@ -1239,7 +1241,7 @@ dependencies = [ | |||
1239 | name = "ra_lsp_server" | 1241 | name = "ra_lsp_server" |
1240 | version = "0.1.0" | 1242 | version = "0.1.0" |
1241 | dependencies = [ | 1243 | dependencies = [ |
1242 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1244 | "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", |
1243 | "flexi_logger 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1245 | "flexi_logger 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1244 | "gen_lsp_server 0.2.0", | 1246 | "gen_lsp_server 0.2.0", |
1245 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1247 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1310,7 +1312,7 @@ dependencies = [ | |||
1310 | 1312 | ||
1311 | [[package]] | 1313 | [[package]] |
1312 | name = "ra_rustc_lexer" | 1314 | name = "ra_rustc_lexer" |
1313 | version = "0.1.0-pre.1" | 1315 | version = "0.1.0-pre.2" |
1314 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1315 | dependencies = [ | 1317 | dependencies = [ |
1316 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1318 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1322,9 +1324,9 @@ version = "0.1.0" | |||
1322 | dependencies = [ | 1324 | dependencies = [ |
1323 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1325 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1324 | "ra_parser 0.1.0", | 1326 | "ra_parser 0.1.0", |
1325 | "ra_rustc_lexer 0.1.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1327 | "ra_rustc_lexer 0.1.0-pre.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1326 | "ra_text_edit 0.1.0", | 1328 | "ra_text_edit 0.1.0", |
1327 | "rowan 0.6.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1329 | "rowan 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1328 | "smol_str 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", | 1330 | "smol_str 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", |
1329 | "test_utils 0.1.0", | 1331 | "test_utils 0.1.0", |
1330 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1332 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1362,7 +1364,7 @@ name = "ra_vfs" | |||
1362 | version = "0.2.5" | 1364 | version = "0.2.5" |
1363 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1364 | dependencies = [ | 1366 | dependencies = [ |
1365 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1367 | "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", |
1366 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1368 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", |
1367 | "notify 4.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 1369 | "notify 4.0.12 (registry+https://github.com/rust-lang/crates.io-index)", |
1368 | "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1370 | "parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1396,7 +1398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1396 | dependencies = [ | 1398 | dependencies = [ |
1397 | "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | 1399 | "getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", |
1398 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", | 1400 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", |
1399 | "rand_chacha 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1401 | "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1400 | "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1402 | "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1401 | "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1403 | "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1402 | "rand_pcg 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1404 | "rand_pcg 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1413,10 +1415,9 @@ dependencies = [ | |||
1413 | 1415 | ||
1414 | [[package]] | 1416 | [[package]] |
1415 | name = "rand_chacha" | 1417 | name = "rand_chacha" |
1416 | version = "0.2.0" | 1418 | version = "0.2.1" |
1417 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1418 | dependencies = [ | 1420 | dependencies = [ |
1419 | "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1420 | "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1421 | "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1421 | "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1422 | "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1422 | ] | 1423 | ] |
@@ -1532,7 +1533,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1532 | dependencies = [ | 1533 | dependencies = [ |
1533 | "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | 1534 | "crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", |
1534 | "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1535 | "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1535 | "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", | 1536 | "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", |
1536 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1537 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1537 | "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1538 | "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1538 | ] | 1539 | ] |
@@ -1595,7 +1596,7 @@ dependencies = [ | |||
1595 | 1596 | ||
1596 | [[package]] | 1597 | [[package]] |
1597 | name = "rowan" | 1598 | name = "rowan" |
1598 | version = "0.6.0-pre.1" | 1599 | version = "0.6.0" |
1599 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1600 | dependencies = [ | 1601 | dependencies = [ |
1601 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1602 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1653,7 +1654,7 @@ dependencies = [ | |||
1653 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1654 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1654 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1655 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1655 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1656 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1656 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1657 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1657 | ] | 1658 | ] |
1658 | 1659 | ||
1659 | [[package]] | 1660 | [[package]] |
@@ -1666,11 +1667,6 @@ dependencies = [ | |||
1666 | 1667 | ||
1667 | [[package]] | 1668 | [[package]] |
1668 | name = "scopeguard" | 1669 | name = "scopeguard" |
1669 | version = "0.3.3" | ||
1670 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1671 | |||
1672 | [[package]] | ||
1673 | name = "scopeguard" | ||
1674 | version = "1.0.0" | 1670 | version = "1.0.0" |
1675 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1676 | 1672 | ||
@@ -1703,7 +1699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1703 | dependencies = [ | 1699 | dependencies = [ |
1704 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1700 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1705 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1701 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1706 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1702 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1707 | ] | 1703 | ] |
1708 | 1704 | ||
1709 | [[package]] | 1705 | [[package]] |
@@ -1774,7 +1770,7 @@ name = "stacker" | |||
1774 | version = "0.1.5" | 1770 | version = "0.1.5" |
1775 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1771 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1776 | dependencies = [ | 1772 | dependencies = [ |
1777 | "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", | 1773 | "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", |
1778 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | 1774 | "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", |
1779 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", | 1775 | "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", |
1780 | "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1776 | "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1792,7 +1788,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1792 | 1788 | ||
1793 | [[package]] | 1789 | [[package]] |
1794 | name = "syn" | 1790 | name = "syn" |
1795 | version = "0.15.40" | 1791 | version = "0.15.42" |
1796 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1797 | dependencies = [ | 1793 | dependencies = [ |
1798 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1794 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1807,7 +1803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1807 | dependencies = [ | 1803 | dependencies = [ |
1808 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | 1804 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", |
1809 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | 1805 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1810 | "syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)", | 1806 | "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", |
1811 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1807 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1812 | ] | 1808 | ] |
1813 | 1809 | ||
@@ -1896,7 +1892,7 @@ dependencies = [ | |||
1896 | name = "thread_worker" | 1892 | name = "thread_worker" |
1897 | version = "0.1.0" | 1893 | version = "0.1.0" |
1898 | dependencies = [ | 1894 | dependencies = [ |
1899 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1895 | "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", |
1900 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1896 | "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", |
1901 | ] | 1897 | ] |
1902 | 1898 | ||
@@ -2147,7 +2143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2147 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" | 2143 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" |
2148 | "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" | 2144 | "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" |
2149 | "checksum cargo_metadata 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e904f164f39cae0c3a4f2713eb97a47ba64676a071e99a69ddfef4994694d2c" | 2145 | "checksum cargo_metadata 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5e904f164f39cae0c3a4f2713eb97a47ba64676a071e99a69ddfef4994694d2c" |
2150 | "checksum cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" | 2146 | "checksum cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "ce400c638d48ee0e9ab75aef7997609ec57367ccfe1463f21bf53c3eca67bf46" |
2151 | "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" | 2147 | "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" |
2152 | "checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2148 | "checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" |
2153 | "checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2149 | "checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" |
@@ -2161,11 +2157,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2161 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" | 2157 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" |
2162 | "checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" | 2158 | "checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" |
2163 | "checksum cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "33f07976bb6821459632d7a18d97ccca005cb5c552f251f822c7c1781c1d7035" | 2159 | "checksum cpuprofiler 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "33f07976bb6821459632d7a18d97ccca005cb5c552f251f822c7c1781c1d7035" |
2164 | "checksum crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b" | 2160 | "checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" |
2165 | "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" | 2161 | "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" |
2166 | "checksum crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04c9e3102cc2d69cd681412141b390abd55a362afc1540965dad0ad4d34280b4" | 2162 | "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" |
2167 | "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" | 2163 | "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" |
2168 | "checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" | 2164 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" |
2169 | "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | 2165 | "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" |
2170 | "checksum derive-new 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c3fd04571b29c91cfbe1e7c9a228e069ac8635f180ffb4ccd6a6907617ee8bb0" | 2166 | "checksum derive-new 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c3fd04571b29c91cfbe1e7c9a228e069ac8635f180ffb4ccd6a6907617ee8bb0" |
2171 | "checksum deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" | 2167 | "checksum deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" |
@@ -2226,7 +2222,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2226 | "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" | 2222 | "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" |
2227 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 2223 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
2228 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" | 2224 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" |
2229 | "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" | 2225 | "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" |
2230 | "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" | 2226 | "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" |
2231 | "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" | 2227 | "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" |
2232 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" | 2228 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" |
@@ -2259,12 +2255,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2259 | "checksum proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cf147e022eacf0c8a054ab864914a7602618adba841d800a9a9868a5237a529f" | 2255 | "checksum proptest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cf147e022eacf0c8a054ab864914a7602618adba841d800a9a9868a5237a529f" |
2260 | "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" | 2256 | "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" |
2261 | "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" | 2257 | "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" |
2262 | "checksum ra_rustc_lexer 0.1.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e8d92772f822978a6c9c4657aa61af439e4e635180628b3354049b283b749f1e" | 2258 | "checksum ra_rustc_lexer 0.1.0-pre.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6baccda91574dfadd7f8a0bc8f9f110f874b6b484289b2536d3dbf4f0d5d97bb" |
2263 | "checksum ra_vfs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb7cd4e302032c5ab514f1c01c89727cd96fd950dd36f9ebee9252df45d9fb1a" | 2259 | "checksum ra_vfs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb7cd4e302032c5ab514f1c01c89727cd96fd950dd36f9ebee9252df45d9fb1a" |
2264 | "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" | 2260 | "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" |
2265 | "checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" | 2261 | "checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" |
2266 | "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" | 2262 | "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" |
2267 | "checksum rand_chacha 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e193067942ef6f485a349a113329140d0ab9e2168ce92274499bb0e9a4190d9d" | 2263 | "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" |
2268 | "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" | 2264 | "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" |
2269 | "checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" | 2265 | "checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" |
2270 | "checksum rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca" | 2266 | "checksum rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca" |
@@ -2285,7 +2281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2285 | "checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" | 2281 | "checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" |
2286 | "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" | 2282 | "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" |
2287 | "checksum ron 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "17f52a24414403f81528b67488cf8edc4eda977d3af1646bb6b106a600ead78f" | 2283 | "checksum ron 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "17f52a24414403f81528b67488cf8edc4eda977d3af1646bb6b106a600ead78f" |
2288 | "checksum rowan 0.6.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0eeee40f1a2724b7d0d9fa5f73a7804cd2f4c91b37ba9f785d429f31819d60df" | 2284 | "checksum rowan 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a796c0517d6969224c42e9ef01356363b0a7c57d10ec986c9a600d075666a5ff" |
2289 | "checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" | 2285 | "checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" |
2290 | "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" | 2286 | "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" |
2291 | "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" | 2287 | "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" |
@@ -2293,7 +2289,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2293 | "checksum salsa 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2891cd628406e8a0ca714b827511de1bff76f796e3382cc72a3de732ccad5aea" | 2289 | "checksum salsa 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2891cd628406e8a0ca714b827511de1bff76f796e3382cc72a3de732ccad5aea" |
2294 | "checksum salsa-macros 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7f1e25ca2b995bdf032946174929d62156ffd57abd7ff88dc6f9bdeb5ac0c59" | 2290 | "checksum salsa-macros 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7f1e25ca2b995bdf032946174929d62156ffd57abd7ff88dc6f9bdeb5ac0c59" |
2295 | "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" | 2291 | "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" |
2296 | "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" | ||
2297 | "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" | 2292 | "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" |
2298 | "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" | 2293 | "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" |
2299 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" | 2294 | "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" |
@@ -2310,7 +2305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2310 | "checksum stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb79482f57cf598af52094ec4cc3b3c42499d3ce5bd426f2ac41515b7e57404b" | 2305 | "checksum stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb79482f57cf598af52094ec4cc3b3c42499d3ce5bd426f2ac41515b7e57404b" |
2311 | "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" | 2306 | "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" |
2312 | "checksum superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" | 2307 | "checksum superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" |
2313 | "checksum syn 0.15.40 (registry+https://github.com/rust-lang/crates.io-index)" = "bc945221ccf4a7e8c31222b9d1fc77aefdd6638eb901a6ce457a3dc29d4c31e8" | 2308 | "checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e" |
2314 | "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" | 2309 | "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" |
2315 | "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" | 2310 | "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" |
2316 | "checksum tera 0.11.20 (registry+https://github.com/rust-lang/crates.io-index)" = "4b505279e19d8f7d24b1a9dc58327c9c36174b1a2c7ebdeac70792d017cb64f3" | 2311 | "checksum tera 0.11.20 (registry+https://github.com/rust-lang/crates.io-index)" = "4b505279e19d8f7d24b1a9dc58327c9c36174b1a2c7ebdeac70792d017cb64f3" |
@@ -32,10 +32,10 @@ For setup for other editors, see [./docs/user](./docs/user). | |||
32 | $ git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer | 32 | $ git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer |
33 | 33 | ||
34 | # install both the language server and VS Code extension | 34 | # install both the language server and VS Code extension |
35 | $ cargo install-code | 35 | $ cargo install-ra |
36 | 36 | ||
37 | # alternatively, install only the server. Binary name is `ra_lsp_server`. | 37 | # alternatively, install only the server. Binary name is `ra_lsp_server`. |
38 | $ cargo install-lsp | 38 | $ cargo install-ra --server |
39 | ``` | 39 | ``` |
40 | ## Documentation | 40 | ## Documentation |
41 | 41 | ||
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index a12c3ed54..c45262efa 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -129,10 +129,13 @@ pub(crate) struct AssistBuilder { | |||
129 | } | 129 | } |
130 | 130 | ||
131 | impl AssistBuilder { | 131 | impl AssistBuilder { |
132 | /// Replaces specified `range` of text with a given string. | ||
132 | pub(crate) fn replace(&mut self, range: TextRange, replace_with: impl Into<String>) { | 133 | pub(crate) fn replace(&mut self, range: TextRange, replace_with: impl Into<String>) { |
133 | self.edit.replace(range, replace_with.into()) | 134 | self.edit.replace(range, replace_with.into()) |
134 | } | 135 | } |
135 | 136 | ||
137 | /// Replaces specified `node` of text with a given string, reindenting the | ||
138 | /// string to maintain `node`'s existing indent. | ||
136 | pub(crate) fn replace_node_and_indent( | 139 | pub(crate) fn replace_node_and_indent( |
137 | &mut self, | 140 | &mut self, |
138 | node: &SyntaxNode, | 141 | node: &SyntaxNode, |
@@ -145,27 +148,31 @@ impl AssistBuilder { | |||
145 | self.replace(node.text_range(), replace_with) | 148 | self.replace(node.text_range(), replace_with) |
146 | } | 149 | } |
147 | 150 | ||
148 | pub(crate) fn set_edit_builder(&mut self, edit: TextEditBuilder) { | 151 | /// Remove specified `range` of text. |
149 | self.edit = edit; | ||
150 | } | ||
151 | |||
152 | #[allow(unused)] | 152 | #[allow(unused)] |
153 | pub(crate) fn delete(&mut self, range: TextRange) { | 153 | pub(crate) fn delete(&mut self, range: TextRange) { |
154 | self.edit.delete(range) | 154 | self.edit.delete(range) |
155 | } | 155 | } |
156 | 156 | ||
157 | /// Append specified `text` at the given `offset` | ||
157 | pub(crate) fn insert(&mut self, offset: TextUnit, text: impl Into<String>) { | 158 | pub(crate) fn insert(&mut self, offset: TextUnit, text: impl Into<String>) { |
158 | self.edit.insert(offset, text.into()) | 159 | self.edit.insert(offset, text.into()) |
159 | } | 160 | } |
160 | 161 | ||
162 | /// Specify desired position of the cursor after the assist is applied. | ||
161 | pub(crate) fn set_cursor(&mut self, offset: TextUnit) { | 163 | pub(crate) fn set_cursor(&mut self, offset: TextUnit) { |
162 | self.cursor_position = Some(offset) | 164 | self.cursor_position = Some(offset) |
163 | } | 165 | } |
164 | 166 | ||
167 | /// Specify that the assist should be active withing the `target` range. | ||
168 | /// | ||
169 | /// Target ranges are used to sort assists: the smaller the target range, | ||
170 | /// the more specific assist is, and so it should be sorted first. | ||
165 | pub(crate) fn target(&mut self, target: TextRange) { | 171 | pub(crate) fn target(&mut self, target: TextRange) { |
166 | self.target = Some(target) | 172 | self.target = Some(target) |
167 | } | 173 | } |
168 | 174 | ||
175 | /// Get access to the raw `TextEditBuilder`. | ||
169 | pub(crate) fn text_edit_builder(&mut self) -> &mut TextEditBuilder { | 176 | pub(crate) fn text_edit_builder(&mut self) -> &mut TextEditBuilder { |
170 | &mut self.edit | 177 | &mut self.edit |
171 | } | 178 | } |
diff --git a/crates/ra_assists/src/auto_import.rs b/crates/ra_assists/src/auto_import.rs index 43e75eee1..a32e2f9b6 100644 --- a/crates/ra_assists/src/auto_import.rs +++ b/crates/ra_assists/src/auto_import.rs | |||
@@ -562,9 +562,12 @@ pub(crate) fn auto_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist | |||
562 | AssistId("auto_import"), | 562 | AssistId("auto_import"), |
563 | format!("import {} in mod {}", fmt_segments(&segments), name.text()), | 563 | format!("import {} in mod {}", fmt_segments(&segments), name.text()), |
564 | |edit| { | 564 | |edit| { |
565 | let mut text_edit = TextEditBuilder::default(); | 565 | apply_auto_import( |
566 | apply_auto_import(item_list.syntax(), &path, &segments, &mut text_edit); | 566 | item_list.syntax(), |
567 | edit.set_edit_builder(text_edit); | 567 | &path, |
568 | &segments, | ||
569 | edit.text_edit_builder(), | ||
570 | ); | ||
568 | }, | 571 | }, |
569 | ); | 572 | ); |
570 | } | 573 | } |
@@ -574,9 +577,12 @@ pub(crate) fn auto_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist | |||
574 | AssistId("auto_import"), | 577 | AssistId("auto_import"), |
575 | format!("import {} in the current file", fmt_segments(&segments)), | 578 | format!("import {} in the current file", fmt_segments(&segments)), |
576 | |edit| { | 579 | |edit| { |
577 | let mut text_edit = TextEditBuilder::default(); | 580 | apply_auto_import( |
578 | apply_auto_import(current_file.syntax(), &path, &segments, &mut text_edit); | 581 | current_file.syntax(), |
579 | edit.set_edit_builder(text_edit); | 582 | &path, |
583 | &segments, | ||
584 | edit.text_edit_builder(), | ||
585 | ); | ||
580 | }, | 586 | }, |
581 | ); | 587 | ); |
582 | } | 588 | } |
diff --git a/crates/ra_cli/src/analysis_bench.rs b/crates/ra_cli/src/analysis_bench.rs index 639ac763e..5e9d0c16d 100644 --- a/crates/ra_cli/src/analysis_bench.rs +++ b/crates/ra_cli/src/analysis_bench.rs | |||
@@ -55,7 +55,7 @@ pub(crate) fn run(verbose: bool, path: &Path, op: Op) -> Result<()> { | |||
55 | Op::Complete { line, column, .. } => { | 55 | Op::Complete { line, column, .. } => { |
56 | let offset = host | 56 | let offset = host |
57 | .analysis() | 57 | .analysis() |
58 | .file_line_index(file_id) | 58 | .file_line_index(file_id)? |
59 | .offset(LineCol { line, col_utf16: column }); | 59 | .offset(LineCol { line, col_utf16: column }); |
60 | let file_postion = FilePosition { file_id, offset }; | 60 | let file_postion = FilePosition { file_id, offset }; |
61 | 61 | ||
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 7f765caf3..06b732215 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::borrow::Cow; | 1 | use std::borrow::Cow; |
2 | use std::sync::Arc; | ||
2 | 3 | ||
3 | use arrayvec::ArrayVec; | 4 | use ra_db::{FileId, SourceRoot}; |
4 | use ra_db::FileId; | ||
5 | use ra_syntax::{ast, SmolStr}; | 5 | use ra_syntax::{ast, SmolStr}; |
6 | use relative_path::RelativePathBuf; | 6 | use relative_path::RelativePathBuf; |
7 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
@@ -105,6 +105,7 @@ where | |||
105 | module_id, | 105 | module_id, |
106 | file_id: file_id.into(), | 106 | file_id: file_id.into(), |
107 | raw_items: &raw_items, | 107 | raw_items: &raw_items, |
108 | parent_module: None, | ||
108 | } | 109 | } |
109 | .collect(raw_items.items()); | 110 | .collect(raw_items.items()); |
110 | 111 | ||
@@ -455,8 +456,14 @@ where | |||
455 | if !self.macro_stack_monitor.is_poison(macro_def_id) { | 456 | if !self.macro_stack_monitor.is_poison(macro_def_id) { |
456 | let file_id: HirFileId = macro_call_id.as_file(MacroFileKind::Items); | 457 | let file_id: HirFileId = macro_call_id.as_file(MacroFileKind::Items); |
457 | let raw_items = self.db.raw_items(file_id); | 458 | let raw_items = self.db.raw_items(file_id); |
458 | ModCollector { def_collector: &mut *self, file_id, module_id, raw_items: &raw_items } | 459 | ModCollector { |
459 | .collect(raw_items.items()); | 460 | def_collector: &mut *self, |
461 | file_id, | ||
462 | module_id, | ||
463 | raw_items: &raw_items, | ||
464 | parent_module: None, | ||
465 | } | ||
466 | .collect(raw_items.items()); | ||
460 | } else { | 467 | } else { |
461 | log::error!("Too deep macro expansion: {:?}", macro_call_id); | 468 | log::error!("Too deep macro expansion: {:?}", macro_call_id); |
462 | self.def_map.poison_macros.insert(macro_def_id); | 469 | self.def_map.poison_macros.insert(macro_def_id); |
@@ -476,6 +483,7 @@ struct ModCollector<'a, D> { | |||
476 | module_id: CrateModuleId, | 483 | module_id: CrateModuleId, |
477 | file_id: HirFileId, | 484 | file_id: HirFileId, |
478 | raw_items: &'a raw::RawItems, | 485 | raw_items: &'a raw::RawItems, |
486 | parent_module: Option<&'a Name>, | ||
479 | } | 487 | } |
480 | 488 | ||
481 | impl<DB> ModCollector<'_, &'_ mut DefCollector<&'_ DB>> | 489 | impl<DB> ModCollector<'_, &'_ mut DefCollector<&'_ DB>> |
@@ -508,6 +516,7 @@ where | |||
508 | module_id, | 516 | module_id, |
509 | file_id: self.file_id, | 517 | file_id: self.file_id, |
510 | raw_items: self.raw_items, | 518 | raw_items: self.raw_items, |
519 | parent_module: Some(name), | ||
511 | } | 520 | } |
512 | .collect(&*items); | 521 | .collect(&*items); |
513 | } | 522 | } |
@@ -521,6 +530,7 @@ where | |||
521 | name, | 530 | name, |
522 | is_root, | 531 | is_root, |
523 | attr_path.as_ref(), | 532 | attr_path.as_ref(), |
533 | self.parent_module, | ||
524 | ) { | 534 | ) { |
525 | Ok(file_id) => { | 535 | Ok(file_id) => { |
526 | let module_id = self.push_child_module(name.clone(), ast_id, Some(file_id)); | 536 | let module_id = self.push_child_module(name.clone(), ast_id, Some(file_id)); |
@@ -530,6 +540,7 @@ where | |||
530 | module_id, | 540 | module_id, |
531 | file_id: file_id.into(), | 541 | file_id: file_id.into(), |
532 | raw_items: &raw_items, | 542 | raw_items: &raw_items, |
543 | parent_module: None, | ||
533 | } | 544 | } |
534 | .collect(raw_items.items()) | 545 | .collect(raw_items.items()) |
535 | } | 546 | } |
@@ -636,46 +647,47 @@ fn resolve_submodule( | |||
636 | name: &Name, | 647 | name: &Name, |
637 | is_root: bool, | 648 | is_root: bool, |
638 | attr_path: Option<&SmolStr>, | 649 | attr_path: Option<&SmolStr>, |
650 | parent_module: Option<&Name>, | ||
639 | ) -> Result<FileId, RelativePathBuf> { | 651 | ) -> Result<FileId, RelativePathBuf> { |
640 | // FIXME: handle submodules of inline modules properly | ||
641 | let file_id = file_id.original_file(db); | 652 | let file_id = file_id.original_file(db); |
642 | let source_root_id = db.file_source_root(file_id); | 653 | let source_root_id = db.file_source_root(file_id); |
643 | let path = db.file_relative_path(file_id); | 654 | let path = db.file_relative_path(file_id); |
644 | let root = RelativePathBuf::default(); | 655 | let root = RelativePathBuf::default(); |
645 | let dir_path = path.parent().unwrap_or(&root); | 656 | let dir_path = path.parent().unwrap_or(&root); |
646 | let mod_name = path.file_stem().unwrap_or("unknown"); | 657 | let mod_name = path.file_stem().unwrap_or("unknown"); |
647 | let is_dir_owner = is_root || mod_name == "mod"; | 658 | |
648 | 659 | let resolve_mode = match (attr_path.filter(|p| !p.is_empty()), parent_module) { | |
649 | let file_mod = dir_path.join(format!("{}.rs", name)); | 660 | (Some(file_path), Some(parent_name)) => { |
650 | let dir_mod = dir_path.join(format!("{}/mod.rs", name)); | 661 | let file_path = normalize_attribute_path(file_path); |
651 | let file_dir_mod = dir_path.join(format!("{}/{}.rs", mod_name, name)); | 662 | let path = dir_path.join(format!("{}/{}", parent_name, file_path)).normalize(); |
652 | let mut candidates = ArrayVec::<[_; 3]>::new(); | 663 | ResolutionMode::InsideInlineModule(InsideInlineModuleMode::WithAttributePath(path)) |
653 | let file_attr_mod = attr_path.map(|file_path| { | 664 | } |
654 | let file_path = normalize_attribute_path(file_path); | 665 | (Some(file_path), None) => { |
655 | let file_attr_mod = dir_path.join(file_path.as_ref()).normalize(); | 666 | let file_path = normalize_attribute_path(file_path); |
656 | candidates.push(file_attr_mod.clone()); | 667 | let path = dir_path.join(file_path.as_ref()).normalize(); |
657 | 668 | ResolutionMode::OutOfLine(OutOfLineMode::WithAttributePath(path)) | |
658 | file_attr_mod | 669 | } |
659 | }); | 670 | (None, Some(parent_name)) => { |
660 | if is_dir_owner { | 671 | let path = dir_path.join(format!("{}/{}.rs", parent_name, name)); |
661 | candidates.push(file_mod.clone()); | 672 | ResolutionMode::InsideInlineModule(InsideInlineModuleMode::File(path)) |
662 | candidates.push(dir_mod); | 673 | } |
663 | } else { | 674 | _ => { |
664 | candidates.push(file_dir_mod.clone()); | 675 | let is_dir_owner = is_root || mod_name == "mod"; |
665 | }; | 676 | if is_dir_owner { |
666 | let sr = db.source_root(source_root_id); | 677 | let file_mod = dir_path.join(format!("{}.rs", name)); |
667 | let mut points_to = candidates.into_iter().filter_map(|path| sr.files.get(&path)).copied(); | 678 | let dir_mod = dir_path.join(format!("{}/mod.rs", name)); |
668 | // FIXME: handle ambiguity | 679 | ResolutionMode::OutOfLine(OutOfLineMode::RootOrModRs { |
669 | match points_to.next() { | 680 | file: file_mod, |
670 | Some(file_id) => Ok(file_id), | 681 | directory: dir_mod, |
671 | None => { | 682 | }) |
672 | if let Some(file_attr_mod) = file_attr_mod { | ||
673 | Err(file_attr_mod) | ||
674 | } else { | 683 | } else { |
675 | Err(if is_dir_owner { file_mod } else { file_dir_mod }) | 684 | let path = dir_path.join(format!("{}/{}.rs", mod_name, name)); |
685 | ResolutionMode::OutOfLine(OutOfLineMode::FileInDirectory(path)) | ||
676 | } | 686 | } |
677 | } | 687 | } |
678 | } | 688 | }; |
689 | |||
690 | resolve_mode.resolve(db.source_root(source_root_id)) | ||
679 | } | 691 | } |
680 | 692 | ||
681 | fn normalize_attribute_path(file_path: &SmolStr) -> Cow<str> { | 693 | fn normalize_attribute_path(file_path: &SmolStr) -> Cow<str> { |
@@ -693,6 +705,74 @@ fn normalize_attribute_path(file_path: &SmolStr) -> Cow<str> { | |||
693 | } | 705 | } |
694 | } | 706 | } |
695 | 707 | ||
708 | enum OutOfLineMode { | ||
709 | RootOrModRs { file: RelativePathBuf, directory: RelativePathBuf }, | ||
710 | FileInDirectory(RelativePathBuf), | ||
711 | WithAttributePath(RelativePathBuf), | ||
712 | } | ||
713 | |||
714 | impl OutOfLineMode { | ||
715 | pub fn resolve(&self, source_root: Arc<SourceRoot>) -> Result<FileId, RelativePathBuf> { | ||
716 | match self { | ||
717 | OutOfLineMode::RootOrModRs { file, directory } => match source_root.files.get(file) { | ||
718 | None => resolve_simple_path(source_root, directory).map_err(|_| file.clone()), | ||
719 | file_id => resolve_find_result(file_id, file), | ||
720 | }, | ||
721 | OutOfLineMode::FileInDirectory(path) => resolve_simple_path(source_root, path), | ||
722 | OutOfLineMode::WithAttributePath(path) => resolve_simple_path(source_root, path), | ||
723 | } | ||
724 | } | ||
725 | } | ||
726 | |||
727 | enum InsideInlineModuleMode { | ||
728 | File(RelativePathBuf), | ||
729 | WithAttributePath(RelativePathBuf), | ||
730 | } | ||
731 | |||
732 | impl InsideInlineModuleMode { | ||
733 | pub fn resolve(&self, source_root: Arc<SourceRoot>) -> Result<FileId, RelativePathBuf> { | ||
734 | match self { | ||
735 | InsideInlineModuleMode::File(path) => resolve_simple_path(source_root, path), | ||
736 | InsideInlineModuleMode::WithAttributePath(path) => { | ||
737 | resolve_simple_path(source_root, path) | ||
738 | } | ||
739 | } | ||
740 | } | ||
741 | } | ||
742 | |||
743 | enum ResolutionMode { | ||
744 | OutOfLine(OutOfLineMode), | ||
745 | InsideInlineModule(InsideInlineModuleMode), | ||
746 | } | ||
747 | |||
748 | impl ResolutionMode { | ||
749 | pub fn resolve(&self, source_root: Arc<SourceRoot>) -> Result<FileId, RelativePathBuf> { | ||
750 | use self::ResolutionMode::*; | ||
751 | |||
752 | match self { | ||
753 | OutOfLine(mode) => mode.resolve(source_root), | ||
754 | InsideInlineModule(mode) => mode.resolve(source_root), | ||
755 | } | ||
756 | } | ||
757 | } | ||
758 | |||
759 | fn resolve_simple_path( | ||
760 | source_root: Arc<SourceRoot>, | ||
761 | path: &RelativePathBuf, | ||
762 | ) -> Result<FileId, RelativePathBuf> { | ||
763 | resolve_find_result(source_root.files.get(path), path) | ||
764 | } | ||
765 | |||
766 | fn resolve_find_result( | ||
767 | file_id: Option<&FileId>, | ||
768 | path: &RelativePathBuf, | ||
769 | ) -> Result<FileId, RelativePathBuf> { | ||
770 | match file_id { | ||
771 | Some(file_id) => Ok(file_id.clone()), | ||
772 | None => Err(path.clone()), | ||
773 | } | ||
774 | } | ||
775 | |||
696 | #[cfg(test)] | 776 | #[cfg(test)] |
697 | mod tests { | 777 | mod tests { |
698 | use ra_db::SourceDatabase; | 778 | use ra_db::SourceDatabase; |
diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs index d714a3276..382728149 100644 --- a/crates/ra_hir/src/nameres/tests/mods.rs +++ b/crates/ra_hir/src/nameres/tests/mods.rs | |||
@@ -336,10 +336,10 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() { | |||
336 | "###); | 336 | "###); |
337 | } | 337 | } |
338 | 338 | ||
339 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 339 | // FIXME: issue #1529. not support out-of-line modules inside inline. |
340 | #[test] | 340 | #[test] |
341 | #[ignore] | 341 | #[ignore] |
342 | fn module_resolution_decl_inside_inline_module() { | 342 | fn module_resolution_decl_inside_inline_module_with_path_attribute() { |
343 | let map = def_map_with_crate_graph( | 343 | let map = def_map_with_crate_graph( |
344 | r###" | 344 | r###" |
345 | //- /main.rs | 345 | //- /main.rs |
@@ -368,10 +368,39 @@ fn module_resolution_decl_inside_inline_module() { | |||
368 | "###); | 368 | "###); |
369 | } | 369 | } |
370 | 370 | ||
371 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 371 | #[test] |
372 | fn module_resolution_decl_inside_inline_module() { | ||
373 | let map = def_map_with_crate_graph( | ||
374 | r###" | ||
375 | //- /main.rs | ||
376 | mod foo { | ||
377 | mod bar; | ||
378 | } | ||
379 | |||
380 | //- /foo/bar.rs | ||
381 | pub struct Baz; | ||
382 | "###, | ||
383 | crate_graph! { | ||
384 | "main": ("/main.rs", []), | ||
385 | }, | ||
386 | ); | ||
387 | |||
388 | assert_snapshot_matches!(map, @r###" | ||
389 | ⋮crate | ||
390 | ⋮foo: t | ||
391 | ⋮ | ||
392 | ⋮crate::foo | ||
393 | ⋮bar: t | ||
394 | ⋮ | ||
395 | ⋮crate::foo::bar | ||
396 | ⋮Baz: t v | ||
397 | "###); | ||
398 | } | ||
399 | |||
400 | // FIXME: issue #1529. not support out-of-line modules inside inline. | ||
372 | #[test] | 401 | #[test] |
373 | #[ignore] | 402 | #[ignore] |
374 | fn module_resolution_decl_inside_inline_module_2() { | 403 | fn module_resolution_decl_inside_inline_module_2_with_path_attribute() { |
375 | let map = def_map_with_crate_graph( | 404 | let map = def_map_with_crate_graph( |
376 | r###" | 405 | r###" |
377 | //- /main.rs | 406 | //- /main.rs |
@@ -400,7 +429,7 @@ fn module_resolution_decl_inside_inline_module_2() { | |||
400 | "###); | 429 | "###); |
401 | } | 430 | } |
402 | 431 | ||
403 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 432 | // FIXME: issue #1529. not support out-of-line modules inside inline. |
404 | #[test] | 433 | #[test] |
405 | #[ignore] | 434 | #[ignore] |
406 | fn module_resolution_decl_inside_inline_module_3() { | 435 | fn module_resolution_decl_inside_inline_module_3() { |
@@ -433,7 +462,7 @@ fn module_resolution_decl_inside_inline_module_3() { | |||
433 | "###); | 462 | "###); |
434 | } | 463 | } |
435 | 464 | ||
436 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 465 | // FIXME: issue #1529. not support out-of-line modules inside inline. |
437 | #[test] | 466 | #[test] |
438 | #[ignore] | 467 | #[ignore] |
439 | fn module_resolution_decl_inside_inline_module_empty_path() { | 468 | fn module_resolution_decl_inside_inline_module_empty_path() { |
@@ -491,7 +520,7 @@ fn module_resolution_decl_empty_path() { | |||
491 | "###); | 520 | "###); |
492 | } | 521 | } |
493 | 522 | ||
494 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 523 | // FIXME: issue #1529. not support out-of-line modules inside inline. |
495 | #[test] | 524 | #[test] |
496 | #[ignore] | 525 | #[ignore] |
497 | fn module_resolution_decl_inside_inline_module_relative_path() { | 526 | fn module_resolution_decl_inside_inline_module_relative_path() { |
@@ -523,9 +552,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() { | |||
523 | "###); | 552 | "###); |
524 | } | 553 | } |
525 | 554 | ||
526 | // FIXME: issue #1510. not support out-of-line modules inside inline. | ||
527 | #[test] | 555 | #[test] |
528 | #[ignore] | ||
529 | fn module_resolution_decl_inside_inline_module_in_crate_root() { | 556 | fn module_resolution_decl_inside_inline_module_in_crate_root() { |
530 | let map = def_map_with_crate_graph( | 557 | let map = def_map_with_crate_graph( |
531 | r###" | 558 | r###" |
@@ -557,9 +584,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() { | |||
557 | "###); | 584 | "###); |
558 | } | 585 | } |
559 | 586 | ||
560 | // FIXME: issue #1510. not support out-of-line modules inside inline. | ||
561 | #[test] | 587 | #[test] |
562 | #[ignore] | ||
563 | fn module_resolution_decl_inside_inline_module_in_mod_rs() { | 588 | fn module_resolution_decl_inside_inline_module_in_mod_rs() { |
564 | let map = def_map_with_crate_graph( | 589 | let map = def_map_with_crate_graph( |
565 | r###" | 590 | r###" |
@@ -597,9 +622,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() { | |||
597 | "###); | 622 | "###); |
598 | } | 623 | } |
599 | 624 | ||
600 | // FIXME: issue #1510. not support out-of-line modules inside inline. | ||
601 | #[test] | 625 | #[test] |
602 | #[ignore] | ||
603 | fn module_resolution_decl_inside_inline_module_in_non_crate_root() { | 626 | fn module_resolution_decl_inside_inline_module_in_non_crate_root() { |
604 | let map = def_map_with_crate_graph( | 627 | let map = def_map_with_crate_graph( |
605 | r###" | 628 | r###" |
@@ -613,7 +636,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() { | |||
613 | } | 636 | } |
614 | use self::bar::baz::Baz; | 637 | use self::bar::baz::Baz; |
615 | 638 | ||
616 | //- /foo/bar/qwe.rs | 639 | //- /bar/qwe.rs |
617 | pub struct Baz; | 640 | pub struct Baz; |
618 | "###, | 641 | "###, |
619 | crate_graph! { | 642 | crate_graph! { |
@@ -637,7 +660,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() { | |||
637 | "###); | 660 | "###); |
638 | } | 661 | } |
639 | 662 | ||
640 | // FIXME: issue #1510. not support out-of-line modules inside inline. | 663 | // FIXME: issue #1529. not support out-of-line modules inside inline. |
641 | #[test] | 664 | #[test] |
642 | #[ignore] | 665 | #[ignore] |
643 | fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() { | 666 | fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() { |
diff --git a/crates/ra_ide_api/src/inlay_hints.rs b/crates/ra_ide_api/src/inlay_hints.rs index 174662beb..a524e014f 100644 --- a/crates/ra_ide_api/src/inlay_hints.rs +++ b/crates/ra_ide_api/src/inlay_hints.rs | |||
@@ -1,16 +1,22 @@ | |||
1 | use crate::{db::RootDatabase, FileId}; | 1 | use crate::{db::RootDatabase, FileId}; |
2 | use hir::{HirDisplay, Ty}; | 2 | use hir::{HirDisplay, SourceAnalyzer, Ty}; |
3 | use ra_syntax::ast::Pat; | ||
4 | use ra_syntax::{ | 3 | use ra_syntax::{ |
5 | algo::visit::{visitor, Visitor}, | 4 | algo::visit::{visitor, Visitor}, |
6 | ast::{self, PatKind, TypeAscriptionOwner}, | 5 | ast::{ |
7 | AstNode, SmolStr, SourceFile, SyntaxNode, TextRange, | 6 | AstNode, ForExpr, IfExpr, LambdaExpr, LetStmt, MatchArmList, Pat, PatKind, SourceFile, |
7 | TypeAscriptionOwner, WhileExpr, | ||
8 | }, | ||
9 | SmolStr, SyntaxKind, SyntaxNode, TextRange, | ||
8 | }; | 10 | }; |
9 | 11 | ||
10 | #[derive(Debug, PartialEq, Eq)] | 12 | #[derive(Debug, PartialEq, Eq, Clone)] |
11 | pub enum InlayKind { | 13 | pub enum InlayKind { |
12 | LetBindingType, | 14 | LetBindingType, |
13 | ClosureParameterType, | 15 | ClosureParameterType, |
16 | ForExpressionBindingType, | ||
17 | IfExpressionType, | ||
18 | WhileLetExpressionType, | ||
19 | MatchArmType, | ||
14 | } | 20 | } |
15 | 21 | ||
16 | #[derive(Debug)] | 22 | #[derive(Debug)] |
@@ -34,68 +40,142 @@ fn get_inlay_hints( | |||
34 | node: &SyntaxNode, | 40 | node: &SyntaxNode, |
35 | ) -> Option<Vec<InlayHint>> { | 41 | ) -> Option<Vec<InlayHint>> { |
36 | visitor() | 42 | visitor() |
37 | .visit(|let_statement: ast::LetStmt| { | 43 | .visit(|let_statement: LetStmt| { |
38 | let let_syntax = let_statement.syntax(); | ||
39 | |||
40 | if let_statement.ascribed_type().is_some() { | 44 | if let_statement.ascribed_type().is_some() { |
41 | return None; | 45 | return None; |
42 | } | 46 | } |
43 | 47 | let pat = let_statement.pat()?; | |
44 | let let_pat = let_statement.pat()?; | 48 | let analyzer = SourceAnalyzer::new(db, file_id, let_statement.syntax(), None); |
45 | let inlay_type_string = get_node_displayable_type(db, file_id, let_syntax, &let_pat)? | 49 | Some(get_pat_hints(db, &analyzer, pat, InlayKind::LetBindingType, false)) |
46 | .display(db) | ||
47 | .to_string() | ||
48 | .into(); | ||
49 | |||
50 | let pat_range = match let_pat.kind() { | ||
51 | PatKind::BindPat(bind_pat) => bind_pat.syntax().text_range(), | ||
52 | PatKind::TuplePat(tuple_pat) => tuple_pat.syntax().text_range(), | ||
53 | _ => return None, | ||
54 | }; | ||
55 | |||
56 | Some(vec![InlayHint { | ||
57 | range: pat_range, | ||
58 | kind: InlayKind::LetBindingType, | ||
59 | label: inlay_type_string, | ||
60 | }]) | ||
61 | }) | 50 | }) |
62 | .visit(|closure_parameter: ast::LambdaExpr| match closure_parameter.param_list() { | 51 | .visit(|closure_parameter: LambdaExpr| { |
63 | Some(param_list) => Some( | 52 | let analyzer = SourceAnalyzer::new(db, file_id, closure_parameter.syntax(), None); |
53 | closure_parameter.param_list().map(|param_list| { | ||
64 | param_list | 54 | param_list |
65 | .params() | 55 | .params() |
66 | .filter(|closure_param| closure_param.ascribed_type().is_none()) | 56 | .filter(|closure_param| closure_param.ascribed_type().is_none()) |
67 | .filter_map(|closure_param| { | 57 | .filter_map(|closure_param| closure_param.pat()) |
68 | let closure_param_syntax = closure_param.syntax(); | 58 | .map(|root_pat| { |
69 | let inlay_type_string = get_node_displayable_type( | 59 | get_pat_hints( |
70 | db, | 60 | db, |
71 | file_id, | 61 | &analyzer, |
72 | closure_param_syntax, | 62 | root_pat, |
73 | &closure_param.pat()?, | 63 | InlayKind::ClosureParameterType, |
74 | )? | 64 | false, |
75 | .display(db) | 65 | ) |
76 | .to_string() | ||
77 | .into(); | ||
78 | |||
79 | Some(InlayHint { | ||
80 | range: closure_param_syntax.text_range(), | ||
81 | kind: InlayKind::ClosureParameterType, | ||
82 | label: inlay_type_string, | ||
83 | }) | ||
84 | }) | 66 | }) |
67 | .flatten() | ||
68 | .collect() | ||
69 | }) | ||
70 | }) | ||
71 | .visit(|for_expression: ForExpr| { | ||
72 | let pat = for_expression.pat()?; | ||
73 | let analyzer = SourceAnalyzer::new(db, file_id, for_expression.syntax(), None); | ||
74 | Some(get_pat_hints(db, &analyzer, pat, InlayKind::ForExpressionBindingType, false)) | ||
75 | }) | ||
76 | .visit(|if_expr: IfExpr| { | ||
77 | let pat = if_expr.condition()?.pat()?; | ||
78 | let analyzer = SourceAnalyzer::new(db, file_id, if_expr.syntax(), None); | ||
79 | Some(get_pat_hints(db, &analyzer, pat, InlayKind::IfExpressionType, true)) | ||
80 | }) | ||
81 | .visit(|while_expr: WhileExpr| { | ||
82 | let pat = while_expr.condition()?.pat()?; | ||
83 | let analyzer = SourceAnalyzer::new(db, file_id, while_expr.syntax(), None); | ||
84 | Some(get_pat_hints(db, &analyzer, pat, InlayKind::WhileLetExpressionType, true)) | ||
85 | }) | ||
86 | .visit(|match_arm_list: MatchArmList| { | ||
87 | let analyzer = SourceAnalyzer::new(db, file_id, match_arm_list.syntax(), None); | ||
88 | Some( | ||
89 | match_arm_list | ||
90 | .arms() | ||
91 | .map(|match_arm| match_arm.pats()) | ||
92 | .flatten() | ||
93 | .map(|root_pat| { | ||
94 | get_pat_hints(db, &analyzer, root_pat, InlayKind::MatchArmType, true) | ||
95 | }) | ||
96 | .flatten() | ||
85 | .collect(), | 97 | .collect(), |
86 | ), | 98 | ) |
87 | None => None, | ||
88 | }) | 99 | }) |
89 | .accept(&node)? | 100 | .accept(&node)? |
90 | } | 101 | } |
91 | 102 | ||
103 | fn get_pat_hints( | ||
104 | db: &RootDatabase, | ||
105 | analyzer: &SourceAnalyzer, | ||
106 | root_pat: Pat, | ||
107 | kind: InlayKind, | ||
108 | skip_root_pat_hint: bool, | ||
109 | ) -> Vec<InlayHint> { | ||
110 | let original_pat = &root_pat.clone(); | ||
111 | |||
112 | get_leaf_pats(root_pat) | ||
113 | .into_iter() | ||
114 | .filter(|pat| !skip_root_pat_hint || pat != original_pat) | ||
115 | .filter_map(|pat| { | ||
116 | get_node_displayable_type(db, &analyzer, &pat) | ||
117 | .map(|pat_type| (pat.syntax().text_range(), pat_type)) | ||
118 | }) | ||
119 | .map(|(range, pat_type)| InlayHint { | ||
120 | range, | ||
121 | kind: kind.clone(), | ||
122 | label: pat_type.display(db).to_string().into(), | ||
123 | }) | ||
124 | .collect() | ||
125 | } | ||
126 | |||
127 | fn get_leaf_pats(root_pat: Pat) -> Vec<Pat> { | ||
128 | let mut pats_to_process = std::collections::VecDeque::<Pat>::new(); | ||
129 | pats_to_process.push_back(root_pat); | ||
130 | |||
131 | let mut leaf_pats = Vec::new(); | ||
132 | |||
133 | while let Some(maybe_leaf_pat) = pats_to_process.pop_front() { | ||
134 | match maybe_leaf_pat.kind() { | ||
135 | PatKind::BindPat(bind_pat) => { | ||
136 | if let Some(pat) = bind_pat.pat() { | ||
137 | pats_to_process.push_back(pat); | ||
138 | } else { | ||
139 | leaf_pats.push(maybe_leaf_pat); | ||
140 | } | ||
141 | } | ||
142 | PatKind::TuplePat(tuple_pat) => { | ||
143 | for arg_pat in tuple_pat.args() { | ||
144 | pats_to_process.push_back(arg_pat); | ||
145 | } | ||
146 | } | ||
147 | PatKind::StructPat(struct_pat) => { | ||
148 | if let Some(pat_list) = struct_pat.field_pat_list() { | ||
149 | pats_to_process.extend( | ||
150 | pat_list | ||
151 | .field_pats() | ||
152 | .filter_map(|field_pat| { | ||
153 | field_pat | ||
154 | .pat() | ||
155 | .filter(|pat| pat.syntax().kind() != SyntaxKind::BIND_PAT) | ||
156 | }) | ||
157 | .chain(pat_list.bind_pats().map(|bind_pat| { | ||
158 | bind_pat.pat().unwrap_or_else(|| Pat::from(bind_pat)) | ||
159 | })), | ||
160 | ); | ||
161 | } | ||
162 | } | ||
163 | PatKind::TupleStructPat(tuple_struct_pat) => { | ||
164 | for arg_pat in tuple_struct_pat.args() { | ||
165 | pats_to_process.push_back(arg_pat); | ||
166 | } | ||
167 | } | ||
168 | _ => (), | ||
169 | } | ||
170 | } | ||
171 | leaf_pats | ||
172 | } | ||
173 | |||
92 | fn get_node_displayable_type( | 174 | fn get_node_displayable_type( |
93 | db: &RootDatabase, | 175 | db: &RootDatabase, |
94 | file_id: FileId, | 176 | analyzer: &SourceAnalyzer, |
95 | node_syntax: &SyntaxNode, | ||
96 | node_pat: &Pat, | 177 | node_pat: &Pat, |
97 | ) -> Option<Ty> { | 178 | ) -> Option<Ty> { |
98 | let analyzer = hir::SourceAnalyzer::new(db, file_id, node_syntax, None); | ||
99 | analyzer.type_of_pat(db, node_pat).and_then(|resolved_type| { | 179 | analyzer.type_of_pat(db, node_pat).and_then(|resolved_type| { |
100 | if let Ty::Apply(_) = resolved_type { | 180 | if let Ty::Apply(_) = resolved_type { |
101 | Some(resolved_type) | 181 | Some(resolved_type) |
@@ -111,68 +191,306 @@ mod tests { | |||
111 | use insta::assert_debug_snapshot_matches; | 191 | use insta::assert_debug_snapshot_matches; |
112 | 192 | ||
113 | #[test] | 193 | #[test] |
114 | fn test_inlay_hints() { | 194 | fn let_statement() { |
115 | let (analysis, file_id) = single_file( | 195 | let (analysis, file_id) = single_file( |
116 | r#" | 196 | r#" |
117 | struct OuterStruct {} | 197 | #[derive(PartialEq)] |
198 | enum CustomOption<T> { | ||
199 | None, | ||
200 | Some(T), | ||
201 | } | ||
202 | |||
203 | #[derive(PartialEq)] | ||
204 | struct Test { | ||
205 | a: CustomOption<u32>, | ||
206 | b: u8, | ||
207 | } | ||
118 | 208 | ||
119 | fn main() { | 209 | fn main() { |
120 | struct InnerStruct {} | 210 | struct InnerStruct {} |
121 | 211 | ||
122 | let test = 54; | 212 | let test = 54; |
123 | let test = InnerStruct {}; | 213 | let test: i32 = 33; |
124 | let test = OuterStruct {}; | ||
125 | let test = vec![222]; | ||
126 | let mut test = Vec::new(); | ||
127 | test.push(333); | ||
128 | let test = test.into_iter().map(|i| i * i).collect::<Vec<_>>(); | ||
129 | let mut test = 33; | 214 | let mut test = 33; |
130 | let _ = 22; | 215 | let _ = 22; |
131 | let test: Vec<_> = (0..3).collect(); | 216 | let test = "test"; |
217 | let test = InnerStruct {}; | ||
132 | 218 | ||
133 | let _ = (0..23).map(|i: u32| { | 219 | let test = vec![222]; |
134 | let i_squared = i * i; | 220 | let test: Vec<_> = (0..3).collect(); |
135 | i_squared | 221 | let test = (0..3).collect::<Vec<i128>>(); |
136 | }); | 222 | let test = (0..3).collect::<Vec<_>>(); |
137 | 223 | ||
138 | let test: i32 = 33; | 224 | let mut test = Vec::new(); |
225 | test.push(333); | ||
139 | 226 | ||
140 | let (x, c) = (42, 'a'); | ||
141 | let test = (42, 'a'); | 227 | let test = (42, 'a'); |
142 | } | 228 | let (a, (b, c, (d, e), f)) = (2, (3, 4, (6.6, 7.7), 5)); |
143 | "#, | 229 | }"#, |
144 | ); | 230 | ); |
145 | 231 | ||
146 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | 232 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ |
147 | InlayHint { | 233 | InlayHint { |
148 | range: [71; 75), | 234 | range: [193; 197), |
149 | kind: LetBindingType, | 235 | kind: LetBindingType, |
150 | label: "i32", | 236 | label: "i32", |
151 | }, | 237 | }, |
152 | InlayHint { | 238 | InlayHint { |
153 | range: [121; 125), | 239 | range: [236; 244), |
154 | kind: LetBindingType, | 240 | kind: LetBindingType, |
155 | label: "OuterStruct", | 241 | label: "i32", |
156 | }, | 242 | }, |
157 | InlayHint { | 243 | InlayHint { |
158 | range: [297; 305), | 244 | range: [275; 279), |
245 | kind: LetBindingType, | ||
246 | label: "&str", | ||
247 | }, | ||
248 | InlayHint { | ||
249 | range: [539; 543), | ||
250 | kind: LetBindingType, | ||
251 | label: "(i32, char)", | ||
252 | }, | ||
253 | InlayHint { | ||
254 | range: [566; 567), | ||
159 | kind: LetBindingType, | 255 | kind: LetBindingType, |
160 | label: "i32", | 256 | label: "i32", |
161 | }, | 257 | }, |
162 | InlayHint { | 258 | InlayHint { |
163 | range: [417; 426), | 259 | range: [570; 571), |
164 | kind: LetBindingType, | 260 | kind: LetBindingType, |
165 | label: "u32", | 261 | label: "i32", |
166 | }, | 262 | }, |
167 | InlayHint { | 263 | InlayHint { |
168 | range: [496; 502), | 264 | range: [573; 574), |
169 | kind: LetBindingType, | 265 | kind: LetBindingType, |
170 | label: "(i32, char)", | 266 | label: "i32", |
171 | }, | 267 | }, |
172 | InlayHint { | 268 | InlayHint { |
173 | range: [524; 528), | 269 | range: [584; 585), |
174 | kind: LetBindingType, | 270 | kind: LetBindingType, |
175 | label: "(i32, char)", | 271 | label: "i32", |
272 | }, | ||
273 | InlayHint { | ||
274 | range: [577; 578), | ||
275 | kind: LetBindingType, | ||
276 | label: "f64", | ||
277 | }, | ||
278 | InlayHint { | ||
279 | range: [580; 581), | ||
280 | kind: LetBindingType, | ||
281 | label: "f64", | ||
282 | }, | ||
283 | ]"# | ||
284 | ); | ||
285 | } | ||
286 | |||
287 | #[test] | ||
288 | fn closure_parameter() { | ||
289 | let (analysis, file_id) = single_file( | ||
290 | r#" | ||
291 | fn main() { | ||
292 | let mut start = 0; | ||
293 | (0..2).for_each(|increment| { | ||
294 | start += increment; | ||
295 | }) | ||
296 | }"#, | ||
297 | ); | ||
298 | |||
299 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | ||
300 | InlayHint { | ||
301 | range: [21; 30), | ||
302 | kind: LetBindingType, | ||
303 | label: "i32", | ||
304 | }, | ||
305 | InlayHint { | ||
306 | range: [57; 66), | ||
307 | kind: ClosureParameterType, | ||
308 | label: "i32", | ||
309 | }, | ||
310 | ]"# | ||
311 | ); | ||
312 | } | ||
313 | |||
314 | #[test] | ||
315 | fn for_expression() { | ||
316 | let (analysis, file_id) = single_file( | ||
317 | r#" | ||
318 | fn main() { | ||
319 | let mut start = 0; | ||
320 | for increment in 0..2 { | ||
321 | start += increment; | ||
322 | } | ||
323 | }"#, | ||
324 | ); | ||
325 | |||
326 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | ||
327 | InlayHint { | ||
328 | range: [21; 30), | ||
329 | kind: LetBindingType, | ||
330 | label: "i32", | ||
331 | }, | ||
332 | InlayHint { | ||
333 | range: [44; 53), | ||
334 | kind: ForExpressionBindingType, | ||
335 | label: "i32", | ||
336 | }, | ||
337 | ]"# | ||
338 | ); | ||
339 | } | ||
340 | |||
341 | #[test] | ||
342 | fn if_expr() { | ||
343 | let (analysis, file_id) = single_file( | ||
344 | r#" | ||
345 | #[derive(PartialEq)] | ||
346 | enum CustomOption<T> { | ||
347 | None, | ||
348 | Some(T), | ||
349 | } | ||
350 | |||
351 | #[derive(PartialEq)] | ||
352 | struct Test { | ||
353 | a: CustomOption<u32>, | ||
354 | b: u8, | ||
355 | } | ||
356 | |||
357 | fn main() { | ||
358 | let test = CustomOption::Some(Test { a: CustomOption::Some(3), b: 1 }); | ||
359 | if let CustomOption::None = &test {}; | ||
360 | if let test = &test {}; | ||
361 | if let CustomOption::Some(test) = &test {}; | ||
362 | if let CustomOption::Some(Test { a, b }) = &test {}; | ||
363 | if let CustomOption::Some(Test { a: x, b: y }) = &test {}; | ||
364 | if let CustomOption::Some(Test { a: CustomOption::Some(x), b: y }) = &test {}; | ||
365 | if let CustomOption::Some(Test { a: CustomOption::None, b: y }) = &test {}; | ||
366 | if let CustomOption::Some(Test { b: y, .. }) = &test {}; | ||
367 | |||
368 | if test == CustomOption::None {} | ||
369 | }"#, | ||
370 | ); | ||
371 | |||
372 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | ||
373 | InlayHint { | ||
374 | range: [166; 170), | ||
375 | kind: LetBindingType, | ||
376 | label: "CustomOption<Test>", | ||
377 | }, | ||
378 | InlayHint { | ||
379 | range: [334; 338), | ||
380 | kind: IfExpressionType, | ||
381 | label: "&Test", | ||
382 | }, | ||
383 | InlayHint { | ||
384 | range: [389; 390), | ||
385 | kind: IfExpressionType, | ||
386 | label: "&CustomOption<u32>", | ||
387 | }, | ||
388 | InlayHint { | ||
389 | range: [392; 393), | ||
390 | kind: IfExpressionType, | ||
391 | label: "&u8", | ||
392 | }, | ||
393 | InlayHint { | ||
394 | range: [531; 532), | ||
395 | kind: IfExpressionType, | ||
396 | label: "&u32", | ||
397 | }, | ||
398 | ]"# | ||
399 | ); | ||
400 | } | ||
401 | |||
402 | #[test] | ||
403 | fn while_expr() { | ||
404 | let (analysis, file_id) = single_file( | ||
405 | r#" | ||
406 | #[derive(PartialEq)] | ||
407 | enum CustomOption<T> { | ||
408 | None, | ||
409 | Some(T), | ||
410 | } | ||
411 | |||
412 | #[derive(PartialEq)] | ||
413 | struct Test { | ||
414 | a: CustomOption<u32>, | ||
415 | b: u8, | ||
416 | } | ||
417 | |||
418 | fn main() { | ||
419 | let test = CustomOption::Some(Test { a: CustomOption::Some(3), b: 1 }); | ||
420 | while let CustomOption::None = &test {}; | ||
421 | while let test = &test {}; | ||
422 | while let CustomOption::Some(test) = &test {}; | ||
423 | while let CustomOption::Some(Test { a, b }) = &test {}; | ||
424 | while let CustomOption::Some(Test { a: x, b: y }) = &test {}; | ||
425 | while let CustomOption::Some(Test { a: CustomOption::Some(x), b: y }) = &test {}; | ||
426 | while let CustomOption::Some(Test { a: CustomOption::None, b: y }) = &test {}; | ||
427 | while let CustomOption::Some(Test { b: y, .. }) = &test {}; | ||
428 | |||
429 | while test == CustomOption::None {} | ||
430 | }"#, | ||
431 | ); | ||
432 | |||
433 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | ||
434 | InlayHint { | ||
435 | range: [166; 170), | ||
436 | kind: LetBindingType, | ||
437 | label: "CustomOption<Test>", | ||
438 | }, | ||
439 | ]"# | ||
440 | ); | ||
441 | } | ||
442 | |||
443 | #[test] | ||
444 | fn match_arm_list() { | ||
445 | let (analysis, file_id) = single_file( | ||
446 | r#" | ||
447 | #[derive(PartialEq)] | ||
448 | enum CustomOption<T> { | ||
449 | None, | ||
450 | Some(T), | ||
451 | } | ||
452 | |||
453 | #[derive(PartialEq)] | ||
454 | struct Test { | ||
455 | a: CustomOption<u32>, | ||
456 | b: u8, | ||
457 | } | ||
458 | |||
459 | fn main() { | ||
460 | match CustomOption::Some(Test { a: CustomOption::Some(3), b: 1 }) { | ||
461 | CustomOption::None => (), | ||
462 | test => (), | ||
463 | CustomOption::Some(test) => (), | ||
464 | CustomOption::Some(Test { a, b }) => (), | ||
465 | CustomOption::Some(Test { a: x, b: y }) => (), | ||
466 | CustomOption::Some(Test { a: CustomOption::Some(x), b: y }) => (), | ||
467 | CustomOption::Some(Test { a: CustomOption::None, b: y }) => (), | ||
468 | CustomOption::Some(Test { b: y, .. }) => (), | ||
469 | _ => {} | ||
470 | } | ||
471 | }"#, | ||
472 | ); | ||
473 | |||
474 | assert_debug_snapshot_matches!(analysis.inlay_hints(file_id).unwrap(), @r#"[ | ||
475 | InlayHint { | ||
476 | range: [312; 316), | ||
477 | kind: MatchArmType, | ||
478 | label: "Test", | ||
479 | }, | ||
480 | InlayHint { | ||
481 | range: [359; 360), | ||
482 | kind: MatchArmType, | ||
483 | label: "CustomOption<u32>", | ||
484 | }, | ||
485 | InlayHint { | ||
486 | range: [362; 363), | ||
487 | kind: MatchArmType, | ||
488 | label: "u8", | ||
489 | }, | ||
490 | InlayHint { | ||
491 | range: [485; 486), | ||
492 | kind: MatchArmType, | ||
493 | label: "u32", | ||
176 | }, | 494 | }, |
177 | ]"# | 495 | ]"# |
178 | ); | 496 | ); |
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 16ffb03ce..edb646c11 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -317,24 +317,24 @@ impl Analysis { | |||
317 | } | 317 | } |
318 | 318 | ||
319 | /// Debug info about the current state of the analysis | 319 | /// Debug info about the current state of the analysis |
320 | pub fn status(&self) -> String { | 320 | pub fn status(&self) -> Cancelable<String> { |
321 | status::status(&*self.db) | 321 | self.with_db(|db| status::status(&*db)) |
322 | } | 322 | } |
323 | 323 | ||
324 | /// Gets the text of the source file. | 324 | /// Gets the text of the source file. |
325 | pub fn file_text(&self, file_id: FileId) -> Arc<String> { | 325 | pub fn file_text(&self, file_id: FileId) -> Cancelable<Arc<String>> { |
326 | self.db.file_text(file_id) | 326 | self.with_db(|db| db.file_text(file_id)) |
327 | } | 327 | } |
328 | 328 | ||
329 | /// Gets the syntax tree of the file. | 329 | /// Gets the syntax tree of the file. |
330 | pub fn parse(&self, file_id: FileId) -> SourceFile { | 330 | pub fn parse(&self, file_id: FileId) -> Cancelable<SourceFile> { |
331 | self.db.parse(file_id).tree() | 331 | self.with_db(|db| db.parse(file_id).tree()) |
332 | } | 332 | } |
333 | 333 | ||
334 | /// Gets the file's `LineIndex`: data structure to convert between absolute | 334 | /// Gets the file's `LineIndex`: data structure to convert between absolute |
335 | /// offsets and line/column representation. | 335 | /// offsets and line/column representation. |
336 | pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> { | 336 | pub fn file_line_index(&self, file_id: FileId) -> Cancelable<Arc<LineIndex>> { |
337 | self.db.line_index(file_id) | 337 | self.with_db(|db| db.line_index(file_id)) |
338 | } | 338 | } |
339 | 339 | ||
340 | /// Selects the next syntactic nodes encompassing the range. | 340 | /// Selects the next syntactic nodes encompassing the range. |
@@ -344,58 +344,67 @@ impl Analysis { | |||
344 | 344 | ||
345 | /// Returns position of the matching brace (all types of braces are | 345 | /// Returns position of the matching brace (all types of braces are |
346 | /// supported). | 346 | /// supported). |
347 | pub fn matching_brace(&self, position: FilePosition) -> Option<TextUnit> { | 347 | pub fn matching_brace(&self, position: FilePosition) -> Cancelable<Option<TextUnit>> { |
348 | let parse = self.db.parse(position.file_id); | 348 | self.with_db(|db| { |
349 | let file = parse.tree(); | 349 | let parse = db.parse(position.file_id); |
350 | matching_brace::matching_brace(&file, position.offset) | 350 | let file = parse.tree(); |
351 | matching_brace::matching_brace(&file, position.offset) | ||
352 | }) | ||
351 | } | 353 | } |
352 | 354 | ||
353 | /// Returns a syntax tree represented as `String`, for debug purposes. | 355 | /// Returns a syntax tree represented as `String`, for debug purposes. |
354 | // FIXME: use a better name here. | 356 | // FIXME: use a better name here. |
355 | pub fn syntax_tree(&self, file_id: FileId, text_range: Option<TextRange>) -> String { | 357 | pub fn syntax_tree( |
356 | syntax_tree::syntax_tree(&self.db, file_id, text_range) | 358 | &self, |
359 | file_id: FileId, | ||
360 | text_range: Option<TextRange>, | ||
361 | ) -> Cancelable<String> { | ||
362 | self.with_db(|db| syntax_tree::syntax_tree(&db, file_id, text_range)) | ||
357 | } | 363 | } |
358 | 364 | ||
359 | /// Returns an edit to remove all newlines in the range, cleaning up minor | 365 | /// Returns an edit to remove all newlines in the range, cleaning up minor |
360 | /// stuff like trailing commas. | 366 | /// stuff like trailing commas. |
361 | pub fn join_lines(&self, frange: FileRange) -> SourceChange { | 367 | pub fn join_lines(&self, frange: FileRange) -> Cancelable<SourceChange> { |
362 | let parse = self.db.parse(frange.file_id); | 368 | self.with_db(|db| { |
363 | let file_edit = SourceFileEdit { | 369 | let parse = db.parse(frange.file_id); |
364 | file_id: frange.file_id, | 370 | let file_edit = SourceFileEdit { |
365 | edit: join_lines::join_lines(&parse.tree(), frange.range), | 371 | file_id: frange.file_id, |
366 | }; | 372 | edit: join_lines::join_lines(&parse.tree(), frange.range), |
367 | SourceChange::source_file_edit("join lines", file_edit) | 373 | }; |
374 | SourceChange::source_file_edit("join lines", file_edit) | ||
375 | }) | ||
368 | } | 376 | } |
369 | 377 | ||
370 | /// Returns an edit which should be applied when opening a new line, fixing | 378 | /// Returns an edit which should be applied when opening a new line, fixing |
371 | /// up minor stuff like continuing the comment. | 379 | /// up minor stuff like continuing the comment. |
372 | pub fn on_enter(&self, position: FilePosition) -> Option<SourceChange> { | 380 | pub fn on_enter(&self, position: FilePosition) -> Cancelable<Option<SourceChange>> { |
373 | typing::on_enter(&self.db, position) | 381 | self.with_db(|db| typing::on_enter(&db, position)) |
374 | } | 382 | } |
375 | 383 | ||
376 | /// Returns an edit which should be applied after `=` was typed. Primarily, | 384 | /// Returns an edit which should be applied after `=` was typed. Primarily, |
377 | /// this works when adding `let =`. | 385 | /// this works when adding `let =`. |
378 | // FIXME: use a snippet completion instead of this hack here. | 386 | // FIXME: use a snippet completion instead of this hack here. |
379 | pub fn on_eq_typed(&self, position: FilePosition) -> Option<SourceChange> { | 387 | pub fn on_eq_typed(&self, position: FilePosition) -> Cancelable<Option<SourceChange>> { |
380 | let parse = self.db.parse(position.file_id); | 388 | self.with_db(|db| { |
381 | let file = parse.tree(); | 389 | let parse = db.parse(position.file_id); |
382 | let edit = typing::on_eq_typed(&file, position.offset)?; | 390 | let file = parse.tree(); |
383 | Some(SourceChange::source_file_edit( | 391 | let edit = typing::on_eq_typed(&file, position.offset)?; |
384 | "add semicolon", | 392 | Some(SourceChange::source_file_edit( |
385 | SourceFileEdit { edit, file_id: position.file_id }, | 393 | "add semicolon", |
386 | )) | 394 | SourceFileEdit { edit, file_id: position.file_id }, |
395 | )) | ||
396 | }) | ||
387 | } | 397 | } |
388 | 398 | ||
389 | /// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately. | 399 | /// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately. |
390 | pub fn on_dot_typed(&self, position: FilePosition) -> Option<SourceChange> { | 400 | pub fn on_dot_typed(&self, position: FilePosition) -> Cancelable<Option<SourceChange>> { |
391 | typing::on_dot_typed(&self.db, position) | 401 | self.with_db(|db| typing::on_dot_typed(&db, position)) |
392 | } | 402 | } |
393 | 403 | ||
394 | /// Returns a tree representation of symbols in the file. Useful to draw a | 404 | /// Returns a tree representation of symbols in the file. Useful to draw a |
395 | /// file outline. | 405 | /// file outline. |
396 | pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> { | 406 | pub fn file_structure(&self, file_id: FileId) -> Cancelable<Vec<StructureNode>> { |
397 | let parse = self.db.parse(file_id); | 407 | self.with_db(|db| file_structure(&db.parse(file_id).tree())) |
398 | file_structure(&parse.tree()) | ||
399 | } | 408 | } |
400 | 409 | ||
401 | /// Returns a list of the places in the file where type hints can be displayed. | 410 | /// Returns a list of the places in the file where type hints can be displayed. |
@@ -404,9 +413,8 @@ impl Analysis { | |||
404 | } | 413 | } |
405 | 414 | ||
406 | /// Returns the set of folding ranges. | 415 | /// Returns the set of folding ranges. |
407 | pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> { | 416 | pub fn folding_ranges(&self, file_id: FileId) -> Cancelable<Vec<Fold>> { |
408 | let parse = self.db.parse(file_id); | 417 | self.with_db(|db| folding_ranges::folding_ranges(&db.parse(file_id).tree())) |
409 | folding_ranges::folding_ranges(&parse.tree()) | ||
410 | } | 418 | } |
411 | 419 | ||
412 | /// Fuzzy searches for a symbol. | 420 | /// Fuzzy searches for a symbol. |
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 379dd422e..2118e7ad3 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs | |||
@@ -437,7 +437,8 @@ mod tests { | |||
437 | } | 437 | } |
438 | } | 438 | } |
439 | } | 439 | } |
440 | let result = text_edit_builder.finish().apply(&*analysis.file_text(file_id.unwrap())); | 440 | let result = |
441 | text_edit_builder.finish().apply(&*analysis.file_text(file_id.unwrap()).unwrap()); | ||
441 | assert_eq_text!(expected, &*result); | 442 | assert_eq_text!(expected, &*result); |
442 | } | 443 | } |
443 | } | 444 | } |
diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide_api/src/syntax_tree.rs index a07e670fa..dd31b9093 100644 --- a/crates/ra_ide_api/src/syntax_tree.rs +++ b/crates/ra_ide_api/src/syntax_tree.rs | |||
@@ -101,7 +101,7 @@ mod tests { | |||
101 | fn test_syntax_tree_without_range() { | 101 | fn test_syntax_tree_without_range() { |
102 | // Basic syntax | 102 | // Basic syntax |
103 | let (analysis, file_id) = single_file(r#"fn foo() {}"#); | 103 | let (analysis, file_id) = single_file(r#"fn foo() {}"#); |
104 | let syn = analysis.syntax_tree(file_id, None); | 104 | let syn = analysis.syntax_tree(file_id, None).unwrap(); |
105 | 105 | ||
106 | assert_eq_text!( | 106 | assert_eq_text!( |
107 | syn.trim(), | 107 | syn.trim(), |
@@ -133,7 +133,7 @@ fn test() { | |||
133 | }"# | 133 | }"# |
134 | .trim(), | 134 | .trim(), |
135 | ); | 135 | ); |
136 | let syn = analysis.syntax_tree(file_id, None); | 136 | let syn = analysis.syntax_tree(file_id, None).unwrap(); |
137 | 137 | ||
138 | assert_eq_text!( | 138 | assert_eq_text!( |
139 | syn.trim(), | 139 | syn.trim(), |
@@ -176,7 +176,7 @@ SOURCE_FILE@[0; 60) | |||
176 | #[test] | 176 | #[test] |
177 | fn test_syntax_tree_with_range() { | 177 | fn test_syntax_tree_with_range() { |
178 | let (analysis, range) = single_file_with_range(r#"<|>fn foo() {}<|>"#.trim()); | 178 | let (analysis, range) = single_file_with_range(r#"<|>fn foo() {}<|>"#.trim()); |
179 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 179 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
180 | 180 | ||
181 | assert_eq_text!( | 181 | assert_eq_text!( |
182 | syn.trim(), | 182 | syn.trim(), |
@@ -206,7 +206,7 @@ FN_DEF@[0; 11) | |||
206 | }"# | 206 | }"# |
207 | .trim(), | 207 | .trim(), |
208 | ); | 208 | ); |
209 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 209 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
210 | 210 | ||
211 | assert_eq_text!( | 211 | assert_eq_text!( |
212 | syn.trim(), | 212 | syn.trim(), |
@@ -244,7 +244,7 @@ fn bar() { | |||
244 | }"# | 244 | }"# |
245 | .trim(), | 245 | .trim(), |
246 | ); | 246 | ); |
247 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 247 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
248 | assert_eq_text!( | 248 | assert_eq_text!( |
249 | syn.trim(), | 249 | syn.trim(), |
250 | r#" | 250 | r#" |
@@ -278,7 +278,7 @@ fn bar() { | |||
278 | }"### | 278 | }"### |
279 | .trim(), | 279 | .trim(), |
280 | ); | 280 | ); |
281 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 281 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
282 | assert_eq_text!( | 282 | assert_eq_text!( |
283 | syn.trim(), | 283 | syn.trim(), |
284 | r#" | 284 | r#" |
@@ -311,7 +311,7 @@ fn bar() { | |||
311 | }"### | 311 | }"### |
312 | .trim(), | 312 | .trim(), |
313 | ); | 313 | ); |
314 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 314 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
315 | assert_eq_text!( | 315 | assert_eq_text!( |
316 | syn.trim(), | 316 | syn.trim(), |
317 | r#" | 317 | r#" |
diff --git a/crates/ra_ide_api/src/typing.rs b/crates/ra_ide_api/src/typing.rs index 6b3fd5904..2d4491442 100644 --- a/crates/ra_ide_api/src/typing.rs +++ b/crates/ra_ide_api/src/typing.rs | |||
@@ -195,7 +195,7 @@ fn foo() { | |||
195 | edit.insert(offset, ".".to_string()); | 195 | edit.insert(offset, ".".to_string()); |
196 | let before = edit.finish().apply(&before); | 196 | let before = edit.finish().apply(&before); |
197 | let (analysis, file_id) = single_file(&before); | 197 | let (analysis, file_id) = single_file(&before); |
198 | if let Some(result) = analysis.on_dot_typed(FilePosition { offset, file_id }) { | 198 | if let Some(result) = analysis.on_dot_typed(FilePosition { offset, file_id }).unwrap() { |
199 | assert_eq!(result.source_file_edits.len(), 1); | 199 | assert_eq!(result.source_file_edits.len(), 1); |
200 | let actual = result.source_file_edits[0].edit.apply(&before); | 200 | let actual = result.source_file_edits[0].edit.apply(&before); |
201 | assert_eq_text!(after, &actual); | 201 | assert_eq_text!(after, &actual); |
@@ -377,7 +377,7 @@ fn foo() { | |||
377 | fn apply_on_enter(before: &str) -> Option<String> { | 377 | fn apply_on_enter(before: &str) -> Option<String> { |
378 | let (offset, before) = extract_offset(before); | 378 | let (offset, before) = extract_offset(before); |
379 | let (analysis, file_id) = single_file(&before); | 379 | let (analysis, file_id) = single_file(&before); |
380 | let result = analysis.on_enter(FilePosition { offset, file_id })?; | 380 | let result = analysis.on_enter(FilePosition { offset, file_id }).unwrap()?; |
381 | 381 | ||
382 | assert_eq!(result.source_file_edits.len(), 1); | 382 | assert_eq!(result.source_file_edits.len(), 1); |
383 | let actual = result.source_file_edits[0].edit.apply(&before); | 383 | let actual = result.source_file_edits[0].edit.apply(&before); |
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 82c7e757f..6b3be444f 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -272,7 +272,7 @@ impl<'a> TryConvWith for &'a TextDocumentPositionParams { | |||
272 | type Output = FilePosition; | 272 | type Output = FilePosition; |
273 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<FilePosition> { | 273 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<FilePosition> { |
274 | let file_id = self.text_document.try_conv_with(world)?; | 274 | let file_id = self.text_document.try_conv_with(world)?; |
275 | let line_index = world.analysis().file_line_index(file_id); | 275 | let line_index = world.analysis().file_line_index(file_id)?; |
276 | let offset = self.position.conv_with(&line_index); | 276 | let offset = self.position.conv_with(&line_index); |
277 | Ok(FilePosition { file_id, offset }) | 277 | Ok(FilePosition { file_id, offset }) |
278 | } | 278 | } |
@@ -283,7 +283,7 @@ impl<'a> TryConvWith for (&'a TextDocumentIdentifier, Range) { | |||
283 | type Output = FileRange; | 283 | type Output = FileRange; |
284 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileRange> { | 284 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<FileRange> { |
285 | let file_id = self.0.try_conv_with(world)?; | 285 | let file_id = self.0.try_conv_with(world)?; |
286 | let line_index = world.analysis().file_line_index(file_id); | 286 | let line_index = world.analysis().file_line_index(file_id)?; |
287 | let range = self.1.conv_with(&line_index); | 287 | let range = self.1.conv_with(&line_index); |
288 | Ok(FileRange { file_id, range }) | 288 | Ok(FileRange { file_id, range }) |
289 | } | 289 | } |
@@ -308,7 +308,7 @@ impl TryConvWith for SourceChange { | |||
308 | let cursor_position = match self.cursor_position { | 308 | let cursor_position = match self.cursor_position { |
309 | None => None, | 309 | None => None, |
310 | Some(pos) => { | 310 | Some(pos) => { |
311 | let line_index = world.analysis().file_line_index(pos.file_id); | 311 | let line_index = world.analysis().file_line_index(pos.file_id)?; |
312 | let edit = self | 312 | let edit = self |
313 | .source_file_edits | 313 | .source_file_edits |
314 | .iter() | 314 | .iter() |
@@ -349,7 +349,7 @@ impl TryConvWith for SourceFileEdit { | |||
349 | uri: self.file_id.try_conv_with(world)?, | 349 | uri: self.file_id.try_conv_with(world)?, |
350 | version: None, | 350 | version: None, |
351 | }; | 351 | }; |
352 | let line_index = world.analysis().file_line_index(self.file_id); | 352 | let line_index = world.analysis().file_line_index(self.file_id)?; |
353 | let edits = self.edit.as_atoms().iter().map_conv_with(&line_index).collect(); | 353 | let edits = self.edit.as_atoms().iter().map_conv_with(&line_index).collect(); |
354 | Ok(TextDocumentEdit { text_document, edits }) | 354 | Ok(TextDocumentEdit { text_document, edits }) |
355 | } | 355 | } |
@@ -378,7 +378,7 @@ impl TryConvWith for &NavigationTarget { | |||
378 | type Ctx = WorldSnapshot; | 378 | type Ctx = WorldSnapshot; |
379 | type Output = Location; | 379 | type Output = Location; |
380 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<Location> { | 380 | fn try_conv_with(self, world: &WorldSnapshot) -> Result<Location> { |
381 | let line_index = world.analysis().file_line_index(self.file_id()); | 381 | let line_index = world.analysis().file_line_index(self.file_id())?; |
382 | let range = self.range(); | 382 | let range = self.range(); |
383 | to_location(self.file_id(), range, &world, &line_index) | 383 | to_location(self.file_id(), range, &world, &line_index) |
384 | } | 384 | } |
@@ -391,8 +391,8 @@ impl TryConvWith for (FileId, RangeInfo<NavigationTarget>) { | |||
391 | let (src_file_id, target) = self; | 391 | let (src_file_id, target) = self; |
392 | 392 | ||
393 | let target_uri = target.info.file_id().try_conv_with(world)?; | 393 | let target_uri = target.info.file_id().try_conv_with(world)?; |
394 | let src_line_index = world.analysis().file_line_index(src_file_id); | 394 | let src_line_index = world.analysis().file_line_index(src_file_id)?; |
395 | let tgt_line_index = world.analysis().file_line_index(target.info.file_id()); | 395 | let tgt_line_index = world.analysis().file_line_index(target.info.file_id())?; |
396 | 396 | ||
397 | let target_range = target.info.full_range().conv_with(&tgt_line_index); | 397 | let target_range = target.info.full_range().conv_with(&tgt_line_index); |
398 | 398 | ||
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 5bf950a53..9006aa316 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -39,9 +39,9 @@ pub fn handle_analyzer_status(world: WorldSnapshot, _: ()) -> Result<String> { | |||
39 | 39 | ||
40 | pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) -> Result<String> { | 40 | pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) -> Result<String> { |
41 | let id = params.text_document.try_conv_with(&world)?; | 41 | let id = params.text_document.try_conv_with(&world)?; |
42 | let line_index = world.analysis().file_line_index(id); | 42 | let line_index = world.analysis().file_line_index(id)?; |
43 | let text_range = params.range.map(|p| p.conv_with(&line_index)); | 43 | let text_range = params.range.map(|p| p.conv_with(&line_index)); |
44 | let res = world.analysis().syntax_tree(id, text_range); | 44 | let res = world.analysis().syntax_tree(id, text_range)?; |
45 | Ok(res) | 45 | Ok(res) |
46 | } | 46 | } |
47 | 47 | ||
@@ -55,7 +55,7 @@ pub fn handle_extend_selection( | |||
55 | use the new selection range API in LSP", | 55 | use the new selection range API in LSP", |
56 | ); | 56 | ); |
57 | let file_id = params.text_document.try_conv_with(&world)?; | 57 | let file_id = params.text_document.try_conv_with(&world)?; |
58 | let line_index = world.analysis().file_line_index(file_id); | 58 | let line_index = world.analysis().file_line_index(file_id)?; |
59 | let selections = params | 59 | let selections = params |
60 | .selections | 60 | .selections |
61 | .into_iter() | 61 | .into_iter() |
@@ -72,7 +72,7 @@ pub fn handle_selection_range( | |||
72 | ) -> Result<Vec<req::SelectionRange>> { | 72 | ) -> Result<Vec<req::SelectionRange>> { |
73 | let _p = profile("handle_selection_range"); | 73 | let _p = profile("handle_selection_range"); |
74 | let file_id = params.text_document.try_conv_with(&world)?; | 74 | let file_id = params.text_document.try_conv_with(&world)?; |
75 | let line_index = world.analysis().file_line_index(file_id); | 75 | let line_index = world.analysis().file_line_index(file_id)?; |
76 | params | 76 | params |
77 | .positions | 77 | .positions |
78 | .into_iter() | 78 | .into_iter() |
@@ -113,13 +113,19 @@ pub fn handle_find_matching_brace( | |||
113 | ) -> Result<Vec<Position>> { | 113 | ) -> Result<Vec<Position>> { |
114 | let _p = profile("handle_find_matching_brace"); | 114 | let _p = profile("handle_find_matching_brace"); |
115 | let file_id = params.text_document.try_conv_with(&world)?; | 115 | let file_id = params.text_document.try_conv_with(&world)?; |
116 | let line_index = world.analysis().file_line_index(file_id); | 116 | let line_index = world.analysis().file_line_index(file_id)?; |
117 | let res = params | 117 | let res = params |
118 | .offsets | 118 | .offsets |
119 | .into_iter() | 119 | .into_iter() |
120 | .map_conv_with(&line_index) | 120 | .map_conv_with(&line_index) |
121 | .map(|offset| { | 121 | .map(|offset| { |
122 | world.analysis().matching_brace(FilePosition { file_id, offset }).unwrap_or(offset) | 122 | if let Ok(Some(matching_brace_offset)) = |
123 | world.analysis().matching_brace(FilePosition { file_id, offset }) | ||
124 | { | ||
125 | matching_brace_offset | ||
126 | } else { | ||
127 | offset | ||
128 | } | ||
123 | }) | 129 | }) |
124 | .map_conv_with(&line_index) | 130 | .map_conv_with(&line_index) |
125 | .collect(); | 131 | .collect(); |
@@ -132,7 +138,7 @@ pub fn handle_join_lines( | |||
132 | ) -> Result<req::SourceChange> { | 138 | ) -> Result<req::SourceChange> { |
133 | let _p = profile("handle_join_lines"); | 139 | let _p = profile("handle_join_lines"); |
134 | let frange = (¶ms.text_document, params.range).try_conv_with(&world)?; | 140 | let frange = (¶ms.text_document, params.range).try_conv_with(&world)?; |
135 | world.analysis().join_lines(frange).try_conv_with(&world) | 141 | world.analysis().join_lines(frange)?.try_conv_with(&world) |
136 | } | 142 | } |
137 | 143 | ||
138 | pub fn handle_on_enter( | 144 | pub fn handle_on_enter( |
@@ -141,7 +147,7 @@ pub fn handle_on_enter( | |||
141 | ) -> Result<Option<req::SourceChange>> { | 147 | ) -> Result<Option<req::SourceChange>> { |
142 | let _p = profile("handle_on_enter"); | 148 | let _p = profile("handle_on_enter"); |
143 | let position = params.try_conv_with(&world)?; | 149 | let position = params.try_conv_with(&world)?; |
144 | match world.analysis().on_enter(position) { | 150 | match world.analysis().on_enter(position)? { |
145 | None => Ok(None), | 151 | None => Ok(None), |
146 | Some(edit) => Ok(Some(edit.try_conv_with(&world)?)), | 152 | Some(edit) => Ok(Some(edit.try_conv_with(&world)?)), |
147 | } | 153 | } |
@@ -153,7 +159,7 @@ pub fn handle_on_type_formatting( | |||
153 | ) -> Result<Option<Vec<TextEdit>>> { | 159 | ) -> Result<Option<Vec<TextEdit>>> { |
154 | let _p = profile("handle_on_type_formatting"); | 160 | let _p = profile("handle_on_type_formatting"); |
155 | let mut position = params.text_document_position.try_conv_with(&world)?; | 161 | let mut position = params.text_document_position.try_conv_with(&world)?; |
156 | let line_index = world.analysis().file_line_index(position.file_id); | 162 | let line_index = world.analysis().file_line_index(position.file_id)?; |
157 | 163 | ||
158 | // in `ra_ide_api`, the `on_type` invariant is that | 164 | // in `ra_ide_api`, the `on_type` invariant is that |
159 | // `text.char_at(position) == typed_char`. | 165 | // `text.char_at(position) == typed_char`. |
@@ -163,7 +169,7 @@ pub fn handle_on_type_formatting( | |||
163 | "=" => world.analysis().on_eq_typed(position), | 169 | "=" => world.analysis().on_eq_typed(position), |
164 | "." => world.analysis().on_dot_typed(position), | 170 | "." => world.analysis().on_dot_typed(position), |
165 | _ => return Ok(None), | 171 | _ => return Ok(None), |
166 | }; | 172 | }?; |
167 | let mut edit = match edit { | 173 | let mut edit = match edit { |
168 | Some(it) => it, | 174 | Some(it) => it, |
169 | None => return Ok(None), | 175 | None => return Ok(None), |
@@ -181,11 +187,11 @@ pub fn handle_document_symbol( | |||
181 | params: req::DocumentSymbolParams, | 187 | params: req::DocumentSymbolParams, |
182 | ) -> Result<Option<req::DocumentSymbolResponse>> { | 188 | ) -> Result<Option<req::DocumentSymbolResponse>> { |
183 | let file_id = params.text_document.try_conv_with(&world)?; | 189 | let file_id = params.text_document.try_conv_with(&world)?; |
184 | let line_index = world.analysis().file_line_index(file_id); | 190 | let line_index = world.analysis().file_line_index(file_id)?; |
185 | 191 | ||
186 | let mut parents: Vec<(DocumentSymbol, Option<usize>)> = Vec::new(); | 192 | let mut parents: Vec<(DocumentSymbol, Option<usize>)> = Vec::new(); |
187 | 193 | ||
188 | for symbol in world.analysis().file_structure(file_id) { | 194 | for symbol in world.analysis().file_structure(file_id)? { |
189 | let doc_symbol = DocumentSymbol { | 195 | let doc_symbol = DocumentSymbol { |
190 | name: symbol.label, | 196 | name: symbol.label, |
191 | detail: symbol.detail, | 197 | detail: symbol.detail, |
@@ -309,7 +315,7 @@ pub fn handle_runnables( | |||
309 | params: req::RunnablesParams, | 315 | params: req::RunnablesParams, |
310 | ) -> Result<Vec<req::Runnable>> { | 316 | ) -> Result<Vec<req::Runnable>> { |
311 | let file_id = params.text_document.try_conv_with(&world)?; | 317 | let file_id = params.text_document.try_conv_with(&world)?; |
312 | let line_index = world.analysis().file_line_index(file_id); | 318 | let line_index = world.analysis().file_line_index(file_id)?; |
313 | let offset = params.position.map(|it| it.conv_with(&line_index)); | 319 | let offset = params.position.map(|it| it.conv_with(&line_index)); |
314 | let mut res = Vec::new(); | 320 | let mut res = Vec::new(); |
315 | let workspace_root = world.workspace_root_for(file_id); | 321 | let workspace_root = world.workspace_root_for(file_id); |
@@ -383,7 +389,7 @@ pub fn handle_completion( | |||
383 | let mut res = false; | 389 | let mut res = false; |
384 | if let Some(ctx) = params.context { | 390 | if let Some(ctx) = params.context { |
385 | if ctx.trigger_character.unwrap_or_default() == ":" { | 391 | if ctx.trigger_character.unwrap_or_default() == ":" { |
386 | let source_file = world.analysis().parse(position.file_id); | 392 | let source_file = world.analysis().parse(position.file_id)?; |
387 | let syntax = source_file.syntax(); | 393 | let syntax = source_file.syntax(); |
388 | let text = syntax.text(); | 394 | let text = syntax.text(); |
389 | if let Some(next_char) = text.char_at(position.offset) { | 395 | if let Some(next_char) = text.char_at(position.offset) { |
@@ -405,7 +411,7 @@ pub fn handle_completion( | |||
405 | None => return Ok(None), | 411 | None => return Ok(None), |
406 | Some(items) => items, | 412 | Some(items) => items, |
407 | }; | 413 | }; |
408 | let line_index = world.analysis().file_line_index(position.file_id); | 414 | let line_index = world.analysis().file_line_index(position.file_id)?; |
409 | let items: Vec<CompletionItem> = | 415 | let items: Vec<CompletionItem> = |
410 | items.into_iter().map(|item| item.conv_with(&line_index)).collect(); | 416 | items.into_iter().map(|item| item.conv_with(&line_index)).collect(); |
411 | 417 | ||
@@ -417,12 +423,12 @@ pub fn handle_folding_range( | |||
417 | params: FoldingRangeParams, | 423 | params: FoldingRangeParams, |
418 | ) -> Result<Option<Vec<FoldingRange>>> { | 424 | ) -> Result<Option<Vec<FoldingRange>>> { |
419 | let file_id = params.text_document.try_conv_with(&world)?; | 425 | let file_id = params.text_document.try_conv_with(&world)?; |
420 | let line_index = world.analysis().file_line_index(file_id); | 426 | let line_index = world.analysis().file_line_index(file_id)?; |
421 | 427 | ||
422 | let res = Some( | 428 | let res = Some( |
423 | world | 429 | world |
424 | .analysis() | 430 | .analysis() |
425 | .folding_ranges(file_id) | 431 | .folding_ranges(file_id)? |
426 | .into_iter() | 432 | .into_iter() |
427 | .map(|fold| { | 433 | .map(|fold| { |
428 | let kind = match fold.kind { | 434 | let kind = match fold.kind { |
@@ -474,7 +480,7 @@ pub fn handle_hover( | |||
474 | None => return Ok(None), | 480 | None => return Ok(None), |
475 | Some(info) => info, | 481 | Some(info) => info, |
476 | }; | 482 | }; |
477 | let line_index = world.analysis.file_line_index(position.file_id); | 483 | let line_index = world.analysis.file_line_index(position.file_id)?; |
478 | let range = info.range.conv_with(&line_index); | 484 | let range = info.range.conv_with(&line_index); |
479 | let res = Hover { | 485 | let res = Hover { |
480 | contents: HoverContents::Markup(MarkupContent { | 486 | contents: HoverContents::Markup(MarkupContent { |
@@ -503,7 +509,7 @@ pub fn handle_prepare_rename( | |||
503 | // Refs should always have a declaration | 509 | // Refs should always have a declaration |
504 | let r = refs.declaration(); | 510 | let r = refs.declaration(); |
505 | let file_id = params.text_document.try_conv_with(&world)?; | 511 | let file_id = params.text_document.try_conv_with(&world)?; |
506 | let line_index = world.analysis().file_line_index(file_id); | 512 | let line_index = world.analysis().file_line_index(file_id)?; |
507 | let loc = to_location(r.file_id(), r.range(), &world, &line_index)?; | 513 | let loc = to_location(r.file_id(), r.range(), &world, &line_index)?; |
508 | 514 | ||
509 | Ok(Some(PrepareRenameResponse::Range(loc.range))) | 515 | Ok(Some(PrepareRenameResponse::Range(loc.range))) |
@@ -536,7 +542,7 @@ pub fn handle_references( | |||
536 | params: req::ReferenceParams, | 542 | params: req::ReferenceParams, |
537 | ) -> Result<Option<Vec<Location>>> { | 543 | ) -> Result<Option<Vec<Location>>> { |
538 | let position = params.text_document_position.try_conv_with(&world)?; | 544 | let position = params.text_document_position.try_conv_with(&world)?; |
539 | let line_index = world.analysis().file_line_index(position.file_id); | 545 | let line_index = world.analysis().file_line_index(position.file_id)?; |
540 | 546 | ||
541 | let refs = match world.analysis().find_all_refs(position)? { | 547 | let refs = match world.analysis().find_all_refs(position)? { |
542 | None => return Ok(None), | 548 | None => return Ok(None), |
@@ -563,9 +569,9 @@ pub fn handle_formatting( | |||
563 | params: DocumentFormattingParams, | 569 | params: DocumentFormattingParams, |
564 | ) -> Result<Option<Vec<TextEdit>>> { | 570 | ) -> Result<Option<Vec<TextEdit>>> { |
565 | let file_id = params.text_document.try_conv_with(&world)?; | 571 | let file_id = params.text_document.try_conv_with(&world)?; |
566 | let file = world.analysis().file_text(file_id); | 572 | let file = world.analysis().file_text(file_id)?; |
567 | 573 | ||
568 | let file_line_index = world.analysis().file_line_index(file_id); | 574 | let file_line_index = world.analysis().file_line_index(file_id)?; |
569 | let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); | 575 | let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); |
570 | 576 | ||
571 | use std::process; | 577 | use std::process; |
@@ -623,7 +629,7 @@ pub fn handle_code_action( | |||
623 | ) -> Result<Option<CodeActionResponse>> { | 629 | ) -> Result<Option<CodeActionResponse>> { |
624 | let _p = profile("handle_code_action"); | 630 | let _p = profile("handle_code_action"); |
625 | let file_id = params.text_document.try_conv_with(&world)?; | 631 | let file_id = params.text_document.try_conv_with(&world)?; |
626 | let line_index = world.analysis().file_line_index(file_id); | 632 | let line_index = world.analysis().file_line_index(file_id)?; |
627 | let range = params.range.conv_with(&line_index); | 633 | let range = params.range.conv_with(&line_index); |
628 | 634 | ||
629 | let assists = world.analysis().assists(FileRange { file_id, range })?.into_iter(); | 635 | let assists = world.analysis().assists(FileRange { file_id, range })?.into_iter(); |
@@ -685,7 +691,7 @@ pub fn handle_code_lens( | |||
685 | params: req::CodeLensParams, | 691 | params: req::CodeLensParams, |
686 | ) -> Result<Option<Vec<CodeLens>>> { | 692 | ) -> Result<Option<Vec<CodeLens>>> { |
687 | let file_id = params.text_document.try_conv_with(&world)?; | 693 | let file_id = params.text_document.try_conv_with(&world)?; |
688 | let line_index = world.analysis().file_line_index(file_id); | 694 | let line_index = world.analysis().file_line_index(file_id)?; |
689 | 695 | ||
690 | let mut lenses: Vec<CodeLens> = Default::default(); | 696 | let mut lenses: Vec<CodeLens> = Default::default(); |
691 | let workspace_root = world.workspace_root_for(file_id); | 697 | let workspace_root = world.workspace_root_for(file_id); |
@@ -730,7 +736,7 @@ pub fn handle_code_lens( | |||
730 | lenses.extend( | 736 | lenses.extend( |
731 | world | 737 | world |
732 | .analysis() | 738 | .analysis() |
733 | .file_structure(file_id) | 739 | .file_structure(file_id)? |
734 | .into_iter() | 740 | .into_iter() |
735 | .filter(|it| match it.kind { | 741 | .filter(|it| match it.kind { |
736 | SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true, | 742 | SyntaxKind::TRAIT_DEF | SyntaxKind::STRUCT_DEF | SyntaxKind::ENUM_DEF => true, |
@@ -807,7 +813,7 @@ pub fn handle_document_highlight( | |||
807 | params: req::TextDocumentPositionParams, | 813 | params: req::TextDocumentPositionParams, |
808 | ) -> Result<Option<Vec<DocumentHighlight>>> { | 814 | ) -> Result<Option<Vec<DocumentHighlight>>> { |
809 | let file_id = params.text_document.try_conv_with(&world)?; | 815 | let file_id = params.text_document.try_conv_with(&world)?; |
810 | let line_index = world.analysis().file_line_index(file_id); | 816 | let line_index = world.analysis().file_line_index(file_id)?; |
811 | 817 | ||
812 | let refs = match world.analysis().find_all_refs(params.try_conv_with(&world)?)? { | 818 | let refs = match world.analysis().find_all_refs(params.try_conv_with(&world)?)? { |
813 | None => return Ok(None), | 819 | None => return Ok(None), |
@@ -826,7 +832,7 @@ pub fn publish_diagnostics( | |||
826 | file_id: FileId, | 832 | file_id: FileId, |
827 | ) -> Result<req::PublishDiagnosticsParams> { | 833 | ) -> Result<req::PublishDiagnosticsParams> { |
828 | let uri = world.file_id_to_uri(file_id)?; | 834 | let uri = world.file_id_to_uri(file_id)?; |
829 | let line_index = world.analysis().file_line_index(file_id); | 835 | let line_index = world.analysis().file_line_index(file_id)?; |
830 | let diagnostics = world | 836 | let diagnostics = world |
831 | .analysis() | 837 | .analysis() |
832 | .diagnostics(file_id)? | 838 | .diagnostics(file_id)? |
@@ -852,7 +858,7 @@ pub fn publish_decorations( | |||
852 | } | 858 | } |
853 | 859 | ||
854 | fn highlight(world: &WorldSnapshot, file_id: FileId) -> Result<Vec<Decoration>> { | 860 | fn highlight(world: &WorldSnapshot, file_id: FileId) -> Result<Vec<Decoration>> { |
855 | let line_index = world.analysis().file_line_index(file_id); | 861 | let line_index = world.analysis().file_line_index(file_id)?; |
856 | let res = world | 862 | let res = world |
857 | .analysis() | 863 | .analysis() |
858 | .highlight(file_id)? | 864 | .highlight(file_id)? |
@@ -881,7 +887,7 @@ pub fn handle_inlay_hints( | |||
881 | ) -> Result<Vec<InlayHint>> { | 887 | ) -> Result<Vec<InlayHint>> { |
882 | let file_id = params.text_document.try_conv_with(&world)?; | 888 | let file_id = params.text_document.try_conv_with(&world)?; |
883 | let analysis = world.analysis(); | 889 | let analysis = world.analysis(); |
884 | let line_index = analysis.file_line_index(file_id); | 890 | let line_index = analysis.file_line_index(file_id)?; |
885 | Ok(analysis | 891 | Ok(analysis |
886 | .inlay_hints(file_id)? | 892 | .inlay_hints(file_id)? |
887 | .into_iter() | 893 | .into_iter() |
@@ -891,6 +897,12 @@ pub fn handle_inlay_hints( | |||
891 | kind: match api_type.kind { | 897 | kind: match api_type.kind { |
892 | ra_ide_api::InlayKind::LetBindingType => InlayKind::LetBindingType, | 898 | ra_ide_api::InlayKind::LetBindingType => InlayKind::LetBindingType, |
893 | ra_ide_api::InlayKind::ClosureParameterType => InlayKind::ClosureParameterType, | 899 | ra_ide_api::InlayKind::ClosureParameterType => InlayKind::ClosureParameterType, |
900 | ra_ide_api::InlayKind::ForExpressionBindingType => { | ||
901 | InlayKind::ForExpressionBindingType | ||
902 | } | ||
903 | ra_ide_api::InlayKind::IfExpressionType => InlayKind::IfExpressionType, | ||
904 | ra_ide_api::InlayKind::WhileLetExpressionType => InlayKind::WhileLetExpressionType, | ||
905 | ra_ide_api::InlayKind::MatchArmType => InlayKind::MatchArmType, | ||
894 | }, | 906 | }, |
895 | }) | 907 | }) |
896 | .collect()) | 908 | .collect()) |
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 916185f99..570438643 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs | |||
@@ -215,6 +215,10 @@ pub struct InlayHintsParams { | |||
215 | pub enum InlayKind { | 215 | pub enum InlayKind { |
216 | LetBindingType, | 216 | LetBindingType, |
217 | ClosureParameterType, | 217 | ClosureParameterType, |
218 | ForExpressionBindingType, | ||
219 | IfExpressionType, | ||
220 | WhileLetExpressionType, | ||
221 | MatchArmType, | ||
218 | } | 222 | } |
219 | 223 | ||
220 | #[derive(Debug, Deserialize, Serialize)] | 224 | #[derive(Debug, Deserialize, Serialize)] |
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index 9fd654305..1d7755910 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs | |||
@@ -215,7 +215,12 @@ impl WorldSnapshot { | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | res.push_str("\nanalysis:\n"); | 217 | res.push_str("\nanalysis:\n"); |
218 | res.push_str(&self.analysis.status()); | 218 | res.push_str( |
219 | &self | ||
220 | .analysis | ||
221 | .status() | ||
222 | .unwrap_or_else(|_| "Analysis retrieval was cancelled".to_owned()), | ||
223 | ); | ||
219 | res | 224 | res |
220 | } | 225 | } |
221 | 226 | ||
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index 6bda04141..d98953a7e 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -43,6 +43,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = | |||
43 | L_BRACK, | 43 | L_BRACK, |
44 | PIPE, | 44 | PIPE, |
45 | MOVE_KW, | 45 | MOVE_KW, |
46 | BOX_KW, | ||
46 | IF_KW, | 47 | IF_KW, |
47 | WHILE_KW, | 48 | WHILE_KW, |
48 | MATCH_KW, | 49 | MATCH_KW, |
@@ -529,6 +530,8 @@ fn try_block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | |||
529 | // test box_expr | 530 | // test box_expr |
530 | // fn foo() { | 531 | // fn foo() { |
531 | // let x = box 1i32; | 532 | // let x = box 1i32; |
533 | // let y = (box 1i32, box 2i32); | ||
534 | // let z = Foo(box 1i32, box 2i32); | ||
532 | // } | 535 | // } |
533 | fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | 536 | fn box_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { |
534 | assert!(p.at(T![box])); | 537 | assert!(p.at(T![box])); |
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index 9ef8dee5d..40d63ef7a 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml | |||
@@ -10,8 +10,8 @@ repository = "https://github.com/rust-analyzer/rust-analyzer" | |||
10 | [dependencies] | 10 | [dependencies] |
11 | unicode-xid = "0.1.0" | 11 | unicode-xid = "0.1.0" |
12 | itertools = "0.8.0" | 12 | itertools = "0.8.0" |
13 | rowan = "0.6.0-pre.1" | 13 | rowan = "0.6.0" |
14 | ra_rustc_lexer = { version = "0.1.0-pre.1", features = [ "unicode-xid" ] } | 14 | ra_rustc_lexer = { version = "0.1.0-pre.2" } |
15 | 15 | ||
16 | # ideally, `serde` should be enabled by `ra_lsp_server`, but we enable it here | 16 | # ideally, `serde` should be enabled by `ra_lsp_server`, but we enable it here |
17 | # to reduce number of compilations | 17 | # to reduce number of compilations |
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 7f69b86e1..4c4e0580a 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -24,6 +24,8 @@ mod syntax_error; | |||
24 | mod parsing; | 24 | mod parsing; |
25 | mod validation; | 25 | mod validation; |
26 | mod ptr; | 26 | mod ptr; |
27 | #[cfg(test)] | ||
28 | mod tests; | ||
27 | 29 | ||
28 | pub mod algo; | 30 | pub mod algo; |
29 | pub mod ast; | 31 | pub mod ast; |
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/src/tests.rs index cabd3e9bd..fa5d2d5d8 100644 --- a/crates/ra_syntax/tests/test.rs +++ b/crates/ra_syntax/src/tests.rs | |||
@@ -1,19 +1,16 @@ | |||
1 | extern crate ra_syntax; | ||
2 | extern crate test_utils; | ||
3 | extern crate walkdir; | ||
4 | |||
5 | use std::{ | 1 | use std::{ |
6 | fmt::Write, | 2 | fmt::Write, |
7 | path::{Component, PathBuf}, | 3 | path::{Component, PathBuf}, |
8 | }; | 4 | }; |
9 | 5 | ||
10 | use ra_syntax::{fuzz, SourceFile}; | ||
11 | use test_utils::{collect_tests, dir_tests, project_dir, read_text}; | 6 | use test_utils::{collect_tests, dir_tests, project_dir, read_text}; |
12 | 7 | ||
8 | use crate::{fuzz, SourceFile}; | ||
9 | |||
13 | #[test] | 10 | #[test] |
14 | fn lexer_tests() { | 11 | fn lexer_tests() { |
15 | dir_tests(&test_data_dir(), &["lexer"], |text, _| { | 12 | dir_tests(&test_data_dir(), &["lexer"], |text, _| { |
16 | let tokens = ra_syntax::tokenize(text); | 13 | let tokens = crate::tokenize(text); |
17 | dump_tokens(&tokens, text) | 14 | dump_tokens(&tokens, text) |
18 | }) | 15 | }) |
19 | } | 16 | } |
@@ -25,7 +22,7 @@ fn parser_tests() { | |||
25 | let errors = parse.errors(); | 22 | let errors = parse.errors(); |
26 | assert_eq!( | 23 | assert_eq!( |
27 | errors, | 24 | errors, |
28 | &[] as &[ra_syntax::SyntaxError], | 25 | &[] as &[crate::SyntaxError], |
29 | "There should be no errors in the file {:?}", | 26 | "There should be no errors in the file {:?}", |
30 | path.display(), | 27 | path.display(), |
31 | ); | 28 | ); |
@@ -67,7 +64,7 @@ fn self_hosting_parsing() { | |||
67 | .filter_entry(|entry| { | 64 | .filter_entry(|entry| { |
68 | !entry.path().components().any(|component| { | 65 | !entry.path().components().any(|component| { |
69 | // Get all files which are not in the crates/ra_syntax/tests/data folder | 66 | // Get all files which are not in the crates/ra_syntax/tests/data folder |
70 | component == Component::Normal(OsStr::new("data")) | 67 | component == Component::Normal(OsStr::new("test_data")) |
71 | }) | 68 | }) |
72 | }) | 69 | }) |
73 | .map(|e| e.unwrap()) | 70 | .map(|e| e.unwrap()) |
@@ -87,10 +84,10 @@ fn self_hosting_parsing() { | |||
87 | } | 84 | } |
88 | 85 | ||
89 | fn test_data_dir() -> PathBuf { | 86 | fn test_data_dir() -> PathBuf { |
90 | project_dir().join("crates/ra_syntax/tests/data") | 87 | project_dir().join("crates/ra_syntax/test_data") |
91 | } | 88 | } |
92 | 89 | ||
93 | fn dump_tokens(tokens: &[ra_syntax::Token], text: &str) -> String { | 90 | fn dump_tokens(tokens: &[crate::Token], text: &str) -> String { |
94 | let mut acc = String::new(); | 91 | let mut acc = String::new(); |
95 | let mut offset = 0; | 92 | let mut offset = 0; |
96 | for token in tokens { | 93 | for token in tokens { |
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index e03c02d1b..1f904434e 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -1,16 +1,99 @@ | |||
1 | mod unescape; | ||
2 | |||
3 | mod block; | 1 | mod block; |
4 | mod field_expr; | 2 | mod field_expr; |
5 | 3 | ||
4 | use ra_rustc_lexer::unescape; | ||
5 | |||
6 | use crate::{ | 6 | use crate::{ |
7 | algo::visit::{visitor_ctx, VisitorCtx}, | 7 | algo::visit::{visitor_ctx, VisitorCtx}, |
8 | ast, SyntaxError, | 8 | ast, SyntaxError, SyntaxErrorKind, |
9 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, STRING}, | 9 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, STRING}, |
10 | SyntaxNode, TextUnit, T, | 10 | SyntaxNode, TextUnit, T, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | pub(crate) use unescape::EscapeError; | 13 | #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
14 | pub enum EscapeError { | ||
15 | ZeroChars, | ||
16 | MoreThanOneChar, | ||
17 | LoneSlash, | ||
18 | InvalidEscape, | ||
19 | BareCarriageReturn, | ||
20 | EscapeOnlyChar, | ||
21 | TooShortHexEscape, | ||
22 | InvalidCharInHexEscape, | ||
23 | OutOfRangeHexEscape, | ||
24 | NoBraceInUnicodeEscape, | ||
25 | InvalidCharInUnicodeEscape, | ||
26 | EmptyUnicodeEscape, | ||
27 | UnclosedUnicodeEscape, | ||
28 | LeadingUnderscoreUnicodeEscape, | ||
29 | OverlongUnicodeEscape, | ||
30 | LoneSurrogateUnicodeEscape, | ||
31 | OutOfRangeUnicodeEscape, | ||
32 | UnicodeEscapeInByte, | ||
33 | NonAsciiCharInByte, | ||
34 | } | ||
35 | |||
36 | impl From<ra_rustc_lexer::unescape::EscapeError> for EscapeError { | ||
37 | fn from(err: ra_rustc_lexer::unescape::EscapeError) -> Self { | ||
38 | match err { | ||
39 | ra_rustc_lexer::unescape::EscapeError::ZeroChars => EscapeError::ZeroChars, | ||
40 | ra_rustc_lexer::unescape::EscapeError::MoreThanOneChar => EscapeError::MoreThanOneChar, | ||
41 | ra_rustc_lexer::unescape::EscapeError::LoneSlash => EscapeError::LoneSlash, | ||
42 | ra_rustc_lexer::unescape::EscapeError::InvalidEscape => EscapeError::InvalidEscape, | ||
43 | ra_rustc_lexer::unescape::EscapeError::BareCarriageReturn | ||
44 | | ra_rustc_lexer::unescape::EscapeError::BareCarriageReturnInRawString => { | ||
45 | EscapeError::BareCarriageReturn | ||
46 | } | ||
47 | ra_rustc_lexer::unescape::EscapeError::EscapeOnlyChar => EscapeError::EscapeOnlyChar, | ||
48 | ra_rustc_lexer::unescape::EscapeError::TooShortHexEscape => { | ||
49 | EscapeError::TooShortHexEscape | ||
50 | } | ||
51 | ra_rustc_lexer::unescape::EscapeError::InvalidCharInHexEscape => { | ||
52 | EscapeError::InvalidCharInHexEscape | ||
53 | } | ||
54 | ra_rustc_lexer::unescape::EscapeError::OutOfRangeHexEscape => { | ||
55 | EscapeError::OutOfRangeHexEscape | ||
56 | } | ||
57 | ra_rustc_lexer::unescape::EscapeError::NoBraceInUnicodeEscape => { | ||
58 | EscapeError::NoBraceInUnicodeEscape | ||
59 | } | ||
60 | ra_rustc_lexer::unescape::EscapeError::InvalidCharInUnicodeEscape => { | ||
61 | EscapeError::InvalidCharInUnicodeEscape | ||
62 | } | ||
63 | ra_rustc_lexer::unescape::EscapeError::EmptyUnicodeEscape => { | ||
64 | EscapeError::EmptyUnicodeEscape | ||
65 | } | ||
66 | ra_rustc_lexer::unescape::EscapeError::UnclosedUnicodeEscape => { | ||
67 | EscapeError::UnclosedUnicodeEscape | ||
68 | } | ||
69 | ra_rustc_lexer::unescape::EscapeError::LeadingUnderscoreUnicodeEscape => { | ||
70 | EscapeError::LeadingUnderscoreUnicodeEscape | ||
71 | } | ||
72 | ra_rustc_lexer::unescape::EscapeError::OverlongUnicodeEscape => { | ||
73 | EscapeError::OverlongUnicodeEscape | ||
74 | } | ||
75 | ra_rustc_lexer::unescape::EscapeError::LoneSurrogateUnicodeEscape => { | ||
76 | EscapeError::LoneSurrogateUnicodeEscape | ||
77 | } | ||
78 | ra_rustc_lexer::unescape::EscapeError::OutOfRangeUnicodeEscape => { | ||
79 | EscapeError::OutOfRangeUnicodeEscape | ||
80 | } | ||
81 | ra_rustc_lexer::unescape::EscapeError::UnicodeEscapeInByte => { | ||
82 | EscapeError::UnicodeEscapeInByte | ||
83 | } | ||
84 | ra_rustc_lexer::unescape::EscapeError::NonAsciiCharInByte | ||
85 | | ra_rustc_lexer::unescape::EscapeError::NonAsciiCharInByteString => { | ||
86 | EscapeError::NonAsciiCharInByte | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | |||
92 | impl From<ra_rustc_lexer::unescape::EscapeError> for SyntaxErrorKind { | ||
93 | fn from(err: ra_rustc_lexer::unescape::EscapeError) -> Self { | ||
94 | SyntaxErrorKind::EscapeError(err.into()) | ||
95 | } | ||
96 | } | ||
14 | 97 | ||
15 | pub(crate) fn validate(root: &SyntaxNode) -> Vec<SyntaxError> { | 98 | pub(crate) fn validate(root: &SyntaxNode) -> Vec<SyntaxError> { |
16 | let mut errors = Vec::new(); | 99 | let mut errors = Vec::new(); |
diff --git a/crates/ra_syntax/src/validation/unescape.rs b/crates/ra_syntax/src/validation/unescape.rs deleted file mode 100644 index 7eed6c663..000000000 --- a/crates/ra_syntax/src/validation/unescape.rs +++ /dev/null | |||
@@ -1,521 +0,0 @@ | |||
1 | //! Utilities for validating string and char literals and turning them into | ||
2 | //! values they represent. | ||
3 | //! | ||
4 | //! This file is copy-pasted from the compiler | ||
5 | //! | ||
6 | //! https://github.com/rust-lang/rust/blob/c6ac57564852cb6e2d0db60f7b46d9eb98d4b449/src/libsyntax/parse/unescape.rs | ||
7 | //! | ||
8 | //! Hopefully, we'll share this code in a proper way some day | ||
9 | |||
10 | use std::ops::Range; | ||
11 | use std::str::Chars; | ||
12 | |||
13 | #[derive(Debug, PartialEq, Eq, Clone, Hash)] | ||
14 | pub enum EscapeError { | ||
15 | ZeroChars, | ||
16 | MoreThanOneChar, | ||
17 | |||
18 | LoneSlash, | ||
19 | InvalidEscape, | ||
20 | BareCarriageReturn, | ||
21 | EscapeOnlyChar, | ||
22 | |||
23 | TooShortHexEscape, | ||
24 | InvalidCharInHexEscape, | ||
25 | OutOfRangeHexEscape, | ||
26 | |||
27 | NoBraceInUnicodeEscape, | ||
28 | InvalidCharInUnicodeEscape, | ||
29 | EmptyUnicodeEscape, | ||
30 | UnclosedUnicodeEscape, | ||
31 | LeadingUnderscoreUnicodeEscape, | ||
32 | OverlongUnicodeEscape, | ||
33 | LoneSurrogateUnicodeEscape, | ||
34 | OutOfRangeUnicodeEscape, | ||
35 | |||
36 | UnicodeEscapeInByte, | ||
37 | NonAsciiCharInByte, | ||
38 | } | ||
39 | |||
40 | /// Takes a contents of a char literal (without quotes), and returns an | ||
41 | /// unescaped char or an error | ||
42 | pub(crate) fn unescape_char(literal_text: &str) -> Result<char, (usize, EscapeError)> { | ||
43 | let mut chars = literal_text.chars(); | ||
44 | unescape_char_or_byte(&mut chars, Mode::Char) | ||
45 | .map_err(|err| (literal_text.len() - chars.as_str().len(), err)) | ||
46 | } | ||
47 | |||
48 | /// Takes a contents of a string literal (without quotes) and produces a | ||
49 | /// sequence of escaped characters or errors. | ||
50 | pub(crate) fn unescape_str<F>(literal_text: &str, callback: &mut F) | ||
51 | where | ||
52 | F: FnMut(Range<usize>, Result<char, EscapeError>), | ||
53 | { | ||
54 | unescape_str_or_byte_str(literal_text, Mode::Str, callback) | ||
55 | } | ||
56 | |||
57 | pub(crate) fn unescape_byte(literal_text: &str) -> Result<u8, (usize, EscapeError)> { | ||
58 | let mut chars = literal_text.chars(); | ||
59 | unescape_char_or_byte(&mut chars, Mode::Byte) | ||
60 | .map(byte_from_char) | ||
61 | .map_err(|err| (literal_text.len() - chars.as_str().len(), err)) | ||
62 | } | ||
63 | |||
64 | /// Takes a contents of a string literal (without quotes) and produces a | ||
65 | /// sequence of escaped characters or errors. | ||
66 | pub(crate) fn unescape_byte_str<F>(literal_text: &str, callback: &mut F) | ||
67 | where | ||
68 | F: FnMut(Range<usize>, Result<u8, EscapeError>), | ||
69 | { | ||
70 | unescape_str_or_byte_str(literal_text, Mode::ByteStr, &mut |range, char| { | ||
71 | callback(range, char.map(byte_from_char)) | ||
72 | }) | ||
73 | } | ||
74 | |||
75 | #[derive(Debug, Clone, Copy)] | ||
76 | pub(crate) enum Mode { | ||
77 | Char, | ||
78 | Str, | ||
79 | Byte, | ||
80 | ByteStr, | ||
81 | } | ||
82 | |||
83 | impl Mode { | ||
84 | fn in_single_quotes(self) -> bool { | ||
85 | match self { | ||
86 | Mode::Char | Mode::Byte => true, | ||
87 | Mode::Str | Mode::ByteStr => false, | ||
88 | } | ||
89 | } | ||
90 | |||
91 | pub(crate) fn in_double_quotes(self) -> bool { | ||
92 | !self.in_single_quotes() | ||
93 | } | ||
94 | |||
95 | pub(crate) fn is_bytes(self) -> bool { | ||
96 | match self { | ||
97 | Mode::Byte | Mode::ByteStr => true, | ||
98 | Mode::Char | Mode::Str => false, | ||
99 | } | ||
100 | } | ||
101 | } | ||
102 | |||
103 | fn scan_escape(first_char: char, chars: &mut Chars<'_>, mode: Mode) -> Result<char, EscapeError> { | ||
104 | if first_char != '\\' { | ||
105 | return match first_char { | ||
106 | '\t' | '\n' => Err(EscapeError::EscapeOnlyChar), | ||
107 | '\r' => Err(if chars.clone().next() == Some('\n') { | ||
108 | EscapeError::EscapeOnlyChar | ||
109 | } else { | ||
110 | EscapeError::BareCarriageReturn | ||
111 | }), | ||
112 | '\'' if mode.in_single_quotes() => Err(EscapeError::EscapeOnlyChar), | ||
113 | '"' if mode.in_double_quotes() => Err(EscapeError::EscapeOnlyChar), | ||
114 | _ => { | ||
115 | if mode.is_bytes() && !first_char.is_ascii() { | ||
116 | return Err(EscapeError::NonAsciiCharInByte); | ||
117 | } | ||
118 | Ok(first_char) | ||
119 | } | ||
120 | }; | ||
121 | } | ||
122 | |||
123 | let second_char = chars.next().ok_or(EscapeError::LoneSlash)?; | ||
124 | |||
125 | let res = match second_char { | ||
126 | '"' => '"', | ||
127 | 'n' => '\n', | ||
128 | 'r' => '\r', | ||
129 | 't' => '\t', | ||
130 | '\\' => '\\', | ||
131 | '\'' => '\'', | ||
132 | '0' => '\0', | ||
133 | |||
134 | 'x' => { | ||
135 | let hi = chars.next().ok_or(EscapeError::TooShortHexEscape)?; | ||
136 | let hi = hi.to_digit(16).ok_or(EscapeError::InvalidCharInHexEscape)?; | ||
137 | |||
138 | let lo = chars.next().ok_or(EscapeError::TooShortHexEscape)?; | ||
139 | let lo = lo.to_digit(16).ok_or(EscapeError::InvalidCharInHexEscape)?; | ||
140 | |||
141 | let value = hi * 16 + lo; | ||
142 | |||
143 | if !mode.is_bytes() && !is_ascii(value) { | ||
144 | return Err(EscapeError::OutOfRangeHexEscape); | ||
145 | } | ||
146 | let value = value as u8; | ||
147 | |||
148 | value as char | ||
149 | } | ||
150 | |||
151 | 'u' => { | ||
152 | if chars.next() != Some('{') { | ||
153 | return Err(EscapeError::NoBraceInUnicodeEscape); | ||
154 | } | ||
155 | |||
156 | let mut n_digits = 1; | ||
157 | let mut value: u32 = match chars.next().ok_or(EscapeError::UnclosedUnicodeEscape)? { | ||
158 | '_' => return Err(EscapeError::LeadingUnderscoreUnicodeEscape), | ||
159 | '}' => return Err(EscapeError::EmptyUnicodeEscape), | ||
160 | c => c.to_digit(16).ok_or(EscapeError::InvalidCharInUnicodeEscape)?, | ||
161 | }; | ||
162 | |||
163 | loop { | ||
164 | match chars.next() { | ||
165 | None => return Err(EscapeError::UnclosedUnicodeEscape), | ||
166 | Some('_') => continue, | ||
167 | Some('}') => { | ||
168 | if n_digits > 6 { | ||
169 | return Err(EscapeError::OverlongUnicodeEscape); | ||
170 | } | ||
171 | if mode.is_bytes() { | ||
172 | return Err(EscapeError::UnicodeEscapeInByte); | ||
173 | } | ||
174 | |||
175 | break std::char::from_u32(value).ok_or_else(|| { | ||
176 | if value > 0x0010_FFFF { | ||
177 | EscapeError::OutOfRangeUnicodeEscape | ||
178 | } else { | ||
179 | EscapeError::LoneSurrogateUnicodeEscape | ||
180 | } | ||
181 | })?; | ||
182 | } | ||
183 | Some(c) => { | ||
184 | let digit = | ||
185 | c.to_digit(16).ok_or(EscapeError::InvalidCharInUnicodeEscape)?; | ||
186 | n_digits += 1; | ||
187 | if n_digits > 6 { | ||
188 | continue; | ||
189 | } | ||
190 | let digit = digit as u32; | ||
191 | value = value * 16 + digit; | ||
192 | } | ||
193 | }; | ||
194 | } | ||
195 | } | ||
196 | _ => return Err(EscapeError::InvalidEscape), | ||
197 | }; | ||
198 | Ok(res) | ||
199 | } | ||
200 | |||
201 | fn unescape_char_or_byte(chars: &mut Chars<'_>, mode: Mode) -> Result<char, EscapeError> { | ||
202 | let first_char = chars.next().ok_or(EscapeError::ZeroChars)?; | ||
203 | let res = scan_escape(first_char, chars, mode)?; | ||
204 | if chars.next().is_some() { | ||
205 | return Err(EscapeError::MoreThanOneChar); | ||
206 | } | ||
207 | Ok(res) | ||
208 | } | ||
209 | |||
210 | /// Takes a contents of a string literal (without quotes) and produces a | ||
211 | /// sequence of escaped characters or errors. | ||
212 | fn unescape_str_or_byte_str<F>(src: &str, mode: Mode, callback: &mut F) | ||
213 | where | ||
214 | F: FnMut(Range<usize>, Result<char, EscapeError>), | ||
215 | { | ||
216 | assert!(mode.in_double_quotes()); | ||
217 | let initial_len = src.len(); | ||
218 | let mut chars = src.chars(); | ||
219 | while let Some(first_char) = chars.next() { | ||
220 | let start = initial_len - chars.as_str().len() - first_char.len_utf8(); | ||
221 | |||
222 | let unescaped_char = match first_char { | ||
223 | '\\' => { | ||
224 | let (second_char, third_char) = { | ||
225 | let mut chars = chars.clone(); | ||
226 | (chars.next(), chars.next()) | ||
227 | }; | ||
228 | match (second_char, third_char) { | ||
229 | (Some('\n'), _) | (Some('\r'), Some('\n')) => { | ||
230 | skip_ascii_whitespace(&mut chars); | ||
231 | continue; | ||
232 | } | ||
233 | _ => scan_escape(first_char, &mut chars, mode), | ||
234 | } | ||
235 | } | ||
236 | '\r' => { | ||
237 | let second_char = chars.clone().next(); | ||
238 | if second_char == Some('\n') { | ||
239 | chars.next(); | ||
240 | Ok('\n') | ||
241 | } else { | ||
242 | scan_escape(first_char, &mut chars, mode) | ||
243 | } | ||
244 | } | ||
245 | '\n' => Ok('\n'), | ||
246 | '\t' => Ok('\t'), | ||
247 | _ => scan_escape(first_char, &mut chars, mode), | ||
248 | }; | ||
249 | let end = initial_len - chars.as_str().len(); | ||
250 | callback(start..end, unescaped_char); | ||
251 | } | ||
252 | |||
253 | fn skip_ascii_whitespace(chars: &mut Chars<'_>) { | ||
254 | let str = chars.as_str(); | ||
255 | let first_non_space = str | ||
256 | .bytes() | ||
257 | .position(|b| b != b' ' && b != b'\t' && b != b'\n' && b != b'\r') | ||
258 | .unwrap_or_else(|| str.len()); | ||
259 | *chars = str[first_non_space..].chars() | ||
260 | } | ||
261 | } | ||
262 | |||
263 | fn byte_from_char(c: char) -> u8 { | ||
264 | let res = c as u32; | ||
265 | assert!(res <= u32::from(u8::max_value()), "guaranteed because of Mode::Byte"); | ||
266 | res as u8 | ||
267 | } | ||
268 | |||
269 | fn is_ascii(x: u32) -> bool { | ||
270 | x <= 0x7F | ||
271 | } | ||
272 | |||
273 | #[cfg(test)] | ||
274 | mod tests { | ||
275 | use super::*; | ||
276 | |||
277 | #[test] | ||
278 | fn test_unescape_char_bad() { | ||
279 | fn check(literal_text: &str, expected_error: EscapeError) { | ||
280 | let actual_result = unescape_char(literal_text).map_err(|(_offset, err)| err); | ||
281 | assert_eq!(actual_result, Err(expected_error)); | ||
282 | } | ||
283 | |||
284 | check("", EscapeError::ZeroChars); | ||
285 | check(r"\", EscapeError::LoneSlash); | ||
286 | |||
287 | check("\n", EscapeError::EscapeOnlyChar); | ||
288 | check("\r\n", EscapeError::EscapeOnlyChar); | ||
289 | check("\t", EscapeError::EscapeOnlyChar); | ||
290 | check("'", EscapeError::EscapeOnlyChar); | ||
291 | check("\r", EscapeError::BareCarriageReturn); | ||
292 | |||
293 | check("spam", EscapeError::MoreThanOneChar); | ||
294 | check(r"\x0ff", EscapeError::MoreThanOneChar); | ||
295 | check(r#"\"a"#, EscapeError::MoreThanOneChar); | ||
296 | check(r"\na", EscapeError::MoreThanOneChar); | ||
297 | check(r"\ra", EscapeError::MoreThanOneChar); | ||
298 | check(r"\ta", EscapeError::MoreThanOneChar); | ||
299 | check(r"\\a", EscapeError::MoreThanOneChar); | ||
300 | check(r"\'a", EscapeError::MoreThanOneChar); | ||
301 | check(r"\0a", EscapeError::MoreThanOneChar); | ||
302 | check(r"\u{0}x", EscapeError::MoreThanOneChar); | ||
303 | check(r"\u{1F63b}}", EscapeError::MoreThanOneChar); | ||
304 | |||
305 | check(r"\v", EscapeError::InvalidEscape); | ||
306 | check(r"\💩", EscapeError::InvalidEscape); | ||
307 | check(r"\●", EscapeError::InvalidEscape); | ||
308 | |||
309 | check(r"\x", EscapeError::TooShortHexEscape); | ||
310 | check(r"\x0", EscapeError::TooShortHexEscape); | ||
311 | check(r"\xf", EscapeError::TooShortHexEscape); | ||
312 | check(r"\xa", EscapeError::TooShortHexEscape); | ||
313 | check(r"\xx", EscapeError::InvalidCharInHexEscape); | ||
314 | check(r"\xы", EscapeError::InvalidCharInHexEscape); | ||
315 | check(r"\x🦀", EscapeError::InvalidCharInHexEscape); | ||
316 | check(r"\xtt", EscapeError::InvalidCharInHexEscape); | ||
317 | check(r"\xff", EscapeError::OutOfRangeHexEscape); | ||
318 | check(r"\xFF", EscapeError::OutOfRangeHexEscape); | ||
319 | check(r"\x80", EscapeError::OutOfRangeHexEscape); | ||
320 | |||
321 | check(r"\u", EscapeError::NoBraceInUnicodeEscape); | ||
322 | check(r"\u[0123]", EscapeError::NoBraceInUnicodeEscape); | ||
323 | check(r"\u{0x}", EscapeError::InvalidCharInUnicodeEscape); | ||
324 | check(r"\u{", EscapeError::UnclosedUnicodeEscape); | ||
325 | check(r"\u{0000", EscapeError::UnclosedUnicodeEscape); | ||
326 | check(r"\u{}", EscapeError::EmptyUnicodeEscape); | ||
327 | check(r"\u{_0000}", EscapeError::LeadingUnderscoreUnicodeEscape); | ||
328 | check(r"\u{0000000}", EscapeError::OverlongUnicodeEscape); | ||
329 | check(r"\u{FFFFFF}", EscapeError::OutOfRangeUnicodeEscape); | ||
330 | check(r"\u{ffffff}", EscapeError::OutOfRangeUnicodeEscape); | ||
331 | check(r"\u{ffffff}", EscapeError::OutOfRangeUnicodeEscape); | ||
332 | |||
333 | check(r"\u{DC00}", EscapeError::LoneSurrogateUnicodeEscape); | ||
334 | check(r"\u{DDDD}", EscapeError::LoneSurrogateUnicodeEscape); | ||
335 | check(r"\u{DFFF}", EscapeError::LoneSurrogateUnicodeEscape); | ||
336 | |||
337 | check(r"\u{D800}", EscapeError::LoneSurrogateUnicodeEscape); | ||
338 | check(r"\u{DAAA}", EscapeError::LoneSurrogateUnicodeEscape); | ||
339 | check(r"\u{DBFF}", EscapeError::LoneSurrogateUnicodeEscape); | ||
340 | } | ||
341 | |||
342 | #[test] | ||
343 | fn test_unescape_char_good() { | ||
344 | fn check(literal_text: &str, expected_char: char) { | ||
345 | let actual_result = unescape_char(literal_text); | ||
346 | assert_eq!(actual_result, Ok(expected_char)); | ||
347 | } | ||
348 | |||
349 | check("a", 'a'); | ||
350 | check("ы", 'ы'); | ||
351 | check("🦀", '🦀'); | ||
352 | |||
353 | check(r#"\""#, '"');< |