Skip to content

executeDocumentColorProvider always returns empty array #122138

@Domiii

Description

@Domiii
  • VS Code Version: 1.55
  • OS Version: Windows 10

I am trying to get the coloring data of a js file. I tried the following:

Steps to Reproduce:

  1. Build a simple extension, add a new custom command:
  2. const colorInfos = await commands.executeCommand('vscode.executeDocumentColorProvider', 
    window.activeTextEditor.document.uri);
    console.debug(`file colorInfos:`, colorInfos);
  3. Open a js file, and run the command. Observe: the result is empty.
  4. Verify that everything is setup correctly
    • I tried it multiple times, no luck.
    • Calling await commands.executeCommand('vscode.executeDocumentSymbolProvider', uri); right next to it returns the symbols as expected.

Does this issue occur when all extensions are disabled?: Yes

I would expect that it gives me all coloring information in the document, but it always returns an empty array.

What else?

I dug a bit deeper, and found that typescript-language-features (which I assume to provide the language server for JS and TS) to neither call provideDocumentColors nor registerColorProvider. Not sure if that is related? Maybe the colors are provided (and thus must be queried) in a different way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions