Commit Graph
566 Commits
Author SHA1 Message Date
Max Brunsfeld 278116bc25 Load languages lazily in the background 2023-01-25 17:47:46 -08:00
Max Brunsfeld 9934803399 Merge branch 'main' into markdown-fenced-blocks 2023-01-24 14:13:50 -08:00
Antonio Scandurra 1027bdf977 Merge branch 'main' into markdown-fenced-blocks 2023-01-24 15:43:35 +01:00
Antonio Scandurra ae95a0188e Reparse unknown injection ranges in buffer when adding a new language 2023-01-24 15:29:59 +01:00
Antonio Scandurra cdb95382ec WIP: Start on SyntaxMapSnapshot::unknown_injection_languages 2023-01-24 12:55:49 +01:00
Antonio Scandurra 309d76c932 Store syntax layers even if a language for the injection can't be found 2023-01-24 12:25:12 +01:00
Nathan Sobo 3826d9257e Document Buffer::reparse 2023-01-23 21:51:10 -07:00
Mikayla Maki fc7532d74d Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Antonio ScandurraandMax Brunsfeld d1bb98c27b 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 4157175324 WIP: Add test for dynamic language injection 2023-01-23 09:45:36 +01:00
Antonio Scandurra 53db679c84 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 e8eb69d10e Avoid allocating a string to compare language names 2023-01-23 08:56:41 +01:00
Antonio Scandurra 366000e263 Rename LanguageRegistry::get_language to language_for_name 2023-01-23 08:56:41 +01:00
Max Brunsfeld 71b684108d Add test for avoiding indent adjustment inside newly-created errors 2023-01-20 17:02:38 -08:00
Max Brunsfeld fdd0542498 Avoid adjusting indentation of lines inside newly-created errors 2023-01-20 15:56:45 -08:00
Max BrunsfeldandJulia Risley 21cc5ebbcf 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 BrunsfeldandJulia Risley 2c5bb8ff1b Add overrides for all languages
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-20 10:39:31 -08:00
Max BrunsfeldandJulia Risley b3dc191963 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 BrunsfeldandJulia Risley 786ff5ab05 Start work on language config overrides
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-19 12:32:08 -08:00
Antonio Scandurra 89ccd53f33 Merge branch 'main' into optimize-large-multi-buffers 2023-01-19 16:18:21 +01:00
Max Brunsfeld 30863cf803 Prevent outline items from accidentally spanning multiple lines 2023-01-18 16:43:18 -08:00
Antonio ScandurraandPetros Amoiridis 28e547e774 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 85ba7d512a 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 e2ecfdc72d Relay saved version metadata to ensure buffers modified state converges 2023-01-17 16:32:54 +01:00
Antonio Scandurra 26e3920cbd 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 d6cf69a56c Add a test for block-wise auto-indent without original indent info 2023-01-16 18:06:58 -08:00
Max Brunsfeld ab5c9fb038 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 97c1c1cc6c Make Buffer::diff_base available outside of tests 2023-01-08 09:36:58 -07:00
Nathan Sobo ce223e88fe Fix tests that failed due to defaulting the grouping interval to zero in tests 2023-01-06 17:56:21 -07:00
Max BrunsfeldandNathan Sobo c07f90cb54 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 55c5989abc Synchronize buffers when either the host or a guest reconnects 2022-12-21 14:20:56 +01:00
Julia 6fb3bad2e8 Merge pull request #1983 from zed-industries/multi-buffer-git-gutter
Multi buffer git gutter
2022-12-19 10:53:42 -05:00
JuliaandMax Brunsfeld 48c0db49da 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 c0c47139aa Get tests building again 2022-12-15 00:17:28 -05:00
Julia d100acd3b1 Initial hacky displaying of git gutter in multi-buffers 2022-12-13 12:35:58 -05:00
Max Brunsfeld 80f0d19ed7 Send full multibuffer anchors to following peers 2022-11-28 18:00:38 -08:00
Max Brunsfeld e16439ad2b 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 2c14c1a0ce 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 10927128bd Bump protocol version back down as proto changes are non-breaking 2022-11-23 13:40:49 -05:00
JuliaandMax Brunsfeld dde8f8e781 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 06895033f3 Fixup compile errors 2022-11-22 02:49:47 -05:00
Julia 475e37d4cf Wrap a bunch of traits for Unclipped<T> 2022-11-21 15:58:44 -05:00
JuliaandMax Brunsfeld 0b63261fb8 Start adding concept of Unclipped text coordinates
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-21 15:48:25 -05:00
Julia 1837b188d2 Clamp for all UTF-16 to offset conversions which used to use ToOffset 2022-11-21 14:25:01 -05:00
Max Brunsfeld d3a588533f Add LspAdapter hook for processing completions, fix completion sorting from Pyright 2022-11-17 15:26:46 -08:00
Max Brunsfeld b395c72047 Use a longer example text in random combined injections test 2022-11-14 16:56:21 -08:00
Max Brunsfeld 7e96dddb53 SyntaxMap - Don't ignore deletions at the boundaries of layers 2022-11-11 16:43:57 -08:00
Max Brunsfeld 791142ab59 Fix boundary condition where injection was not found after an edit 2022-11-10 17:04:40 -08:00
Max Brunsfeld ab63f71a20 Add randomized test for syntax map with combined injections 2022-11-08 11:29:23 -08:00
Max Brunsfeld 9e9f1727ed Rename some sum_tree seek targets in SyntaxMap 2022-11-08 10:36:44 -08:00