Skip to content

Commit

Permalink
move and update completions, fix missing settings
Browse files Browse the repository at this point in the history
  • Loading branch information
braver committed Feb 25, 2024
1 parent d2a09b5 commit 540197c
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 57 deletions.
14 changes: 14 additions & 0 deletions Syntaxes/SCSS.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Set to true to disable default completions.
"disable_default_completions": false,

// Controls what scopes default completions will be provided in.
// Can be a list of strings which are joined before matching.
"default_completions_selector": "source.scss - meta.selector",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",

// Default separator and additional `-`
"sub_word_separators": "_-",
}
2 changes: 1 addition & 1 deletion Syntaxes/Sass.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Controls what scopes default completions will be provided in.
// Can be a list of strings which are joined before matching.
"default_completions_selector": "source.scss - meta.selector",
"default_completions_selector": "source.sass - meta.selector",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",
Expand Down
2 changes: 0 additions & 2 deletions completions/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .plugins.completions import *
Empty file added plugins/__init__.py
Empty file.
1 change: 1 addition & 0 deletions plugins/completions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .provider import ScssCompletions
51 changes: 48 additions & 3 deletions completions/common.py → plugins/completions/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def get_common_values():
"normal",
"bold",
],
"axis": ["block", "inline", "vertical", "horizontal"],
"baseline-position": ["firstbaseline", "lastbaseline", "baseline"],
"basic-shape": [
["circle()", "circle($1)"],
["ellipse()", "ellipse($1)"],
Expand Down Expand Up @@ -72,19 +74,42 @@ def get_common_values():
],
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column", "avoid-region"],
"calc": [
["acos()", "acos($1)"],
["asin()", "asin($1)"],
["atan()", "atan($1)"],
["atan2()", "atan2($1)"],
["calc()", "calc($1)"],
["clamp()", "clamp(${1:0}, ${2:0}, ${3:0})"],
["cos()", "cos($1)"],
["exp()", "exp($1)"],
["hypot()", "hypot($1)"],
["log()", "log($1)"],
["max()", "max(${1:0}, ${2:0})"],
["min()", "min(${1:0}, ${2:0})"],
["mod()", "mod(${1:0}, ${2:0})"],
["pow()", "pow(${1:0}, ${2:0})"],
["rem()", "rem(${1:0}, ${2:0})"],
["round()", "round(${1:0}, ${2:0}, ${3:0})"],
["sign()", "sign($1)"],
["sin()", "sin($1)"],
["sqrt()", "sqrt($1)"],
["tan()", "tan($1)"],
],
"caret-color": ["auto", "<color>"],
"caret-shape": ["auto", "bar", "block", "underscore"],
"color": [
"currentColor",
"transparent",
["rgb()", "rgb(${1:0}, ${2:0}, ${3:0})"],
["rgb()", "rgb(${1:0}, ${2:0}, ${3:0}${4: / ${5:1.0}})"],
["rgba()", "rgba(${1:0}, ${2:0}, ${3:0}, ${4:1.0})"],
["hsl()", "hsl(${1:0}, ${2:100%}, ${3:50%})"],
["hsl()", "hsl(${1:0}, ${2:100%}, ${3:50%}${4: / ${5:1.0}})"],
["hsla()", "hsla(${1:0}, ${2:100%}, ${3:50%}, ${4:1.0})"],
["hwb()", "hwb(${1:0}, ${2:100%}, ${3:50%})"],
["hwb()", "hwb(${1:0}, ${2:100%}, ${3:50%}${4: / ${5:1.0}})"],
["lab()", "lab(${1:0%}, ${2:0}, ${3:0}${4: / ${5:1.0}})"],
["lch()", "lch(${1:0%}, ${2:0.0}, ${3:0.0}${4: / ${5:1.0}})"],
["light-dark()", "light-dark(${1}, ${2})"],
["oklab()", "oklab(${1:0%}, ${2:0}, ${3:0}${4: / ${5:1.0}})"],
["oklch()", "oklch(${1:0%}, ${2:0.0}, ${3:0.0}${4: / ${5:1.0}})"],
# Named colors
"aliceblue",
"antiquewhite",
Expand Down Expand Up @@ -235,6 +260,9 @@ def get_common_values():
"yellow",
"yellowgreen",
],
"container-type": ["normal", "size", "inline-size"],
"content-distribution": ["space-between", "space-around", "space-evenly", "stretch"],
"content-position": ["center", "start", "end", "flex-start", "flex-end"],
"counter-style": [["symbols()", "symbols($1)"]],
"counter-symbols": [
"cyclic",
Expand Down Expand Up @@ -392,6 +420,7 @@ def get_common_values():
"hiragana-iroha",
"katakana-iroha",
],
"overflow-position": ["unsafe", "safe"],
"position": ["<side-or-corner>", "center"],
"relative-size": ["larger", "smaller"],
"relative-weight": ["bolder", "lighter"],
Expand All @@ -403,6 +432,7 @@ def get_common_values():
"round",
"no-repeat",
],
"scroller": ["root", "nearest"],
"self-position": [
"center",
"start",
Expand All @@ -414,6 +444,7 @@ def get_common_values():
],
"shape-radius": ["closest-side", "farthest-side"],
"side-or-corner": ["left", "right", "top", "bottom"],
"text-wrap": ["wrap", "nowrap", "balance", "stable", "pretty"],
"timing-function": [
"linear",
"ease",
Expand Down Expand Up @@ -467,6 +498,20 @@ def get_common_values():
"%",
],
"url": [["url()", "url($1)"]],
"white-space-collapse": [
"collapse",
"discard",
"preserve",
"preserve-breaks",
"preserve-spaces",
"break-spaces"
],
"white-space-trim": [
"none",
"discard-before",
"discard-after",
"discard-inner"
],
}

