Commit graph

633 commits

Author SHA1 Message Date
Max Brunsfeld
ff85bc6d42 Add setting for removing trailing whitespace on save 2023-02-28 21:52:00 -08:00
Max Brunsfeld
b00e467ede Add APIs for stripping trailing whitespace from a buffer 2023-02-28 21:52:00 -08:00
Max Brunsfeld
a11165ad0a Add unit test for auto-closing quotation marks with overrides 2023-02-20 13:46:17 -08:00
Max Brunsfeld
8be844a13f Add test that loads all bundled languages 2023-02-20 10:53:37 -08:00
Max Brunsfeld
8922156923 Restructure how bracket pairs are overridden to unify lists
This way, a bracket pair that is disabled in a given scope can still be skipped, if
it was auto-closed before that scope existed.
2023-02-20 10:53:37 -08:00
Max Brunsfeld
2982a98d1c
Merge pull request #2187 from zed-industries/save-untitled-buffer-bugs
Fix newly-discovered bugs in saving untitled buffers
2023-02-20 10:05:58 -08:00
Max Brunsfeld
56b7eb6b6f Only send UpdateBufferFile messages for buffers whose files have changed
Send that message when saving a buffer as a new path.
2023-02-20 09:41:59 -08:00
Kay Simmons
ac3e8f61ef
Merge pull request #2186 from zed-industries/better-vim-matching-motion
Better vim matching motion
2023-02-17 22:10:28 -08:00
Kay Simmons
fc811d14b1 Fix failing test 2023-02-17 22:00:39 -08:00
Max Brunsfeld
3a7cfc3901 Move the save and save_as code paths close together 2023-02-17 17:21:48 -08:00
Kay Simmons
5e4d113308 fix bracket ranges failing test 2023-02-17 17:19:23 -08:00
Kay Simmons
57a7ff9a6f fix vim percent motion to better match the docs and observed behavior 2023-02-17 14:55:19 -08:00
Max Brunsfeld
eebce28b32 Respect UpdateBufferFile messages on guest buffers without file
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2023-02-17 12:38:04 -08:00
Max Brunsfeld
98b51634c4
Merge pull request #2182 from zed-industries/faster-injections
Fix syntax-related performance problems on gigantic files
2023-02-16 12:52:13 -08:00
Kay Simmons
eac33d732e wip 2023-02-16 12:23:45 -08:00
Kay Simmons
0ba051a754 use more predictable rules for selecting which bracket to jump to and where 2023-02-15 14:04:16 -08:00
Antonio Scandurra
6703264600 Limit BufferSnapshot::chunks to the outline item range
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-02-13 19:57:15 +01:00
Max Brunsfeld
ddf4e1a316 Load languages lazily in the background 2023-01-25 17:47:46 -08:00
Max Brunsfeld
678ee26c5e Merge branch 'main' into markdown-fenced-blocks 2023-01-24 14:13:50 -08:00
Antonio Scandurra
dff08d3cfe Merge branch 'main' into markdown-fenced-blocks 2023-01-24 15:43:35 +01:00
Antonio Scandurra
c48e3f3d05 Reparse unknown injection ranges in buffer when adding a new language 2023-01-24 15:29:59 +01:00
Antonio Scandurra
f3509824e8 WIP: Start on SyntaxMapSnapshot::unknown_injection_languages 2023-01-24 12:55:49 +01:00
Antonio Scandurra
14c72cac58 Store syntax layers even if a language for the injection can't be found 2023-01-24 12:25:12 +01:00
Nathan Sobo
96ffe84edb Document Buffer::reparse 2023-01-23 21:51:10 -07:00
Mikayla Maki
d060114f00 Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Antonio Scandurra
8dabdd1baa Ensure injection layer is recomputed when language changes
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-01-23 19:02:06 +01:00
Antonio Scandurra
79cf6fb8b6 WIP: Add test for dynamic language injection 2023-01-23 09:45:36 +01:00
Antonio Scandurra
cb610f37f2 WIP: Search language injections also by file extension
There are still a few things left:

1. Add test to verify we can successfully locate a language by its extension
2. Add test to reproduce bug where changing the fenced code block language
   won't reparse the block with the new language
3. Reparse injections for which we couldn't find a language when the language
   registry changes.
4. Check why the markdown grammar considers the trailing triple backtick as
   `(code_block_content)`, as opposed to being part of the outer markdown.
2023-01-23 08:56:41 +01:00
Antonio Scandurra
36e4dcef16 Avoid allocating a string to compare language names 2023-01-23 08:56:41 +01:00
Antonio Scandurra
c49dc8d6e5 Rename LanguageRegistry::get_language to language_for_name 2023-01-23 08:56:41 +01:00
Max Brunsfeld
56080771e6 Add test for avoiding indent adjustment inside newly-created errors 2023-01-20 17:02:38 -08:00
Max Brunsfeld
f7ceebfce3 Avoid adjusting indentation of lines inside newly-created errors 2023-01-20 15:56:45 -08:00
Max Brunsfeld
8dcef46842 Drop 'override.' prefix from capture names in override query
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-20 10:44:33 -08:00
Max Brunsfeld
2aa7a9e95b Add overrides for all languages
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-20 10:39:31 -08:00
Max Brunsfeld
2967b46a17 Implement scope-specific bracket matching and comment toggling
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-19 15:04:27 -08:00
Max Brunsfeld
1851e2e77c Start work on language config overrides
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-19 12:32:08 -08:00
Antonio Scandurra
a58b39f884 Merge branch 'main' into optimize-large-multi-buffers 2023-01-19 16:18:21 +01:00
Max Brunsfeld
d9948bf772 Prevent outline items from accidentally spanning multiple lines 2023-01-18 16:43:18 -08:00
Antonio Scandurra
a653e87658 WIP: Avoid converting RopeFingerprint into a string
Co-Authored-By: Petros Amoiridis <petros@zed.dev>
2023-01-18 12:22:08 +01:00
Max Brunsfeld
1a6a807db5
Merge pull request #2035 from zed-industries/always-auto-indent-block-on-paste
Always auto-indent in block-wise mode when pasting
2023-01-17 10:24:41 -08:00
Antonio Scandurra
bb200aa082 Relay saved version metadata to ensure buffers modified state converges 2023-01-17 16:32:54 +01:00
Antonio Scandurra
467e5691b9 Include saved mtime and fingerprint when serializing buffers
This still doesn't include:

