Closed romainmenke closed 1 year ago
Does this make https://github.com/microsoft/vscode-css-languageservice/pull/315 obsolte?
I think so.
imho the remaining functionality from that PR is not possible with the current available API's'. It requires a way to assign a color attribute through a different field than completionItem.documentation
.
This builds upon and is directly related to : https://github.com/microsoft/vscode-css-languageservice/pull/315
My initial intention was to verify those changes but I quickly ran into issues.
Having a match for
rgb
incompletionItem.documentation
doesn't actually mean that the value is a color. This becomes more apparent when considering new color functions likelab
which can easily be part of a larger word or can be used in a sentence.A documentation string can also contain multiple values :
--border: 1px solid rgb(255 0 0);
I started writing regexp's to match actual color functions, but this exploded in complexity and would only cover the most simplistic of cases. I don't think it is ideal to have parser functions and regexp matchers for all the color functions.
However I do think it is valuable to add support for color keywords
transparent
andcurrentColor
and to extend hex support to hex 4 and hex 8.I also moved some regexp constructors outside of functions.