Skip to content

Add filters to Find in Files, to ignore Code, Strings, or Comments for find/replace#100839

Open
Wierdox wants to merge 1 commit intogodotengine:masterfrom
Wierdox:add_three_new_filters_to_find_and_replace
Open

Add filters to Find in Files, to ignore Code, Strings, or Comments for find/replace#100839
Wierdox wants to merge 1 commit intogodotengine:masterfrom
Wierdox:add_three_new_filters_to_find_and_replace

Conversation

@Wierdox
Copy link
Copy Markdown
Contributor

@Wierdox Wierdox commented Dec 27, 2024

Partially supersedes #67796
Partially addresses Proposal #563

PR: For Find in Files, add filters to include/exclude Code, Strings, or Comments from your search results.

See it in action:

godot.windows.editor.x86_64_B5vbC8DonX.webm

Notes:

  • Multiline string/comment aware, including mid line usage like func pie(/*old_param,*/ new_param);.
  • "Language Agnostic".
    • Right now it either chooses gdscript # or c style // /**/, which as far as I'm aware are the only other languages(gdshader, csharp) supported in the editor. Maybe we could expose an option so users can add delimiters.
  • Should not affect search speed if you leave everything enabled, implementation wise it's opt-in ignores.
  • Find and Replace for Code Editor toolbar is not affected in this PR, it could be added in a follow up PR.
    • This is primarily due to the Code Editor using TextEdit to handle and draw the search highlights, which we can't do much about unless we copy pasta a lot of code or add coding related flags to TextEdit::SearchFlags. The latter of which was said to be avoided in the superseded PR.
  • Uses the phrase "Inside:" on its own line. You could also put them alongside "Match Case" and "Whole Words", but it causes the prompt to widen in a way that makes it more ugly I think.
  • Strings filter is just a bonus while I was working on it, it could be removed if it's seen as not very useful. I for one don't have a use for it, but I saw a comment on the superseded PR bring it up.

@Wierdox Wierdox requested a review from a team as a code owner December 27, 2024 03:28
@Wierdox Wierdox changed the title Add filters to Find in Files, to ignore Code, Strings, and Comments for find/replace Add filters to Find in Files, to ignore Code, Strings, or Comments for find/replace Dec 27, 2024
@Chaosus Chaosus added this to the 4.x milestone Dec 27, 2024
@Wierdox
Copy link
Copy Markdown
Contributor Author

Wierdox commented Dec 27, 2024

Related to #75607, which replaces a bunch of internal functions, adds a file-extension-aware scanner, and allows .tscn files to be scanned for built-in scripts by default.

@Wierdox Wierdox force-pushed the add_three_new_filters_to_find_and_replace branch from f1c221c to b0ac40b Compare December 31, 2024 03:12
@Wierdox Wierdox force-pushed the add_three_new_filters_to_find_and_replace branch 2 times, most recently from 44e6b2d to 7bbd19b Compare March 10, 2025 07:14
@Wierdox Wierdox force-pushed the add_three_new_filters_to_find_and_replace branch from 7bbd19b to d453574 Compare April 15, 2025 08:53
@Wierdox Wierdox force-pushed the add_three_new_filters_to_find_and_replace branch from d453574 to 457de5b Compare April 17, 2025 21:08
@Repiteo Repiteo requested a review from a team as a code owner February 17, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants