Commit Graph
30 Commits
Author SHA1 Message Date
Mayfield 4785520d99 Support newline and tab literals in regex search-and-replace operations (#9609)
Closes #7645

Release Notes:

- Added support for inserting newlines (`\n`) and tabs (`\t`) in editor
Regex search replacements
([#7645](https://github.com/zed-industries/zed/issues/7645)).
2024-03-25 12:21:04 +01:00
Thorsten Ball c015baa638 Do not start searching if query is empty (#9333)
This avoids the problem of a search being kicked off involuntarily and
potentially using a large amount of CPU when toggling on the `Search
Ignored Files` option.

What would happen is that someone would turn the option on, we'd kick
off a search, and go through all of the files in, say, `node_modules`.
Even if no query was given.

This avoids that.

Release Notes:

- Fixed an empty search being kicked off involuntarily if no query was
typed in yet but an option was toggled.
2024-03-14 15:06:00 +01:00
Kirill Bulatov 92fbdb429c Add project search in gitignored test 2023-12-05 12:45:44 +02:00
Kirill Bulatov b43dc480a9 Integration tests for excluded files 2023-12-05 12:45:44 +02:00
Kirill Bulatov 2c2c14a360 Fix the regex matcher 2023-12-05 12:45:36 +02:00
Kirill Bulatov a5c615ceb4 Pass a new query parameter into the search 2023-11-17 21:40:56 +02:00
Kirill Bulatov 6bbb79a9f5 Rework prettier installation and start 2023-11-03 11:02:50 +02:00
Kirill Bulatov d673efebd2 Add prettier workspace resolution test 2023-11-03 11:02:50 +02:00
Piotr Osiewicz dbfa1d7263 [WIP] Replace in project (#2984)
Targeting Preview of 09.27.
This is still pending several touchups/clearups:
- We should watch multibuffer for changes and rescan the excerpts. This
should also update match count.
- Closing editor while multibuffer with 100's of changed files is open
leads to us prompting for save once per each file in the multibuffer.
One could in theory save in multibuffer before closing it (thus avoiding
unnecessary prompts), but it'd be cool to be able to "Save all"/"Discard
All".

Release Notes:

- Added "Replace in project" functionality
2023-09-21 16:27:58 +02:00
Conrad Irwin 2da664ed17 vim fixes for find&replace
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext
2023-09-19 20:48:01 -06:00
Piotr Osiewicz 616d328f3c chore: Use aho-corasick 1.1 in direct dependencies (#2983)
Nothing too fancy, we've depended indirectly on 1.0/1.1 already, so this
is essentially bookkeeping.

Release Notes:
- N/A
2023-09-18 17:01:08 +02:00
Piotr Osiewicz 4cb8647702 Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Julia ff3865a4ad Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
JuliaandMax Brunsfeld fc457d45f5 Add word_characters to language overrides & use for more things
Use word_characters to feed completion trigger characters as well and
also recognize kebab as a potential sub-word splitter. This is fine for
non-kebab-case languages because we'd only ever attempt to split a word
with a kebab in it in language scopes which are kebab-cased

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-08-25 18:46:30 -04:00
Piotr OsiewiczandJulia Risley 007d1b09ac Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 12:23:30 +03:00
Piotr OsiewiczandJulia Risley d27cebd977 Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 10:35:20 +02:00
KCaverlyandPiotr aeda5d9842 fix semantic search panic which is created via incompatible build_search_query path
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 15:50:54 +01:00
Kirill Bulatov cf6e524c9a Make project search includes and excludes more user-friendly
Allow search results that start with the include/exclude path part
2023-07-28 12:56:44 +03:00
Max Brunsfeld 459cc9c959 Optimize matching of multiple file-watch globs using the globset crate 2023-05-19 09:13:34 -07:00
Kirill Bulatov 6fb8679184 Trim glob input 2023-05-10 11:11:31 +03:00
Kirill Bulatov b5abac6af6 Draft search include/exclude logic 2023-05-10 11:11:31 +03:00
Kirill Bulatov 915154b047 Add initial include/exclude project search UI 2023-05-10 11:11:31 +03:00
ForLoveOfCatsandMikayla 8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Nathan Sobo dd6f8d20a3 Remove carriage returns 2022-02-27 07:47:46 -07:00
Nathan SoboandMax Brunsfeld e822c6a64e Handle project-wide search on guests
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 15:09:47 -07:00
Antonio Scandurra 88bfe5acb0 Allow splitting project find and maintain the searches in sync 2022-02-25 16:20:02 +01:00
Antonio Scandurra 6a0cca7178 Add a fast path for when the search query is empty 2022-02-25 10:58:45 +01:00
Antonio Scandurra 0bf944e038 Use Project::search in ProjectFind and show search results 2022-02-25 10:32:45 +01:00
6d9b003634 WIP: Start sketching in ProjectFindView
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-24 19:07:00 +01:00
Antonio Scandurra e83d1fc9fc Start on a regex implementation of SearchQuery 2022-02-24 16:33:31 +01:00