Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Request for contribution: Improve mixin parameter scopes #81

@dsifford

Description

@dsifford

Hello again,

I'd like to work on improving the scope of less mixin parameters. (See here)

Currently, given the following mixin...

.mymixin(@x: 5px) {}

the following scopes are given...

  .mymixin(@x: 5px) {}
//^^^^^^^^source.css.less entity.other.attribute-name.class.mixin.css
//        ^source.css.less meta.brace.round.css
//         ^source.css.less variable.other.lesspunctuation.definition.variable.less
//          ^source.css.lessvariable.other.less
//           ^source.css.less punctuation.separator.key-value.css
//             ^source.css.less constant.numeric.css
//              ^^source.css.less constant.numeric.css keyword.other.unit.px.css
//                ^source.css.less meta.brace.round.css

What I'm proposing to change is to make it instead produce this...

  .mymixin(@x: 5px) {}
//^^^^^^^^source.css.less meta.mixin.less meta.definition.mixin.less entity.name.mixin.less
//        ^source.css.less meta.mixin.less meta.parameters.less punctuation.definition.parameters.begin.less
//         ^^source.css.less meta.mixin.less meta.parameters.less variable.parameter.less
//           ^source.css.less meta.mixin.less meta.parameters.less keyword.operator.assignment.less
//             ^source.css.less constant.numeric.css
//              ^^source.css.less constant.numeric.css keyword.other.unit.px.css
//                ^source.css.less meta.mixin.less meta.parameters.less punctuation.definition.parameters.end.less

The scopes were chosen using Microsoft/TypeScript-TmLanguage as a reference because I personally think their grammar is one of the most meticulously designed and well-thought grammars that exists.

I started working on this already and it's pretty much done, but I wanted to make sure that this would be something accepted before adding a whole bunch of tests.

Let me know! Thanks 😄

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions