Commit Graph

10992 Commits (026b2674d09dbc5cd279e769902387c95b6a126d)
 

Author SHA1 Message Date
Wilfred Hughes 026b2674d0 Update expected output
The previous two commits were done in a branch that was rebased, so
the integration tets missed 5fe6d551d.
2022-08-21 21:36:00 +07:00
Wilfred Hughes c957818514 Explore two graph nodes for each parenthesis position
This produces substantially better diff results, and fixes the 'last
item in the list shown as changed' problem.

This can produce slower diffing. typing_before.ml takes 10% more
instructions and slow_before.rs takes 110% more instructions.
2022-08-21 16:34:17 +07:00
Wilfred Hughes a71d6118cf Store predecessors and neighbours as mutable fields in graph nodes
This is a more traditional graph representation. It is slightly easier
to reason about, and it's clearer that graph node creation time
dominates graphs exploration.

This is a slight performance regression, but it enables better
exploration of parethesis nesting (see next commit). typing_before.ml
has regressed from 3.75B instructions to 3.85B instructions and
slow_before.rs has regressed from 1.73B instructions to 2.15B
instructions.

This change has also made the diff output for slow_before.rs slightly
worse (note the `lhs` variable is now claimed as changed in more
cases). It's not clear why, but presumably means that the node visit
order has changed slightly.

Closes #324
2022-08-21 16:25:54 +07:00
Wilfred Hughes 2cc05f340f rustfmt 2022-08-21 16:01:51 +07:00
Wilfred Hughes 515932151f Merge branch 'cmake' 2022-08-20 18:36:07 +07:00
Wilfred Hughes b95bc0fb27 Also consider highlights.scm when marking nodes as comments
This removes the need to special-case Perl, and is necessary for
CMake (which has nodes bracket_comment and line_comment that aren't
marked as 'extra').
2022-08-20 18:32:52 +07:00
Wilfred Hughes bbdc324b7f Add CMake support
Fixes #333
2022-08-20 18:32:32 +07:00
Wilfred Hughes 58c8f47298 Also consider highlights.scm when marking nodes as comments
This removes the need to special-case Perl, and is necessary for
CMake (which has nodes bracket_comment and line_comment that aren't
marked as 'extra').
2022-08-20 18:28:07 +07:00
Wilfred Hughes 9d2c5f56cb Add 'vendor/tree-sitter-cmake/' from commit '599836393074e4744d78dad76b8b8eb8e1f690ff'
git-subtree-dir: vendor/tree-sitter-cmake
git-subtree-mainline: 5fe6d551d9
git-subtree-split: 5998363930
2022-08-19 00:29:21 +07:00
Wilfred Hughes fb38e7a24f Always use the RHS for language detection
Taking the longest path breaks if we have e.g. /dev/null and foo.py,
because foo.py is shorter.
2022-08-18 23:00:15 +07:00
Wilfred Hughes 01cce54978 Fix path display when called from git with two arguments
Fixes #332
2022-08-18 23:00:13 +07:00
Wilfred Hughes 5fe6d551d9 Always use the RHS for language detection
Taking the longest path breaks if we have e.g. /dev/null and foo.py,
because foo.py is shorter.
2022-08-18 22:58:43 +07:00
Wilfred Hughes 040dd3b0e2 Fix path display when called from git with two arguments
Fixes #332
2022-08-18 09:34:14 +07:00
Wilfred Hughes d69cc05966 Add link to magit blog post
Mentioned in #251
2022-08-17 09:41:54 +07:00
Wilfred Hughes eb0817468e Update manual for rustc bump 2022-08-12 21:51:34 +07:00
Wilfred Hughes 6ce0717447 Note the newer rustc requirement 2022-08-12 12:39:00 +07:00
Wilfred Hughes a5aa433277 Mention #329 in the changelog 2022-08-12 12:25:02 +07:00
Wilfred Hughes e1672427d3
Merge pull request #329 from fdncred/fix_windows_build
updates to support building on windows
2022-08-10 22:43:05 +07:00
Darren Schroeder 003cbb21e0 updates to support building on windows 2022-08-09 13:51:26 +07:00
Wilfred Hughes 0c03187b96 Roll version 2022-08-07 18:16:16 +07:00
Wilfred Hughes f028389393 Update changelog for last commit 2022-08-07 18:13:04 +07:00
Wilfred Hughes ecd94b4e44 Treat /dev/null as an empty file on all platforms
Fixes #296
2022-08-07 18:11:17 +07:00
Wilfred Hughes 5d93efa51a Document Elm support in the manual and changelog
This was added in 0.26.
2022-08-02 09:15:11 +07:00
Wilfred Hughes 5d195bcfad Use the .entry API instead of a separate .get and .insert
This improves performance, specifically it saves up to 6.2%
instructions (on slow_before/after.rs).
2022-07-25 00:25:47 +07:00
Wilfred Hughes b9f048e87e Add newlines for clarity 2022-07-21 00:45:37 +07:00
Wilfred Hughes bc283341f3 Use unique subtrees shared between LHS/RHS to determine similar lists
This makes the 'lists are sufficiently similar' heuristic more
aggressive. Previously we'd look for lists with common start or end
children and the same delimiters.

