Skip to content

Commit 00d2663

Browse files
committed
Merge branch 'fix-diff-view' of github.com:JoeRobich/omnisharp-vscode into fix-diff-view
2 parents 69e98a6 + 90f1e3b commit 00d2663

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/features/semanticTokensProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ export default class SemanticTokensProvider extends AbstractProvider implements
195195
return null;
196196
}
197197

198-
let req = createRequest<protocol.V2.SemanticHighlightRequest>(document, new vscode.Position(0, 0));
198+
const currentDocument = vscode.workspace.textDocuments.find(d => d.fileName === document.fileName);
199+
const isCurrentVersion = currentDocument?.version === document.version;
200+
201+
// 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.
202+
let req = createRequest<protocol.V2.SemanticHighlightRequest>(document, new vscode.Position(0, 0), /* includeBuffer: */ !isCurrentVersion);
199203
req.Range = range;
200204

201205

0 commit comments

Comments
 (0)