Skip to content

Commit

Permalink
Remove completion restrictions (#108)
Browse files Browse the repository at this point in the history
Resolves #107

Suggest properties also within `meta.selector` as this is the most likely
scope in front of a nested selector, if a property is not yet terminated by
semi-colon.
  • Loading branch information
deathaxe authored May 7, 2024
1 parent e390c84 commit e0ce1aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Syntaxes/SCSS.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.scss",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",
Expand Down
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.sass - meta.selector",
"default_completions_selector": "source.sass",

// Default separators except `-`
"word_separators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?",
Expand Down
4 changes: 1 addition & 3 deletions plugins/completions/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,8 @@ def on_query_completions(self, view, prefix, locations):
items = self.complete_function_argument(view, prefix, pt)
elif view.match_selector(pt - 1, "meta.property-value, punctuation.separator.key-value"):
items = self.complete_property_value(view, prefix, pt, True)
elif view.match_selector(pt - 1, "meta.property-name, meta.property-list - meta.selector"):
items = self.complete_property_name(view, prefix, pt, True)
else:
items = None
items = self.complete_property_name(view, prefix, pt, True)

if items:
return sublime.CompletionList(items)
Expand Down

0 comments on commit e0ce1aa

Please sign in to comment.