This worked badly for cases like:

LHS: (novel-lhs (a b c d e))
RHS: (novel-rhs (a b c d e))

Instead, look for sublists that are unique on both sides and occur on
both the LHS and RHS root being considered. This allows us to match up
many more cases.

Consider lists to be sufficiently similar exclusiely using this
(surprisingly effective) heuristic, and don't consider outer
delimiters.

This substantially improves performance in many cases, particularly
for files that are fairly flat (many toplevel lists with little
nesting).

Fixes #306
2022-07-19 21:58:37 +07:00
Wilfred Hughes 97a29645f0 Ensure content_id is set before finding unique nodes 2022-07-18 22:31:30 +07:00
Wilfred Hughes bf8a20d7bb Fix typo 2022-07-18 21:48:28 +07:00
Wilfred Hughes a05535aa1c Add content_is_unique metadata to syntax nodes 2022-07-18 21:32:16 +07:00
Wilfred Hughes a4ef836b66 Add a comment explaining init_info_on_side 2022-07-18 21:20:51 +07:00
Wilfred Hughes 1d8995f04e Remove more unnecessary lifetimes 2022-07-18 21:20:38 +07:00
Wilfred Hughes a42fd4017a Remove unnecessary lifetimes 2022-07-18 21:18:19 +07:00
Wilfred Hughes 6062fda762 Clarify function name 2022-07-18 21:12:16 +07:00
Wilfred Hughes 24fa0b76a7 Remove num_after accessor
The num_after metadata is useful for prototyping A* or other heuristic
searches, but the num_after accessor is dead code in the main branch.
2022-07-17 15:56:04 +07:00
Wilfred Hughes 05782dbf5c Add num_after to Syntax
This is useful when estimating the distance to the last syntactic
node.
2022-07-12 23:16:48 +07:00
Wilfred Hughes 5b132b3da5 Silence cargo warning 2022-07-12 00:13:34 +07:00
Wilfred Hughes 3e320bb1cb Bump version number 2022-07-12 00:12:21 +07:00
Wilfred Hughes e545db85ef Remove example files from vendored SQL parser
These hit the filename length limit on Windows
2022-07-11 23:31:19 +07:00
Wilfred Hughes 374ea35876 Add symlinks for Hack parser 2022-07-11 22:58:54 +07:00
Wilfred Hughes 0dce9fcec5 Update regression tests following 38c6718c86 2022-07-11 22:14:12 +07:00
Wilfred Hughes 8547987830 Add Hacklang support 2022-07-11 22:13:37 +07:00
Wilfred Hughes 470585e7e2 Add 'vendor/tree-sitter-hack/' from commit 'b7bd6928532ada34dddb1dece4a158ab62c6e783'
git-subtree-dir: vendor/tree-sitter-hack
git-subtree-mainline: 38c6718c86
git-subtree-split: b7bd692853
2022-07-11 21:54:37 +07:00
Wilfred Hughes 38c6718c86 Improve handling of /dev/null paths when there are two CLI argsuments
When git calls us, we always know the file name. If we're called with
two arguments and one is /dev/null, use the other for language
detection and display.
2022-07-11 21:41:04 +07:00
Wilfred Hughes e8865905b7 Mention SQL in the manual 2022-07-11 19:28:13 +07:00
Wilfred Hughes f2ca7cf314 Add SQL support
Closes #311
2022-07-11 09:31:34 +07:00
Wilfred Hughes a9fb2638d0 Add 'vendor/tree-sitter-sql/' from commit '218b672499729ef71e4d66a949e4a1614488aeaa'
git-subtree-dir: vendor/tree-sitter-sql
git-subtree-mainline: 144f7d9e30
git-subtree-split: 218b672499
2022-07-11 09:09:33 +07:00
Wilfred Hughes 144f7d9e30 Updated TypeScript parser 2022-07-10 23:42:54 +07:00
Wilfred Hughes 1edf6c488e Merge commit '49e82b1bce36d6046df911901684cd66b5345d58' 2022-07-10 23:42:32 +07:00
Wilfred Hughes 2d0af395f9 Updated Scala parser 2022-07-10 23:39:13 +07:00
Wilfred Hughes f04d7ec4bd Merge commit '140c96cf398693189d4e50f76d19ddfcd8a018f8' 2022-07-10 23:38:53 +07:00