GNU bug report logs -
#22923
[PATCH] Support completion of attribute values in CSS mode
Previous Next
Reported by: Simen Heggestøyl <simenheg <at> gmail.com>
Date: Sun, 6 Mar 2016 13:55:02 UTC
Severity: wishlist
Tags: patch
Done: Simen Heggestøyl <simenheg <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 23 Mar 2016 19:17:56 +0100
with message-id <1458757076.18872.0 <at> smtp.gmail.com>
and subject line Re: bug#22923: [PATCH] Support completion of attribute values in CSS mode
has caused the debbugs.gnu.org bug report #22923,
regarding [PATCH] Support completion of attribute values in CSS mode
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
22923: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22923
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hello!
I've finally gotten around to implement property value completion in
CSS mode. I've been using the attached patch privately for some weeks
now, and it seems to me that it works well.
The code has taken much inspiration from company-css.el, but there are
some differences:
- Completion lists for many new properties have been added, and a few
have been removed (most of them from the obsoleted marquee
module [1]).
- I've manually updated all completion lists according to the CSS spec
and fixed some bugs in the existing lists along the way. In general
I've tried to stay as close as possible to the grammar described in
the CSS spec wrt. names and order of the values and classes.
- The new `css--property-values' function is very similar to
`company-css-property-values', but it has been updated to support
following completion candidates further from the value class
completion lists.
- Completion a function name will no longer put commas between the
parenthesis. My reason for this is that many CSS functions take a
variable number of arguments. For instance, the `translate' function
is completed by company-css to `translate(,)', but `translate' can
take only one argument too, so the completion is misleading. Also,
there are functions that support an arbitrary number of
arguments. Instead of trying to support this, I've made every
function name complete to just `function()'. I think having ElDoc
support for CSS functions would be good for making it easier to
remember which arguments functions take.
- `inherit' has been added as a completion candidate for every
property.
Please have a look at the patch and tell me what you think!
-- Simen
[1] https://www.w3.org/TR/css3-marquee/
[Message part 4 (text/html, inline)]
[0001-Support-completion-of-attribute-values-in-CSS-mode.patch (text/x-patch, attachment)]
[Message part 6 (message/rfc822, inline)]
[Message part 7 (text/plain, inline)]
On Mon, Mar 21, 2016 at 12:02 PM, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> You're right, it's a bug. I'd fix that with only making
> company-css-value-classes recursive (but not refer back to
> company-css-property-alist there).
>
> To put it differently, I don't like that there's conflation of
> property values and property names: if there appears a value
> sometimes that is the same as some property's name (unlikely, I
> know), it would be hard to represent in the proposed structure.
>
> Anyway, I've taken more than enough of your time. Please go ahead
> with whichever version you prefer.
Don't worry Dmitry, I very much appreciate your through reviews.
You are right that there are some cases where property names and value
class names are the same (there are currently four), and I found a bug
in my handling of one of those. I remedied that by going with your
suggestion of making value classes symbols again, and only referring to
other value classes from those.
For properties, I made them also refer to value classes by default, but
made it possible to refer back to other properties in the cases where
the reference isn't found in the value class alist.
I attempted to document this thoroughly in the code and added some tests
that should cover the tricky cases.
I've installed the patch with the changes mentioned above.
Thanks again!
-- Simen
[Message part 8 (text/html, inline)]
This bug report was last modified 9 years and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.