Commit Graph

12 Commits

Author SHA1 Message Date
Peter Slattery 504d902ddd Make initial parse and code index generation happen async 2025-08-05 15:39:04 -07:00
Peter Slattery 1507f414b1 Cleaning up temp code, unused struct members, and using a Scratch_Block to store buffer_contents during parsing 2025-08-04 00:51:19 -07:00
Peter Slattery 8ad2b5bbff Incrementally update global_code_index.name_hash 2025-08-04 00:28:09 -07:00
Peter Slattery 30ac43ce66 Prevent re-parsing the whole file by identifying the node containing the edit, or the node immediately before and after the edit, and parsing only those. Fall back to root for empty file case 2025-08-02 23:21:46 -07:00
Peter Slattery 12322796c2 Incrementally re-parse notes and scope delimiters within the range of a single edit. 2025-08-02 23:21:01 -07:00
Peter Slattery a34a24f4e7 Passing the old and new ranges from buffer_edit_range to Buffer_Tree_Sitter_Data so it can be accessed in the tick for incremental code index updating 2025-07-16 11:31:55 -07:00
Peter Slattery b56bd7caa8 Move code index updating to happen to modified buffers on the tick hook. This will unify the separate paths for updating the code index. 2025-07-16 11:24:23 -07:00
Peter Slattery 94991304b5 Temporarily move all tree-sitter operations to be synchronous 2025-07-16 11:21:41 -07:00
Peter Slattery ae7440aa0b custom_render_buffer only requests the token array if it's being used for a feature the user actually requested since requesting the tokens needs to take the lock on the token array. 2025-07-14 11:22:08 -07:00
Peter Slattery 79695eca2c tree sitter logic handles edits to a parsed buffer
- async_task_cancel_nowait implementation
2025-07-10 09:14:35 -07:00
Peter Slattery 43fb4a757a Implement Tree_Sitter_Language_Definition, handle registering languages by extension, and looking up the appropriate language definition for a buffer.
custom_begin_buffer uses new functions to identify which files to treat as code
implement custom_render_buffer which uses tree sitter data to color tokens
2025-07-10 08:53:54 -07:00
Peter Slattery 7caaed736b Initial tree sitter usage:
- identify buffer language
- custom_begin_buffer sets up necessary tree sitter state, and kicks off a parse task
- custom_end_buffer cleans up tree sitter data and kills async parse tasks
- tree_sitter_parse_async/__inner uses tree sitter api to get a tree of the buffer's code and stores it on the buffers managed scope
- tree_sitter_write_tree prints tree to a special *tree* buffer
- use new build scripts in 4coder project
2025-07-10 07:08:27 -07:00