color - jsdoc and tiny tweaks for color provider api

This commit is contained in:
Johannes Rieken
2017-10-16 12:39:20 +02:00
parent a71c987a4d
commit 65a2d30efe
6 changed files with 61 additions and 27 deletions

View File

@@ -145,10 +145,10 @@ export function activate(context: ExtensionContext) {
});
});
},
provideColorPresentations(document: TextDocument, colorInfo: ColorInformation): Thenable<ColorPresentation[]> {
provideColorPresentations(color: Color, context): Thenable<ColorPresentation[]> {
let params: ColorPresentationParams = {
textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
colorInfo: { range: client.code2ProtocolConverter.asRange(colorInfo.range), color: colorInfo.color }
textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context.document),
colorInfo: { range: client.code2ProtocolConverter.asRange(context.range), color }
};
return client.sendRequest(ColorPresentationRequest.type, params).then(presentations => {
return presentations.map(p => {
@@ -288,4 +288,4 @@ function getPackageInfo(context: ExtensionContext): IPackageInfo {
};
}
return null;
}
}