Skip to content

Pipe character breaks the highlighting #4

@Cyberbeni

Description

@Cyberbeni

My stencil file:

// sourcery:inline:auto:{{ type.name }}.init
public init({% for variable in type.storedVariables %}{{variable.name}}: {{variable.typeName}}{% ifnot forloop.last %}, {% endif %}{% endfor %}) {
{% for variable in type.storedVariables %}
    self.{{variable.name}} = {{variable.name}}
{% endfor %}
}
// sourcery:end
{% endfor %}

{% for type in types.all where type|annotated:"isEqual" %}
// sourcery:inline:auto:{{ type.name }}.isEqual
override public func isEqual(to object: Any?) -> Bool {
    guard let other = object as? {{type.localName}} else { return false }
    return {% for variable in type.storedVariables %}{{variable.name}} == other.{{variable.name}}{% ifnot forloop.last %} &&
        {% endif %}{% endfor %}
}
override public var hash: Int {
    var hasher = Hasher()
{% for variable in type.storedVariables %}
    hasher.combine({{variable.name}})
{% endfor %}
    return hasher.finalize()
}
// sourcery:end
{% endfor %}

Looks like this:
https://user-images.githubusercontent.com/8356175/102830624-05952200-43ea-11eb-8990-34165a1f17cf.png

Same result with current version from marketplace and the version in #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions