Commit Graph
53 Commits
Author SHA1 Message Date
Max Brunsfeld 21e7e35e73 Include newlines in between combined injection ranges on different lines 2023-07-14 09:25:56 -07:00
Max Brunsfeld 2e2333107a Find the layer with the smallest enclosing node in language_scope_at 2023-07-14 09:11:56 -07:00
Piotr Osiewicz abf3b4a54e chore: Replace lazy_static Mutex with const. (#2693)
Mutex::new() is const-stable as of Rust 1.63.

Release Notes:
- N/A
2023-07-07 15:07:12 +02:00
Max Brunsfeld 81c26cfea0 Fix bugs in handling combined injections exposed by HEEx 2023-06-27 15:08:26 -07:00
Nathan Sobo 8c298a9da5 Rename SumTree::push_tree to ::append 2023-06-19 19:49:33 -06:00
Max Brunsfeld 01bd5c30fc Fix syntax map bug with combined injections inside of other injections 2023-06-12 17:32:20 -07:00
Max Brunsfeld ac1882b99b Move SyntaxMap tests to their own file 2023-06-12 16:24:17 -07:00
Max Brunsfeld 086cfe57c5 Start work on a syntax tree view 2023-06-12 15:14:56 -07:00
Joseph Lyons 7c60f636d5 Fix typos 2023-06-02 22:02:19 -04:00
Julia 5ab1ae1521 Avoid panic in get_injections 2023-05-18 12:23:49 -04:00
Antonio Scandurra 7a600e7a65 Allow waiting for language to be loaded in LanguageRegistry APIs 2023-03-10 12:17:47 +01:00
Max BrunsfeldandAntonio Scandurra a366ba19af Fix range relativization when combined injections occur inside of other injections
For example, ERB template inside of a markdown code block

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-03-01 14:38:35 -08:00
Antonio ScandurraandMax Brunsfeld 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
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
Antonio ScandurraandMax Brunsfeld 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 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 BrunsfeldandJulia Risley 1851e2e77c Start work on language config overrides
Co-authored-by: Julia Risley <julia@zed.dev>
2023-01-19 12:32:08 -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
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 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
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Max Brunsfeld aa86806408 Finish generalizing ToggleComments to support block comments 2022-10-05 12:25:32 -07:00
Max Brunsfeld 4f44375abd Make Buffer::language_at fall back to Buffer::language
For languages with no grammar (plain text), there
will be no layers.
2022-09-28 13:38:54 -07:00
Max BrunsfeldandJulia Risley 67e188a015 Add Buffer::language_at, update MultiBuffer to use it
Co-authored-by: Julia Risley <floc@unpromptedtirade.com>
2022-09-28 12:32:04 -07:00
Mikayla Maki ebae991cb2 Finished terminal search 2022-09-01 13:45:46 -07:00
Max Brunsfeld a38c6015db Fix bugs in SyntaxMap::interpolate found by the randomized test 2022-08-29 16:52:58 -07:00
Max Brunsfeld 1746ec573a Check invariants after interpolating tree in random syntax map test 2022-08-29 16:16:11 -07:00
Max Brunsfeld 74a2b093ab Start work on randomized test for SyntaxMap, fix discovered bugs 2022-08-25 17:49:39 -07:00
Max Brunsfeld 1f12186e3c Update to latest tree-sitter commit
This is needed for https://github.com/tree-sitter/tree-sitter/pull/1845
2022-08-25 10:58:46 -07:00
Max Brunsfeld 61b70b7e2d Fix re-parsing when buffer's language has changed 2022-08-24 15:32:42 -07:00
Max Brunsfeld 587175d0ea Update syntax map's interpolated version when a parse completes 2022-08-24 15:09:10 -07:00
Max Brunsfeld ced45cbb0a Use SyntaxMap in Buffer 2022-08-24 13:00:27 -07:00
Max Brunsfeld 9113c94371 Add SyntaxMap methods for running queries and combining their results 2022-08-23 14:26:09 -07:00
Max Brunsfeld 71e17a54ae Fix case where layers were processed linearly when reparsing 2022-08-23 09:38:03 -07:00
Max Brunsfeld ae9e1338f6 Fix more bugs in syntax map interpolation 2022-08-22 17:52:14 -07:00
Max Brunsfeld 58fda5ac1c Test more editing patterns of SyntaxMap, fix bugs 2022-08-22 15:36:58 -07:00
Max Brunsfeld e8548e7732 Restructure handling of changed regions when reparsing 2022-08-21 11:39:02 -07:00