rust/src/tools
bors a187a8992d Auto merge of #17542 - roife:fix-issue-17517, r=Veykril
feat: go-to-def and find-references on control-flow keywords

fix #17517.

This PR implements **go-to-definition** and **find-references** functionalities for control flow keywords, which is similar to the behaviors in the `highlight-related` module. Besides, this PR also fixes some incorrect behaviors in `highlight-related`.

## Changes

1. **Support for go-to-definition on control flow keywords**:
   This PR introduces functionality allowing users to navigate on the definition of control flow keywords (`return`, `break`, `continue`).
   Commit: 2a3244ee147f898dd828c06352645ae1713c260f..7391e7a608634709db002a4cb09229de4d12c056.

2. **Bug fixes and refactoring in highlight-related**:
   - **Handling return/break/continue within try_blocks**:
     This PR adjusted the behavior of these keywords when they occur within `try_blocks`. When encounter these keywords, the program should exit the outer function or loop which containing the `try_blocks`, rather than the `try_blocks` itself; while the `?` will cause the program to exit `try_blocks`.
     Commit: 59d697e807f0197f59814b37dca1563959da4aa1.
   - **Support highlighting keywords in macro expansion for highlight-related**:
     Commit: 88df24f01727c23a667a763ee3ee0cec22d5ad52.
   - Detailed description for the bug fixes
     + The previous implementation of `preorder_expr` incorrectly treated `try_blocks` as new contexts, thereby r-a will not continue to traverse inner `return` and `break/continue` statements. To resolve this, a new function `preorder_expr_with_ctx_checker` has been added, allowing users to specify which expressions to skip.
       * For example, when searching for the `?` in the context, r-a should skip `try_blocks` where the `?` insides just works for `try_blocks`. But when search for the `return` keyword, r-a should collect both the `return` keywords inside and outside the `try_blocks`
     + Thus, this PR added `WalkExpandedExprCtx` (builder pattern). It offers the following improvements: customizable context skipping, maintenance of loop depth (for `break`/`continue`), and handling macro expansion during traversal.

3. **Support for find-references on control flow keywords**:
   This PR enables users to find all references to control flow keywords.
   Commit: 9202a33f81218fb9c2edb5d42e6b4de85b0323a8.
2024-07-22 09:22:13 +00:00
..
build-manifest Rollup merge of #126298 - heiher:loongarch64-musl-ci, r=Mark-Simulacrum 2024-06-24 06:27:13 +02:00
build_helper Move force_coloring_in_ci from builder_helper to bootstrap 2024-07-15 20:07:57 +02:00
bump-stage0 move comments position in src/stage0 2024-05-11 20:49:01 +03:00
cargo@154fdac39a Update cargo 2024-07-07 10:21:28 -04:00
cargotest
clippy Fix trivial gen ident usage in tools 2024-07-14 14:52:36 -04:00
collect-license-metadata
compiletest compiletest: Better error message for bad normalize-* headers 2024-07-11 21:51:20 +10:00
coverage-dump Add an alternate --demangle mode to coverage-dump 2024-05-31 21:52:45 +10:00
error_index_generator
generate-copyright
generate-windows-sys Update windows-bindgen to 0.58.0 2024-07-04 12:18:38 +00:00
html-checker rustdoc: allow custom element rustdoc-search 2024-05-06 21:50:27 -07:00
jsondocck Rollup merge of #127309 - its-the-shrimp:jsondocck_add_file_var, r=aDotInTheVoid 2024-07-04 18:16:25 +02:00
jsondoclint Add rustdoc-json support for use<> 2024-07-12 05:24:51 -04:00
libcxx-version skip src/tools/libcxx-version from tidy 2024-06-06 07:01:37 +03:00
linkchecker add new_range_api for RFC 3550 2024-07-05 16:33:58 -06:00
lint-docs use "bootstrap" instead of "rustbuild" in comments and docs 2024-07-07 00:07:08 +03:00
lld-wrapper Fix typos (taking into account review comments) 2024-05-18 18:12:18 +02:00
llvm-bitcode-linker
miri Rollup merge of #124921 - RalfJung:offset-from-same-addr, r=oli-obk 2024-07-15 21:11:47 +02:00
miropt-test-tools
opt-dist opt-dist: apply considerable clippy suggestions 2024-06-13 18:41:49 +03:00
remote-test-client Give remote-test-client a longer timeout 2024-07-02 10:09:40 -07:00
remote-test-server remote-test-server: apply considerable clippy suggestions 2024-06-13 18:41:43 +03:00
replace-version-placeholder
rls
run-make-support Auto merge of #127450 - Kobzol:bootstrap-cmd-refactor-5, r=onur-ozkan 2024-07-13 09:44:05 +00:00
rust-analyzer Auto merge of #17542 - roife:fix-issue-17517, r=Veykril 2024-07-22 09:22:13 +00:00
rust-installer use "bootstrap" instead of "rustbuild" in comments and docs 2024-07-07 00:07:08 +03:00
rustbook Add translation support by mdbook-i18n-helpers to bootstrap 2024-06-03 16:48:27 +09:00
rustc-perf@c64bb60dd1 Update rustc-perf submodule 2024-06-12 11:45:52 +02:00
rustc-perf-wrapper Review changes 2024-06-29 16:07:22 +02:00
rustdoc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustdoc-gui Other EcmaScript version bump 2024-06-07 08:44:52 +08:00
rustdoc-gui-test compiletest: Allow multiple //@ run-flags: headers 2024-06-07 01:51:57 +10:00
rustdoc-js Other EcmaScript version bump 2024-06-07 08:44:52 +08:00
rustdoc-themes
rustfmt Implement RTN support in rustfmt 2024-06-28 14:20:44 -04:00
suggest-tests Remove direct dependencies on lazy_static, once_cell and byteorder 2024-04-28 14:35:00 +01:00
tidy Rollup merge of #127381 - Oneirical:testalt-consciousness, r=jieyouxu 2024-07-12 13:47:08 -07:00
tier-check
unicode-table-generator Add a lower bound check to unicode-table-generator output 2024-04-20 10:16:45 +02:00
unstable-book-gen
x
cherry-pick.sh
publish_toolstate.py CI: fix toolstate publishing 2024-05-15 15:48:52 +02:00