SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

rule scope:source.regexp-replacement#escaped has a scope name, but is unreachable, so the name will never be used #161

Closed evandrocoan closed 7 years ago

evandrocoan commented 7 years ago

I am not sure what I was doing when it show up:

Package Control: No updated packages
disable_autocomplete
disable_autocomplete
reloading settings Packages/User/Preferences.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
Errors parsing theme:
icon_file_type is missing layer0.opacity, setting to 1.0 for backwards compatibility
rule scope:source.regexp-replacement#escaped has a scope name, but is unreachable, so the name will never be used
reloading settings Packages/Default/Preferences.sublime-settings
indexing [job 25]: no files were indexed out of the 4 queued, abandoning crawl
indexing [job 26]: no files were indexed out of the 4 queued, abandoning crawl

I found this rule on the file:

File: Data/Packages/PackageDev/Package/Regex Replacement.sublime-syntax
34:   escaped:
35:     - meta_scope: source.regexp-replacement.escaped
36:     - match: (\\\\)[1-9]
37:       captures:
38:         1: constant.character.escape.json
39:       scope: keyword.other.backref-and-recursion.regexp-replacement
40:     - match: (\\\\)[aefnrtv()]
41:       captures:
42:         1: constant.character.escape.json
43:       scope: constant.character.escape.regexp-replacement
44:     - match: (\\\\)[lLuUE]
45:       captures:
46:         1: constant.character.escape.json
47:       scope: keyword.operator.case-conversion.regexp-replacement
48:     - match: (\\\\)x(\h{2}|\{\h{4}\})
49:       captures:
50:         1: constant.character.escape.json
51:       scope: constant.character.escape.regexp-replacement
52:     - match: \(\?([1-9]|\{\w+\})
53:       scope: keyword.other.backref-and-recursion.conditional.regexp-replacement
54:       push:
55:         - meta_scope: meta.group.conditional.regexp-replacement
56:         - match: ':'
57:           scope: keyword.operator.alternation.regexp-replacement
58:         - match: \)
59:           scope: keyword.other.backref-and-recursion.conditional.regexp-replacement
60:           pop: true
61:         - include: escaped
62:     - match: (\\\\)\\?.
63:       captures:
64:         1: constant.character.escape.json
65:       scope: constant.character.escape.regexp-replacement
66:     # sourced from JSON.sublime-syntax#string-escape
67:     - match: |-
68:         (?x:
69:           \\
70:           (?:
71:               ["\\/bfnrt]
72:             | u [0-9a-fA-F]{4}
73:           )
74:         )
75:       scope: constant.character.escape.json meta.literal.regexp-replacement
76:     - match: \\.
77:       scope: invalid.illegal.unrecognized-string-escape.json
78:     - include: shared
79: 
keith-hall commented 7 years ago

pretty sure this is benign: https://github.com/SublimeTextIssues/Core/issues/1683

FichteFoll commented 7 years ago

Indeed, this is the referenced core issue and I don't intend on working around it, because it's infeasible.