Skip to content

Commit 4b00248

Browse files
committed
Always send document text when Semantic Highlighting
1 parent 866918a commit 4b00248

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/features/semanticTokensProvider.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,9 @@ export default class SemanticTokensProvider extends AbstractProvider implements
197197

198198
let req = createRequest<protocol.V2.SemanticHighlightRequest>(document, new vscode.Position(0, 0));
199199
req.Range = range;
200-
201-
202-
// We need to include the document contents in our request when we are highlighting a version of the document other than the current version, such as in the Diff view.
203-
const currentDocument = vscode.workspace.textDocuments.find(d => d.fileName === document.fileName);
204-
const isCurrentVersion = currentDocument?.version === document.version;
205-
if (!isCurrentVersion) {
206-
req.VersionedText = document.getText();
207-
}
200+
// We need to include the document contents in our request for cases where we are highlighting
201+
// a version of the document other than the current version, such as in the Diff view.
202+
req.VersionedText = document.getText();
208203

209204
const versionBeforeRequest = document.version;
210205

0 commit comments

Comments
 (0)