Commit Graph

15 Commits

Author SHA1 Message Date
Alex Hoppen
294977534c [libSyntax] Remove incremental JSON transfer option
We were only keeping track of `RawSyntax` node IDs to incrementally transfer a syntax tree via JSON. However, AFAICT the incremental JSON transfer option has been superceeded by `SyntaxParseActions`, which are more efficient.

So, let’s clean up and remove the `RawSyntax` node ID and JSON incremental transfer option.

In places that still need a notion of `RawSyntax` identity (like determining the reused syntax regions), use the `RawSyntax`’s pointer instead of the manually created ID.

In `incr_transfer_round_trip.py` always use the code path that uses the `SyntaxParseActions` and remove the transitional code that was still using the incremental JSON transfer but was never called.
2021-04-07 10:01:34 +02:00
Alex Hoppen
8bb1167e21 [libSyntax] Restructure RawSyntax to more closely resemble the SwiftSyntax implementation 2021-01-29 13:08:12 +01:00
Rintaro Ishizaki
1f563b3716 [incrParse] Fix SyntaxParsingCache::translateToPreEditPosition()
If the position is in the region that is inserted by the edits,
'pre-edit' position shouldn't exist. So we cannot reuse the node at the
position.

rdar://problem/45259469
https://bugs.swift.org/browse/SR-8995
2018-11-06 00:27:19 +09:00
Alex Hoppen
63becb530b [incrParse] Fix bug in translation of post-edit to pre-edit positions 2018-10-11 17:54:17 +02:00
Nathan Hawes
5c568af436 [incrParse] Fix bug mapping a node's location back to its location in the cached syntax tree
Also fix Edit::intersectsOrTouchesRange check only returning true when the
ranges overlapped, rather than when they overlapped or 'touched'.

Resolves rdar://problem/45108439
2018-10-08 15:44:38 -07:00
Alex Hoppen
2193a7b437 [incrParse] Compute NodeStart on the fly when looking up nodes
This is faster than invoking getAbsolutePosition which needs to walk the
tree again.
2018-08-02 14:28:59 -07:00
Alex Hoppen
c8226d1507 [libSyntax] Make a typealias to unsigned to represent SyntaxNodeIds 2018-07-19 13:57:08 -07:00
Alex Hoppen
419ba044f1 [libSyntax] Record reused node IDs
This is cheaper than recording reused region offsets and the reused node
IDs will later be used to incrementally transfer the syntax to
SwiftSyntax.
2018-07-19 13:55:57 -07:00
Alex Hoppen
7a750bf024 [libSyntax] Allow syntax cache reuse info to be passed back via SourceKit 2018-07-18 13:35:10 -07:00
Alex Hoppen
2decf8ffaf [libSyntax] Rename recordReuseInformation to setRecordReuseInformation 2018-05-22 09:07:56 -07:00
Alex Hoppen
92f8f34d22 [incrParse] Store reused regions and output them after parsing 2018-05-22 08:52:34 -07:00
Alex Hoppen
65ac4f57a4 [incrParse] Refactor node reusability into separate function 2018-05-22 08:52:34 -07:00
Alex Hoppen
186feb6f0e [incrParse] Allow information about node reused be outputted 2018-05-22 08:52:33 -07:00
Alex Hoppen
60d11d24f8 [incrParse] Reparse a node if the next leaf node has been modified 2018-05-22 08:52:33 -07:00
Alex Hoppen
de9737c946 [incrParse] Support incremental parsing for edited files 2018-05-22 08:52:33 -07:00