Exemplo n.º 1
0
def handle_property_value_completions(view, location):
    scopes = util.get_scopes(view, location)

    # >>> scopes = ["source.css", "meta.property-value.width.css"]
    # >>> util.get_scope_that_starts_with(scopes, starts_with="meta.property-value.")
    # 'meta.property-value.width.css'
    scope = util.get_scope_that_starts_with(scopes, starts_with="meta.property-value.")

    # "meta.property-value.width.css" ->
    # ['meta', 'property-value', 'width', 'css']
    #                            name
    name_index = -2
    property_name = scope.split(".")[name_index]

    return properties.get_values(property_name)
def handle_property_value_completions(view, location):
    scopes = util.get_scopes(view, location)

    # >>> scopes = ["source.css", "meta.property-value.width.css"]
    # >>> util.get_scope_that_starts_with(scopes, starts_with="meta.property-value.")
    # 'meta.property-value.width.css'
    scope = util.get_scope_that_starts_with(scopes, starts_with="meta.property-value.")

    # "meta.property-value.width.css" ->
    # ['meta', 'property-value', 'width', 'css']
    #                            name
    name_index = -2
    property_name = scope.split(".")[name_index]

    return properties.get_values(property_name)