- An assertion in the randomized test to ensure buffers are not spuriously
marked as modified
- Sending an update when synchronizing buffers after a reconnection
2023-01-17 10:46:19 +01:00
Max Brunsfeld
0bd6f9b6ce Add a test for block-wise auto-indent without original indent info 2023-01-16 18:06:58 -08:00
Max Brunsfeld
244f259331 Always auto-indent in block-wise mode when pasting
If the text was copied outside of Zed, so the original indent column is unknown,
then act as if the first line was copied in its entirety.
2023-01-16 17:42:06 -08:00
Antonio Scandurra
ad7eaca443 Make Buffer::diff_base available outside of tests 2023-01-08 09:36:58 -07:00
Nathan Sobo
213658f1e9 Fix tests that failed due to defaulting the grouping interval to zero in tests 2023-01-06 17:56:21 -07:00
Max Brunsfeld
c321f5d94a Assert that buffers' file state matches in randomized collab test
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-12-21 15:38:44 -08:00
Antonio Scandurra
47348542ef Synchronize buffers when either the host or a guest reconnects 2022-12-21 14:20:56 +01:00
Julia
de9c58d216
Merge pull request #1983 from zed-industries/multi-buffer-git-gutter
Multi buffer git gutter
2022-12-19 10:53:42 -05:00
Julia
f88b413f6a Rewrite multi-buffer aware git hunks in range to be more correct
Less ad-hoc state tracking, rely more on values provided by the
underlying data

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-12-15 17:09:09 -05:00
Julia
0dedc1f3a4 Get tests building again 2022-12-15 00:17:28 -05:00
Julia
00b7c78e33 Initial hacky displaying of git gutter in multi-buffers 2022-12-13 12:35:58 -05:00
Max Brunsfeld
6d9b55a654 Send full multibuffer anchors to following peers 2022-11-28 18:00:38 -08:00
Max Brunsfeld
0b0fe91545
Merge pull request #1912 from zed-industries/matching-brackets-must-contain-range
Fix enclosing-bracket bug that appeared in JS for loops
2022-11-23 13:44:48 -08:00
Max Brunsfeld
aeea47323a Fix enclosing-bracket bug that appeared in JS for loops
Previously, we were relying on the tree-sitter query's range restriction to
avoid returning brackets that did not contain the given range. But the
query's range restriction only guarantees that we don't descend into parent
nodes unless they intersect the range.
2022-11-23 13:37:22 -08:00
Julia
03cfd23ac5 Bump protocol version back down as proto changes are non-breaking 2022-11-23 13:40:49 -05:00
Julia
b58ae8bdd7 Clip diagnostic range before and during empty range expansion
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-23 13:21:05 -05:00
Julia
e51cbf67ab Fixup compile errors 2022-11-22 02:49:47 -05:00
Julia
8c75df30cb Wrap a bunch of traits for Unclipped<T> 2022-11-21 15:58:44 -05:00
Julia
1c84e77c37 Start adding concept of Unclipped text coordinates
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-21 15:48:25 -05:00
Julia
bb32599ded Clamp for all UTF-16 to offset conversions which used to use ToOffset 2022-11-21 14:25:01 -05:00
Max Brunsfeld
bca635e5d3 Add LspAdapter hook for processing completions, fix completion sorting from Pyright 2022-11-17 15:26:46 -08:00
Max Brunsfeld
b222e8eb5a Use a longer example text in random combined injections test 2022-11-14 16:56:21 -08:00
Max Brunsfeld
ee66adbb49 SyntaxMap - Don't ignore deletions at the boundaries of layers 2022-11-11 16:43:57 -08:00
Max Brunsfeld
9ad8731897 Fix boundary condition where injection was not found after an edit 2022-11-10 17:04:40 -08:00
Max Brunsfeld
7dcd6c920f Add randomized test for syntax map with combined injections 2022-11-08 11:29:23 -08:00
Max Brunsfeld
ea42bc3c9b Rename some sum_tree seek targets in SyntaxMap 2022-11-08 10:36:44 -08:00
Max Brunsfeld
86f51ade60 Fix panic in handling edits to combined injections 2022-11-07 17:32:15 -08:00
Max Brunsfeld
c838a7d973 Get combined injections basically working
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2022-11-07 16:58:12 -08:00
Max Brunsfeld
5efe2ed6d3 Start work on handling combined injections in SyntaxMap 2022-11-07 14:45:17 -08:00
Max Brunsfeld
be6ee3cbff Start work on ERB language support 2022-11-04 09:33:59 -07:00
Max Brunsfeld
d222904471 Add basic support for ruby
Co-authored-by: Kay Simmons <kay@zed.dev>
2022-11-03 15:52:33 -07:00
Julia
259a758849
Merge pull request #1800 from zed-industries/go-to-diff-hunk
Add action to go to next/previous git diff in editor
2022-10-31 14:38:52 -04:00
Max Brunsfeld
9cbb698b96 Fix panic when hitting tab at the beginning of a line with mixed tab/space indent 2022-10-31 10:51:20 -07:00
Julia
8361b4d47a Add test for go-to hunk and fix discovered bugs 2022-10-28 15:08:13 -04:00
Julia
c4b21a0ab5 Add action to go to next/previous git diff in editor
Co-Authored-By: Kay Simmons <kay@zed.dev>
2022-10-28 15:08:13 -04:00
Antonio Scandurra
476020ae84 Show shared screen as a pane item 2022-10-24 10:04:08 +02:00
Mikayla Maki
895aeb033f
Merge branch 'main' into breadcrumbs 2022-10-17 16:51:38 -07:00
K Simmons
40c3e925ad Add cursor blink setting and replicate cursor shape to remote collaborators 2022-10-17 16:20:47 -07:00
Mikayla Maki
19c98bb5ad fixed a bug where files outside of the project would show 'untitled' in the search bar 2022-10-17 12:58:48 -07:00
Max Brunsfeld
6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Antonio Scandurra
83d3fad80d Clear auto-indent requests if they couldn't be computed 2022-10-12 10:53:44 +02:00
Mikayla Maki
5487f99ac7 Moved settings_file.rs into settings crate. Should be ready to start now :D 2022-10-11 16:03:38 -07:00
Mikayla Maki
0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Julia
e15f27106d Reset buffer git diff when setting diff base to None
Co-Authored-By: Joseph Lyons <joseph@zed.dev>
2022-10-07 15:37:37 -04:00
Max Brunsfeld
63e1c839fe Rename language::tests -> language::buffer_tests 2022-10-06 13:32:49 -07:00
Max Brunsfeld
fe7a39ba5c Apply buffer diff edits as a single batch 2022-10-06 11:54:28 -07:00
Max Brunsfeld
51fa06cc8d
Merge pull request #1404 from zed-industries/html-support
Basic html support
2022-10-06 10:32:44 -07:00
Max Brunsfeld
b7e115a6a1 Add a test for multi-language auto-indent 2022-10-05 17:59:31 -07:00
Max Brunsfeld
7fb5fe036a Derive indent size from the language at the cursor when auto-indenting 2022-10-05 17:07:35 -07:00
Max Brunsfeld
aa86806408 Finish generalizing ToggleComments to support block comments 2022-10-05 12:25:32 -07:00
Max Brunsfeld
d9fb8c90d8 Start work on toggling block comments for HTML 2022-10-04 17:27:03 -07:00
Max Brunsfeld
c354b9b959 Add assertions to test for autoclose with embedded languages 2022-10-03 13:24:37 -07:00
Julia
e6487de069 Rename head text to indicate that it's not always going to be from head
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-10-03 15:11:06 -04:00
Julia
c95646a298 WIP Start refactoring separation of concerns for repo metadata
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-30 18:25:25 -04:00
Julia
ce7f6dd082 Start a test for remote git data updating
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-09-30 15:51:32 -04:00
Mikayla Maki
71b2126eca WIP, re-doing fs and fake git repos 2022-09-29 13:16:02 -04:00
Julia
d5fd531743 Move git related things into specialized git crate
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
bf3b3da6ed Build again 2022-09-29 13:16:02 -04:00
Julia
7e5d49487b WIP Notifying buffers of head text change
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00