resolved_values = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
def get_func_args():
common_values = get_common_values()
func_args = {
"abs": ["<calc>"],
"asin": ["<calc>"],
"atan": ["<calc>"],
"atan2": ["<calc>"],
"attr": ["<color>", "<type-or-unit>"],
"blur": ["<calc>"],
"brightness": ["<calc>"],
"calc": [["attr()", "attr($1)"], "<calc>"],
"circle": ["<calc>", "<shape-radius>", "at", "<position>"],
"clamp": [["attr()", "attr($1)"], "<calc>"],
"conic-gradient": ["from", "at", "<position>", "<color>"],
"cos": ["<calc>"],
"contrast": [],
"counter": ["<counter-style>"],
"counters": ["<counter-style>"],
Expand All @@ -20,30 +25,42 @@ def get_func_args():
"element": [],
"ellipse": ["<calc>", "<shape-radius>", "at", "<position>"],
"env": [],
"exp": ["<calc>"],
"filter": ["<filter-function>", "<image>"],
"fit-content": [],
"grayscale": ["<calc>"],
"hsl": ["<calc>"],
"hsla": ["<calc>"],
"hwb": ["<calc>", "none"],
"hue-rotate": ["<calc>"],
"hypot": ["<calc>"],
"image": ["<image-tags>", "<url>", "<color>"],
"image-set": [["type()", "type($1)"], "<url>", "<color>"],
"inset": ["<calc>", "round"],
"invert": ["<calc>"],
"lab": ["<calc>", "none"],
"lch": ["<calc>", "none"],
"leader": ["<leader-type>"],
"light-dark": ["<color>"],
"linear-gradient": ["<side-or-corner>", "<color>", "to"],
"log": ["<calc>"],
"matrix": ["<calc>"],
"matrix3d": ["<calc>"],
"max": [["attr()", "attr($1)"], "<calc>"],
"min": [["attr()", "attr($1)"], "<calc>"],
"minmax": ["min-content", "max-content", "auto"],
"mod": ["<calc>"],
"oklab": ["<calc>", "none"],
"oklch": ["<calc>", "none"],
"opacity": ["<calc>"],
"path": ["<fill-rule>"],
"paint": [],
"perspective": ["<calc>"],
"polygon": ["<calc>", "<fill-rule>"],
"pow": ["<calc>"],
"radial-gradient": ["<ending-shape>", "<size>", "at", "<position>", "<color>"],
"rect": ["<calc>", "auto"],
"rem": ["<calc>"],
"repeat": ["<calc>", "auto-fill", "auto-fit"],
"repeating-conic-gradient": ["from", "at", "<position>", "<color>"],
"repeating-linear-gradient": ["<side-or-corner>", "<color>", "to"],
Expand All @@ -61,17 +78,23 @@ def get_func_args():
"rotateX": ["<calc>"],
"rotateY": ["<calc>"],
"rotateZ": ["<calc>"],
"round": ["<calc>", "nearest", "up", "down", "to-zero"],
"saturate": ["<calc>"],
"scale": ["<calc>"],
"scale3d": ["<calc>"],
"scaleX": ["<calc>"],
"scaleY": ["<calc>"],
"scaleZ": ["<calc>"],
"scroll": ["<axis>", "<scroller>"],
"skew": ["<calc>"],
"skewX": ["<calc>"],
"skewY": ["<calc>"],
"sepia": ["<calc>"],
"sign": ["<calc>"],
"sin": ["<calc>"],
"sqrt": ["<calc>"],
"steps": ["<calc>", "end", "middle", "start"],
"tan": ["<calc>"],
"target-counter": ["<url>", "<counter-style>"],
"target-counters": ["<url>", "<counter-style>"],
"target-text": ["<url>", "content", "before", "after", "first-letter"],
Expand Down
Loading

0 comments on commit 540197c

Please sign in to comment.