Change:
Type: <bBug</bI have an extension that has been making use of the executeCommand API for "vscode.executeDocumentHighlights" to get the for different positions in a file. Essentially calling something like below: After a recent VsCode update, the API is no longer returning any values and simply returns . I'm not sure the best way to provide a reproduce for this. I originally encountered the problem with a custom extension/language server. However the problem also appears to occur when calling the same command on a simple typescript file so I believe it's a general issue rather than any thing specific to my environment. I've had a quick search in the VsCode sources and I have a feeling this commit might be responsible: I think the problem is due to now returning instead of . When it gets to the ApiCommand layer I think the function fails and returns as the function has been given a instead of VS Code version: Code 1.84.2 (, 2023-11-09T10:51:52.184Z) OS version: WindowsNT x64 10.0. Modes: <details<summarySystem Info</summary </details<details<summaryExtensions (30)</summaryExtensionVersion ------ vscode-markdownlint0.53.0 vscode-eslint2.4.2 mfcobol1.0.53 mfenterprise1.0.53 vscode-language-pack-ja1.84. csdevkit1.0.14 csharp2.12.19 vscode-dotnet-runtime2.0.0 vscodeintellicode-csharp0.1.26 python2023.20.0 vscode-pylance2023.11.10 jupyter2023.10. jupyter-keymap1.1.2 jupyter-renderers1.0.17 vscode-jupyter-cell-tags0.1.8 vscode-jupyter-slideshow0.1.5 remote-ssh0.107.1 remote-ssh-edit0.86.0 remote-wsl0.81.8 powershell2023.8.0 remote-explorer0.4.1 test-adapter-converter0.1.8 java1.25.0 intellicode-api-usage-examples0.2.8 vscodeintellicode1.2.30 vscode-java-debug0.55.0 vscode-java-dependency0.23.3 vscode-java-pack0.25.15 vscode-java-test0.40.1 vscode-maven0.43.0 </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
Thanks This is a good find!
To verify: make sure this test has passed:

Discussion:
return new TextualOccurenceRequest(model, selection, word, wordSeparators, otherModels); } <del> registerModelAndPositionCommand('_executeDocumentHighlights', (accessor, model, position) => { </del> <ins> registerModelAndPositionCommand('_executeDocumentHighlights', async (accessor, model, position) => { </ins> const languageFeaturesService = accessor.get(ILanguageFeaturesService); <del> return getOccurrencesAtPosition(languageFeaturesService.documentHighlightProvider, model, position, CancellationToken.None); </del> <ins> const map = await getOccurrencesAtPosition(languageFeaturesService.documentHighlightProvider, model, position, CancellationToken.None); return map?.get(model.uri); </ins> }); class WordHighlighter {

}); }); <ins> // --- document highlights test('"vscode.executeDocumentHighlights" API has stopped returning DocumentHighlight[]#200056', async function () { disposables.push(extHost.registerDocumentHighlightProvider(nullExtensionDescription, defaultSelector, <vscode.DocumentHighlightProvider>{ provideDocumentHighlights() { return [ new types.DocumentHighlight(new types.Range(0, 17, 0, 25), types.DocumentHighlightKind.Read) ]; } })); await rpcProtocol.sync(); return commands.executeCommand<vscode.DocumentHighlight[]>('vscode.executeDocumentHighlights', model.uri, new types.Position(0, 0)).then(values => { assert.ok(Array.isArray(values)); assert.strictEqual(values.length, 1); const [first] = values; assert.strictEqual(first.range.start.line, 0); assert.strictEqual(first.range.start.character, 17); assert.strictEqual(first.range.end.line, 0); assert.strictEqual(first.range.end.character, 25); }); }); </ins> // --- outline test('Outline, back and forth', function () {