It would be great if the colorviewer / colorpicker worked for any language.
I noticed it worked great with json, but not with cs-files (for csharp...).
I managed to get it working for C# by tweaking the exttension.js, not sure if I caused any damage but this is what I did:
function activate(context) {
// Use the console to output diagnostic information (console.log) and errors (console.error)
// This line of code will only be executed once when your extension is activated
let docFlutterSelector = {
pattern: "**/*.dart"
};
// Register our CodeLens provider
let FlutterColorShowDisposable = vscode.languages.registerColorProvider(docFlutterSelector, new FlutterColorShow_1.default());
let docJsonSelector = {
pattern: "**/*.json",
};
// Register our CodeLens provider
let JSONColorShowDisposable = vscode.languages.registerColorProvider(docJsonSelector, new JSONColorShow_1.default());
let docCSharpSelector = {
pattern: "**/*.cs",
};
vscode.languages.registerColorProvider(docCSharpSelector, new JSONColorShow_1.default());
context.subscriptions.push(FlutterColorShowDisposable);
context.subscriptions.push(JSONColorShowDisposable);
}
i.e. I just added the following lines:
let docCSharpSelector = {
pattern: "**/*.cs",
};
vscode.languages.registerColorProvider(docCSharpSelector, new JSONColorShow_1.default());
It would be great if the colorviewer / colorpicker worked for any language.
I noticed it worked great with json, but not with cs-files (for csharp...). I managed to get it working for C# by tweaking the exttension.js, not sure if I caused any damage but this is what I did:
i.e. I just added the following lines: