Skip to content

Commit f83fb20

Browse files
committed
Remove defect incremental sync handling
1 parent 769796e commit f83fb20

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

src/capabilityCalculator.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export class CapabilityCalculator {
1818
this.clientCapabilities;
1919

2020
return {
21-
// Perform incremental syncs
22-
// Incremental sync is disabled for now due to not being able to get the
23-
// old text in ASTProvider
24-
// textDocumentSync: TextDocumentSyncKind.Incremental,
2521
codeActionProvider: true,
2622
codeLensProvider: {
2723
resolveProvider: true,

src/providers/astProvider.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
import { URI } from "vscode-uri";
99
import Parser, { Point, SyntaxNode, Tree } from "web-tree-sitter";
1010
import { ElmWorkspace } from "../elmWorkspace";
11-
import { Position } from "../position";
1211
import { IDocumentEvents } from "../util/documentEvents";
1312
import { ElmWorkspaceMatcher } from "../util/elmWorkspaceMatcher";
1413

@@ -50,59 +49,11 @@ export class ASTProvider {
5049
}
5150

5251
for (const changeEvent of params.contentChanges) {
53-
// TODO why doesn't this work anymore?
54-
// if (changeEvent.range && changeEvent.rangeLength) {
55-
// // range is range of the change. end is exclusive
56-
// // rangeLength is length of text removed
57-
// // text is new text
58-
// const { range, rangeLength, text } = changeEvent;
59-
// const startIndex: number = range.start.line * range.start.character;
60-
// const oldEndIndex: number = startIndex + rangeLength - 1;
61-
// if (tree) {
62-
// tree.edit({
63-
// // end index for new version of text
64-
// newEndIndex: range.end.line * range.end.character - 1,
65-
// // position in new doc change ended
66-
// newEndPosition: Position.FROM_VS_POSITION(range.end).toTSPosition(),
67-
68-
// // end index for old version of text
69-
// oldEndIndex,
70-
// // position in old doc change ended.
71-
// oldEndPosition: this.computeEndPosition(
72-
// startIndex,
73-
// oldEndIndex,
74-
// tree,
75-
// ),
76-
77-
// // index in old doc the change started
78-
// startIndex,
79-
// // position in old doc change started
80-
// startPosition: Position.FROM_VS_POSITION(
81-
// range.start,
82-
// ).toTSPosition(),
83-
// });
84-
// tree = this.parser.parse(text, tree);
85-
// }
86-
// } else {
8752
tree = this.parser.parse(changeEvent.text);
88-
// }
8953
}
9054
if (tree) {
9155
forest.setTree(document.uri, true, true, tree);
9256
imports.updateImports(document.uri, tree, forest);
9357
}
9458
};
95-
96-
private computeEndPosition = (
97-
startIndex: number,
98-
endIndex: number,
99-
tree: Tree,
100-
): Point => {
101-
const node: SyntaxNode = tree.rootNode.descendantForIndex(
102-
startIndex,
103-
endIndex,
104-
);
105-
106-
return node.endPosition;
107-
};
10859
}

0 commit comments

Comments
 (0)