![]() ![]() This setting allows removing scope names from the current stack. Used to stop the current context from automatically including the The above string example, the content scope would not get applied to the meta_content_scopeĪs above, but does not apply to the text that triggers the context (e.g., in Patterns that push the context onto the stack and pop it off. This assigns the given scope to all text within this context, including the Multiple patterns match at the same position, the first defined pattern will be When a context has multiple patterns, the leftmost one will be found. String context will be popped off the context stack, returning to assigning Last pattern specifies an action when an unescaped quote is encountered, the The string context has two patterns: the first matches a backslash characterįollowed by any other, and the second matches a quote character. The text under the caret by pressing Ctrl Shift P (Mac) or While editing in Sublime Text, you can check what scopes have been applied to scope to all text while the string context is on The string context introduces a new key: meta_scope. This means the rest of the file will be processing using the stringĬontext, and not the main context, until the string context is popped off the YAML syntax error), and pushes a new context, string, onto the context scope : - match : '"' pop : trueĪ second pattern has been added to the main context that matches a double quoteĬharacter (note that '"' is used for this, as a standalone quote would be a %YAML 1.2 - name : C file_extensions : scope : source.c contexts : main : - match : \b(if|else|for|while)\b scope : - match : '"' push : string string : - meta_scope : - match : \\. If a file does not have a basename, e.g.gitignore, theĮntirety of the filename including the leading. Extensions listed here will be shown in file dialog dropdowns on some file_extensionsĪ list of strings, defining file extensions this syntax should be usedįor. Will be derived from the file name if not used. This defines the name shown for the syntax in the menu. The allowed keys in the header area are: name Note that due to the YAML syntax, tab characters are not allowed To ensure that words such as elsewhere are not considered keywords. The above example, \b is used to ensure only word boundaries are matched, The match key is a regex, supporting features from the Oniguruma regex It will be used at the start of the file. The context name main special: every syntax must define a main context, as This syntax file contains one context, main, that matches the words These scopes are used by color schemes to highlight the %YAML 1.2 - name : C file_extensions : scope : source.c contexts : main : - match : \b(if|else|for|while)\b scope : Īt its core, a syntax definition assigns scopes (e.g., ) toĪreas of the text. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |