Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSS] Add custom property completions in var() functions #2909

Merged
merged 1 commit into from Aug 18, 2021

Conversation

deathaxe
Copy link
Collaborator

ST4's auto-completion system no longer picks up custom property names such as --my-custom-property from buffer. Thus they are no longer suggested in var(--|) functions for instance.

This PR extends css_completions.py to teach it providing custom properties defined in current file as completions in var() function arguments.

Example:

With ...

html {
  --my-custom1: foo;
  --my-var2: bar;
}

... the following ...

p {
  property: var(--mv|);
}

... completes to ...

p {
  property: var(--my-var2|);
}

see: https://forum.sublimetext.com/t/css-variable-suggestions-gone-with-new-update/59431

ST4's auto-completion system no longer picks up custom property names
such as `--my-custom-property` from buffer. Thus they are no longer
suggested in `var(--|)` functions for instance.

This commit extends `css_completions.py` to teach it providing custom
properties defined in current file as completions in `var()` function
arguments.

Example:

html {
  --my-custom1: foo;
  --my-var2: bar;
}

The following

p {
  property: var(--mv|);
}

completes to

p {
  property: var(--my-var2|);
}

see: https://forum.sublimetext.com/t/css-variable-suggestions-gone-with-new-update/59431
@deathaxe deathaxe merged commit 9021922 into sublimehq:master Aug 18, 2021
@deathaxe deathaxe deleted the pr/css/add-variable-completions branch August 18, 2021 17:17
mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
)

ST4's auto-completion system no longer picks up custom property names
such as `--my-custom-property` from buffer. Thus they are no longer
suggested in `var(--|)` functions for instance.

This commit extends `css_completions.py` to teach it providing custom
properties defined in current file as completions in `var()` function
arguments.

Example:

html {
  --my-custom1: foo;
  --my-var2: bar;
}

The following

p {
  property: var(--mv|);
}

completes to

p {
  property: var(--my-var2|);
}

see: https://forum.sublimetext.com/t/css-variable-suggestions-gone-with-new-update/59431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants