kasik96/Swift-VS-Code

Highlight not working

Closed this issue · 3 comments

Hi, I have installed your plugin on my vs code, but when I write swift codes, the highlight doesn't work. What should I do? Many thanks.

func makeRow(id: Any, rest: [Any]) -> String {
     return "\(id)\(rest.reduce( "", { l,r in "\(l),\(r)" }))\n"
}

This kills syntax highlighting.

Here's another example:

    static let mainGroupLine = try! NSRegularExpression(pattern: "^\\s+mainGroup = ([0-9A-F]{24});$", options: [])
    static let targetsLine = try! NSRegularExpression(pattern: "^(\\s+)targets = \\($", options: [])
    static let filesLine = try! NSRegularExpression(pattern: "^(\\s+)files = \\($", options: [])
    static let childrenLine = try! NSRegularExpression(pattern: "^(\\s*)children = \\($", options: [])```

image

Highlight gets broken after 2nd line because of the regex string pattern "^(\\s+)files = \\($".
More precisely it seems to get broken on the escape sequence in regex string: \\($:
image

If you have solution for this, feel free to create Pull Request.