forked from sublimehq/Packages
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from sublimehq:master #395
Open
pull
wants to merge
80
commits into
erichdongubler-contrib:master
Choose a base branch
from
sublimehq:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* [JavaScript] Fix ternary operator regression This commit fixes a regression, introduced by #3986, which breaks syntax highlighting in objects, as comma is no longer consumed as key-value-pair separator. It's not the ternary expression, which allows commas, but the for statement, which allows multiple expressions, separated by comma after `in` keyword. for (var in <expr>, <expr>, ...) expr: any valid expression, maybe ternary, maybe function-call The change to ternary expressions is reverted and for-condition context is modified instead to allow multiple expressions after `in` keyword. Also scope `;` invalid if there are too many. * [JavaScript] Tweak for-conditon context switching This commit... 1. adds a `pop: 1` to the pattern of `for-condition` to make sure at most one opening parenthesis after for is consumed as loop condition. The following may have happened before. for (...) (...) 2. Tweaks how `meta.group` is applied as it sometimes makes a difference, whether a scope is a `meta_scope` or not, especially related with `clear_scopes` keyword.
* [Batch File] Fix labels This commit starts implementing tokenization according to descriptions of https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/4095133#4095133 for lables, which are also used as sort of line comments. It also highlights the odd parts, which includes not all valid looking labels being able to targeted in GOTO and CALL statements due to different tokenization rules being applied by dosbatch interpreter. * [Batch File] Fix paths word boundaries All sorts of words are terminated by common word boundaries (metachars), including path strings. It's obscure but `mkdir d1=d2` actually creates directories `d1` and `d2`. * [Batch File] Commonly scope basic delimiters This commit scopes `,` `;` and `=` punctuation.separator, if not otherwise addressed by more specific patterns to indicate their primary meaning. * [Batch File] Reorganize charsets in variables This commit refactors some variable values to avoid nested charsets in patterns. Note: This commit does not change behavior.
* [JavaScript] Adjust tagged template string related key bindings This commit... 1. scopes tagged template strings `meta.string.template` to give all of them a common scope without regards of used syntax highlighting 2. uses that scope in key bindings' selectors to enable them in syntax highlighted tagged templates. 3. restrict ` to JavaScript strings by enforcing scope order in selectors in binding 1 and 2 4. merge "selector" keys in binding 3 and 4 * [JavaScript] Add binding to auto-indent content whithin backquotes This commit adds a `enter` key binding to achieve the following, when hitting enter within two backquotes. before: foo = `|` after: foo = ` | ` * [JavaScript] Adjust context key order This commit moves `selector` after `settings` and `selection_empty` as it seems to be the commonly used order in ST's default key bindings. * [JavaScript] Add missing `match_all` attribute to selector context checks This commit aligns selector checks with ST's default key bindings by adding `"match_all": true` to all selector context checks. * [JavaScrit] Simplify keybindings' context checks This commit removes default entries. - operator: equal - operand: true * [JavaScript] Fix typo * [JavaScript] Tweak enter key binding This commit changes `enter` key binding to "Add Line in Braces" macro, as it indents line between backticks using indentation rules instead of forcing it to be indented via `\t`. This works also, if indentation rules decide not to indent backticked contents.
This command matches the *Edit > Text > Insert Line After* menu item and so it will show the incorrect keybinding (`enter` instead of `ctrl+enter`). To fix this we can simply make the command not match the one in the menu. The `"hide_from_menu"` is not functional. Co-authored-by: Benjamin Schaaf <[email protected]>
* [JavaScript] Exclude mappings from normal keyword indentation Fixes https://forum.sublimetext.com/t/sublime-text-on-the-word-default/72953 This commit applies dedicated (json) indentation rules to JavaScript mappings to avoid unexpected (un-)indenting of keys, which look like reserved control structure keywords (e.g.: case, default, if, else, ...). * [JavaScript] Exclude lists from normal keyword indentation Same as for mappings, is true for lists. They can contain otherwise reserved words, which should not be treated by indentation rules. * [JavaScript] Add key binding for bracket content auto-indentation This commit applies a key binding from JSON package to auto-indent content of lists when hitting enter var = [|] becomes: var = [ | ] * [JavaScript] Handle function calls in mappings or lists This commit... 1. extends selectors for each syntax (JS, JSX, TS, TSX) to choose correct indentation rules in nested mappings, lists or functions/lambdas. 2. Adds check for trailing `:` to case/default indentation rule patterns, as a function called `case()` in a mapping can't be prevented from being unindented via selectors. * [JavaScript] Reorganize tests Merge new tests into existing file * [JavaScript] Add tests for embedded JS code blocks * [JavaScript] Remove failing tests As we need to expect `:` after case/default, those tests no longer work by intent. * [JavaScript] Rename indentation rules file * [JavaScript] Improve indentation rules of tagged template strings This commit... 1. fixes lines after single-line tagged template string being indented. before: var foo = html`<p>content</p>`; var bar = html`<p>content</p>`; var baz = html`<p>content</p>`: after: var foo = html`<p>content</p>`; var bar = html`<p>content</p>`; var baz = html`<p>content</p>`: 2. excludes content of plain string templates from auto-indentation. As their kind of content is undefined, normal indentation rules may cause false results. Tests are added to ensure normal JS statements keep untreated. Notes: First and last line of tagged templates is scoped `string.quoted.other` regardless of embedded syntax highlighting, if only opening or closing backticks appear. Hence increasing indentation of tagged template strings' content is handled by "Indentation Rules - Template Strings". Decreasing indentation of closing backtick is handled by normal "Indentation Rules" as those are the ones applied by ST. It just doesn't work otherwise. This circumstance helps to reliably distinguish opening and closing backticks and correctly in- or decrease indentation. * [JavaScript] Tweak key binding context key order This commit aligns this PR with #4022. * [JavaScript] Tweak enter key binding This commit changes `enter` key binding to "Add Line in Braces" macro, as it indents line between backticks using indentation rules instead of forcing it to be indented via `\t`. This works also, if indentation rules decide not to indent backticked contents. * [JavaScript] Simplify indentation rules By utilizing the improved selector scoring of build 4173, we can simply have the two rules override each other based on the last meta scope on the stack. --------- Co-authored-by: FichteFoll <[email protected]>
…ation (#4020) * [HTML] Tweak embedded script/style code boundaries This commit... 1. consumes a) any trailing whitespace until end of line after opening script/style tags or optionally following `<!--` punctuation. b) any leading whitespace in front of closing script/style tags or optionally preceded `-->` punctuation. to not apply embedded syntax's scope after standalone opening or in front of standalone closing tags. This change makes sure to ... a) always apply HTML specific indentation rules to enclosing script/style tags or comment punctuation. b) apply custom background highlighting of embedded syntaxes only on full lines, but not after or in front of standalone tags. 2. modifies indentation rules for HTML comments to remove indentation of comments' content. * [HTML] Adjust ASP/Rails syntax tests
The `file` is the keyword of type modifier as the type visibility. see: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/file
* [JavaScript] Interpolate TypeScript in tagged templates This commit ensures TypeScript syntax being used in tagged template string interpolations, when working in TypeScript or TSX sources. It copies everything from JavaScript and replaces `source.js` by `source.ts`. * [JavaScript] Improve extensibility of tagged template strings This commit introduces a single entry point for 3rd-party customization by adding a dedicated `literal-string-template-begin` context which further variants of tagged-template strings can be added to.
Implements JEP 476, shipped with Java 23+ see: https://openjdk.org/jeps/476
This commit removes `invalid.illegal` scope from unsupported escape sequences. Actually `\` is interpreted literal if it doesn't start a supported escape sequence. The following is a valid string without illegals: ``` new Source("src\main\java\com\example\application\views\HomeView.java") ```
This commit adds dedicated JSX indentation rules inspired by those from HTML, but with some simplifications and adjustments required for JavaScript.
Fixes #4042 This commit ensures, `expression` contexts starts with first non-whitespace.
Fixes #4044 This commit improves format string placeholder pattern precision to reduce risk of false positives by strictly following language specifications. Note: It also restricts supported `verbs` to those found at https://pkg.go.dev/fmt.
This commit adds scopes for `e`, `pi`, `infinity` and `NaN` constants in calc(). see: https://developer.mozilla.org/en-US/docs/Web/CSS/calc#formal_syntax
This commit adds scopes to highlight round() strategies. Note: round() uses common `calc-function-arguments-content` context, so these keywords are also highlighted in other functions, they don't have special meaning in. Chances to run into conflicts are however too low to justify a new dedicated context for round() arguments. see: https://developer.mozilla.org/en-US/docs/Web/CSS/round#rounding-strategy
* [Groovy] various improvements - move some anonymous contexts to named contexts - improve some scope names
This commit fixes custom property definitions with declaration-list values. Custom properties... 1. can take all sorts of values. 2. never start a selector. Without this commit, leading `--` is ignored and custom property name being consumed as html tag, starting a selector.
This commit... 1. changes context include order to give `property-lists` less priority over `{{ interpol }}` interpolation tags, so they are scoped as part of selectors or property names. 2. in case strategy 1 is not enough, provide variables to override block punctuation, without duplicating contexts. Note: This commit does not change behavior of CSS itself, just helps inherited CSS variants used in templates like Blade, Go, Jinja, Twig, ... Co-authored-by: Keith Hall <[email protected]>
Suggest properties also within `meta.selector` as this is the most likely scope in front of nested selectors, if a property is not yet terminated by semi-colon. As completions are much more likely, do no longer suppress word completions. Without this commit auto-completion no longer provides property-name completions in front of nested selectors. Example: div { color: red; bo| <- no more completions here h2 { text-decoration: none; } }
This commit modifies CSS completion selector to prevent suggestions in comments and embedded template code. That's important to give template tag related completions precedence and avoid invalid property-name expansions within such template tags. Examples: CSS div { /* |<- no css property completions here */ } CSS (PHP) div { <?php |<- no css property completions here ?> } CSS (Jinja2) div { {% |<- no css property completions here %} {{ |<- no css property completions here }} } ...
Syntax test files must start with "syntax_test_" Co-authored-by: Benjamin Schaaf <[email protected]>
This commit scopes `cls` and `self` special in parameter lists, to enable highlighting them as their references in function bodies.
This commit adds counter-parts for JavaScript's `*.cjs` and `*.mjs` file extensions to Typescript.
This commit makes sure to pop CSS/JS contexts off stack, if quotation mark is matched by customizing relevant CSS/JS contexts only. By not injecting required lookahead into each context via `prototype`, compiled syntax cache size is reduced by round about 200kB as more contexts share same patterns. Modified syntax definitions are designed for being included into inline event and style attributes of HTML tags. Note: This commit does not change behavior, just saves some RAM.
This commit... 1. scopes `type="..."` attributes with unique `meta.attribute-with-value.type` 2. adds basic completions for known mime types. This change is probably of lower importance for basic HTML, but this change may help improving DX for template languages, which support more mime types like TypeScript, LiveScript, Babel, CoffeScript, ... .
* [ShellScript] Fix job built-ins This commit... 1. adds missing -f and -p options for wait built-in 2. adds dedicated tests for job built-in commands 3. refactors job variable tests by replacing `fg` command by `:` dummy to align them with majority of other variable tests * [ShellScript] Fix brace expansions This commit fixes support for brace expansions according to bash syntax specs. Former `number-range` was just a special case for what brace expansions can do. * [ShellScript] Fix tilde expansions * [ShellScript] Refactor parameter expansions This commit ... 1. applies structural changes, required for ZSH. 2. fixes various parameter expansion bugs related with special parameters e.g. `${$}`, `${?}`, ... 3. fixes advanced tilde expansions such as `~name/` or `~+/` In general it means to introduce contexts and rules to scope expansions more precisely and detailed. * [ShellScript] Refactor redirections * [ShellScript] Refactor subscriptions * [ShellScript] Fix function identifiers This commit removes quote-removal from function and alias identifiers as it is not supported by Bash. Function identifiers must be unquoted literals. * [ShellScript] Exclude linefeed from continuation punctuation * [ShellScript] Replace various anonymous contexts in Bash This commit makes it easier to extend contexts in inherited syntax definitions. * [ShellScript] Scope function body meta.block This commit scopes function bodies with a commonly used meta scope in favor of Bash's "compound" command as preparation for other shells, which follow closer to other programming languages. It removes redirections from context stack as those are handled globally. * [ShellScript] Refactor case statement contexts This commit applies required changes to support ZSH case statements, which may use curly braced code blocks as in C, which didn't work well with previous meta scope structure. * [ShellScript] Add paths patterns * [ShellScript] Refactor command arguments' word boundaries This commit... 1. refactors how word boundaries and quotes are treated. Motivation: A reliably distinction between tilde-expansions and logic operators is required in ZSH pattern matching to support the following: cmd ~/path/*~*.com ^ operator ^ tilde expansion 2. assigns `string` scope to all suitable strings and patterns to enable color schemes to more clearly distinguish them from variables. Note: Aligns Bash with "Batch File" syntax. 3. refactors command argument list termination Replace clunky and messy "boilerplate" contexts with proper "cmd-args-end". Note: Aligns Bash with "Batch File" syntax. * [ShellScript] Reorganize literals * [ShellScript] Special echo treatment Everything between options and end of command is a string, regardless quotation. This commit therefore introduces special contexts for `echo` builtin. * [ShellScript] Tweak builtin test command arguments This commit... 1. fixes [ command termination behavior - terminate at \n ; && or || as normal `test` builtin 2. prefers scoping < > as comparison operator as it is more likely to be valid than redirections. Note: May need further refinements 3. highlight unquoted ; illegal in [[ ... ]] compound test expressions 4. fixes word boundaries of strings withing test expressions * [ShellScript] Remove obsolete brace expansion contexts * [ShellScript] Scope built-in variables This commit scopes all pre-defined built-in variables and distinguishes them from special variables such as `$0` or `$*`. Fixes an issue with `$_` vs. `$$_` highlighting. see: https://www.gnu.org/software/bash/manual/bash.html#Shell-Variables * [ShellScript] Reorganize expressions Move up expressions and operators contexts. * [ShellScript] Reorganize literals This commit moves literals, strings and pattern matching contexts up, right after heredocs. * [ShellScript] Add arithmetic highlighting in assignment values This commit... 1. enables support for correctly scoping literal and arithmetic assignment values in `declare` commands and its friends. 2. fixes unsupported nested `(...)` in value sequences. The following is illegal `var=(foo (bar baz))`. 3. distinguishes option assignment values and variable assignment values. Only the latter supports value sequences wrapped in parens. * [ShellScript] Reorganize variables * [ShellScript] Tweak number word breaks This commit... 1. drops leading `\b` from `numbers`'s patterns as proper global word boundary checks are available. 2. treat numbers as words, consuming everything until word boundary and scope it illegal if not valid part of a number. * [ShellScript] Avoid duplicate patterns in statement 1. `comments` is not required 2. `line-continuations` is already provided by `eol-pop` * [ShellScript] Fix comments after heredoc tags * [ShellScript] Reorganize prototypes at the bottom * [ShellScript] Remove obsolete compound args contexts Only redirections are allowed after compound commands, which is already satisfied/handled via global statements context. * [ShellScript] Simplify coproc * [ShellScript] Refactor tilde interpolation scopes 1. always clear parent scope 2. scope username `constant.other` * [ShellScript] Align illegal token scopes Use already existing `invalid.illegal.unexpected-token.shell` * [ShellScript] Simplify alias meta scope * [ShellScript] Simplify declaration meta scope * [ShellScript] Refactor anonymous function definitions This commit... 1. scopes anonymous functions `meta.function-call meta.function.anonymous` as those are immediately called. 2. allows arguments after function body * [ShellScript] Refactor command arguments This commit adjusts builtin commands' argument contexts so they follow the same context structure, used by cmd-basic - means: dedicated cmd-args-meta context is used to apply meta.function-call.arguments scope. Hence eoc-pop2 and eol-pop2 become obsolete as all commands share same structure. * [ShellScript] Add missing option word boundaries * [ShellScript] Fix for arguments * [ShellScript] Simplify arithmetic command We have enough context to no longer need to rely on lookahead for closing )). * [ShellScript] Refactor arithmetic expressions This commit... 1. treats `let ...` statement as arithmetic variable declaration as this is what it is most likely used for. 2. drops `cmd-test` and treats arguments as plain arithmetic expressions. Actually let args are equal to content of (( ... )) compound commands according to Bash Manual. 3. refactors quoted vs. unquoted expressions * [ShellScript] Refactor conditional compound commands This commit... 1. applies `meta.compound.conditional` to `[ .. ]` and `[[ .. ]]` expressions 2. scopes brackets `punctuation.section.compound`. * [ShellScript] Refactor compound commands This commit applies `meta.compound.command` to compound commands to distinguish them via level-3 scope name from the others. * [ShellScript] Refacotr case clauses This commit... 1. scopes case statements `meta.statement.case` 2. scopes case clauses `meta.clause.[pattern|body]` 3. scopes case pattern parens `punctuation.definition.pattern.[begin|end]` ... in order to prepare for syntax based folding and align with scope naming guidelines with regards to punctuation. * [ShellScript] Verify eval command higlighting * [ShellScript] Fix single statement termination * [ShellScript] Fix indentation rules This commit... 1. adds indentation rules for case clauses 2. fixes indentation rules for if statements 3. adds indentation tests 4. adjusts code style of indentation rules * [ShellScript] Syntax based folding * [ShellScript] Adjust completion rules This commit cancels completions immediately after each reserved word to 1. give snippets precedence over completions 2. prefer enter adding a linefeed rather than committing a completion * [ShelScript] Adjust `in` keyword scope This commit scopes `in` as `keyword.operator.iterator`. * [ShellScript] Simplify built-ins This commit drops all command specific contexts and thus highlighting, because a syntax definition is not a linter and thus doesn't need to highlight unsupported command arguments `illegal`. That's cumbersome to maintain for multiple shell dialects and likely to fail once shells evolve. Therefore only syntactically important special cases are kept untouched. * [ShellScript] Refactor context switch architecture This commit... 1. `set`s command arguments' contexts onto stack rather than `pushing` them. 2. adjusts everything for it to work. Results: - a re-usable `statement` context, which consumes a single command and its arguments. - syntax cache size is reduced from 110kB to 88kB by this change - switching contexts of commands to push into if...else blocks etc. becomes much cheaper with regards to compiled syntax size. * [ShellScript] Reorganize variables * [ShellScript] Tweak loop iterator context structure This commit... 1. adds meta scopes to loop control statements 2. restricts loop iterator to single token * [ShellScript] Add command and time built-ins * [ShellScript] Add command modifiers * [ShellScript] Add trap built-in * [ShellScript] Add Zsh Syntax This commit... 1. reorganizes ShellScript package by moving all dialect specific files into separate sub directories, while maintaining only syntax definitions and basic sublime-... files in the top-level directory. That's required for maintainability and to keep track which meta files address certain dialects. - Shell: targets all shells - Bash: bash specific meta-data - Zsh: zsh specific meta-data 2. Adds Zsh syntax definition, indentation rules, ... * [Markdown] Adjust tests and add zsh code fences * [ShellScript] Fix symbol definitions * [ShellScript] Refactor HEREDOC This commit... 1. implements heredocs by top-most `embed...escape` pattern. This... - reduces compiled syntax cache size from 100kB to 90kB - reliably terminates heredoc strings with a single `escape` pattern - reduces syntax definition complexity and repetitions 2. restricts `meta.string.heredoc` scope to the string part excluding lines of opening and closing HEREDOC tags. That's required for herdoc specific indentation rules. * [ShellScript] Move variables main context to the bottom * [ShellScript] Add basic completions * [ShellScript] Allow overriding indentation restrictions This commit adds `tab_indent` and `no_indent` variables, which can be used by extending syntaxes to easily remove indentation restrictions. * [Markdown] Improve embedded shells This commit... 1. merges code blocks with shell-script and interactive shells. Both now use the same extended syntax, which detects interactive shell by checking the first lines of code. 2. implements lazy indentation for shebang and HEREDOCs to scope them correctly, even if fenced code block is indented. * [ShellScript] Reorganize some variables * [ShellScript] Fix HEREDOCs in ZSH * [ShellScript] Fix HERESTRING body This commit ensures the word after `<<<` operator is always scoped plain string without pattern matching or globbing being applied. That wasn't the case in assignment statements before. * [ShellScript] Remove obsolete parameter expansion context * [ShellScript] Exclude prototype from all string contexts ... to prefer and enforce usage of `string-prototype`. * [ShellScript] Fix context order * [ShellScript] Add special treatment of mapfile built-in * [ShellScript] Tweak command reference scopes and symbols This commit... 1. introduces a common `meta.command` scope applied to function calls and function name references. 2. adjusts reference definitions accordingly. Goal is a common and unique scope to target function or command references. * [ShellScript] Add special treatment for readarray built-in The command equals `mapfile`. * [Markdown] Adjust syntax tests * [ShellScript] Reorganize bash built-in tests - add command arguments call spec to comments - sort builtin and command tests between alias and declare alphabetically * [ShellScript] Scope quoted statements `meta.quoted` Align with quoted expressions * [ShellScript] Improve ZSH extended glob support * [ShellScript] Align pattern group scopes with RegExp syntax * [ShellScript] Tidy up and simplify cmd-args contexts * [ShellScript] Disable KSH_GLOB in ZSH * [ShellScript] Refine case clause patterns This commit... 1. enforces KSH style pattern groups in Bash's case clauses by removing simple parenthesized groups' support. This style is only valid in ZSH. 2. terminate case patterns at eol, if not starting with `(`. 3. handle the tricky case in ZSH of possibly unbalanced parentheses in case clause patterns: - `( group ) pattern ) statements ;;` - `( ( group ) pattern ) statements ;;` * [ShellScript] Refine pattern matching contexts This commit ... 1. introduce a `pattern-common` context for common patterns, which are valid in all sorts and locations of patterns. 2. modifies how `meta.group.regexp` is applied to reduce requirement of duplicated scope names in punctuation patterns. * [ShellScript] Simplify path patterns * [ShellScript] Support interpolation in numbers This commit add support for variable expansion in number to support some examples illustrated in pure bash bible, which convert colors to RGB. ((r=16#${_:0:2},g=16#${_:2:2},b=16#${_:4:2})) Illegal highlighting is dropped, but that's probably even more reliable, especially in scenarios of unknown delimiter or terminator characters. TODO: ZSH floating points are not covered, yet. * [ShellScript] Refine tilde expansions termination This commit adds escaped slash to tilde-expansion terminators. Actually Bash and ZSH behave different here. Bash treats whole string literal, if escaped slash follows tilde. `~\/*` => `~/*` Zsh performs full filename expansion `~\/*` => `/home/<user>/file1 /home/<user>/file2 ...` This commit treats both equally as Bash behavior required to distinguish all patterns in all situations for proper tilde expansion in order to decide whether to highlight subsequent patterns. * [ShellScript] Add a common word-end context Handle word-termination and line continuation in common re-usable context. * [ShellScript] Fix redirection stdio file descriptor * [ShellScript] Special scope for /dev/null * [ShellScript] Higher priority for inout redirections Make sure not to miss <>path over <path * [ShellScript] Fix range vs. redirection in parameter expansions This commit separates zsh glob range (`<1-10>`) patterns into those, which... 1. are used in contexts without redirection support, such as parameter expansion patterns. Incomplete or malformed ranges are scoped literal in parameter expansions. 2. need distinction between redirections and glob ranges. Word related contexts are popped off stack before metachar `<`. Hence each glob range starts a new word. Range detection is restricted to require exactly `< number - number >`, to avoid false positives, especially with stdio redirections like `< -`. In ambiguous situation of `<->`, a range is preferred. This change also fixes scoping of leading and trailing numbers, which are now scoped `meta.string`. * [ShellScript] Align glob operator scopes with regex * [ShellScript] Zsh qualifier ranges undergo arithmetic expansion * [ShellScript] Remove redundant pattern * [ShellScript] Fix Zsh glob qualifier detection in groups This commit restricts zsh glob qualifiers to unquoted top-level patterns. They are not valid in groups, but in array initialization lists. * [ShellScript] Optimize list-end context - removes duplicate `line-continuations` includes - moves `comments` include to `list-end` as it is commonly required * [ShellScript] Reuse variable-subscription This commit just saves some lines of code. * [ShellScript] Refactor case clause pattern This commit turns case clause patterns into a pattern list. It means, patterns may be surrounded by whitespace. * [ShellScript] Split compound command contexts Prepare to re-use body parts of compound commands, individually. * [ShellScript] Refactor redirections Redirections can appear everywhere. As for numbers or strings, a popping version of `redirection` is needed for e.g. assignment r-values. Herestrings are also scoped `meta.redirection` as of this commit. * [ShellScript] Add meta scope for variable assignments May help to implement goto definition for variable bindings * [ShellScript] Reorganize zsh pattern operators * [ShellScript] Improve builtin "read" argument highlighting * [ShellScript] Restrict integer highlighting in literal string contexts Numbers in command arguments are mainly guesswork. Bash/Zsh treat them string, but this syntax scopes valid looking numbers constant.number as it is what users might mainly expect. * [ShellScript] Scope pre-/suffix of brace extensions string * [ShellScript] Fix arithmetic vs. command expansions Fixes #4033 * [ShellScript]: Fix illegal pipe operators This commit ... 1. adds contexts to scope pipe operators illegal within lists, groups and tests. 2. handles the tricky part to distinguish `<1-2>` range operators at the beginning or within expansions, patterns or groups from redirections and literal scoped or illegal pipe operators, while maintaining word boundaries. * [ShellScript] More natural expansion context names * [ShellScript] Fix ZSH glob range meta scope extends * [ShellScript] Scope glob strings `meta.string.glob` This commit assigns `meta.string.glob` scope to strings, which support filename expansions. * [ShellScript] Arithmetic expansions in subscriptions Variable subscriptions undergo arithmetic expansion. * [Makefile] Move extended ShellScript syntax * [ShellScript] Add test patterns to common ZSH examples * [ShellScript] Fix redirection after function definition body * [ShellScript] Fix Groovy syntax tests * [ShellScript] Fix built-in overrides This commit reorganizes statement contexts for built-in commands to be augment-able by local function definitions, while keeping higher priority of reserved words. Reserved words, like `if`, `case`, ... can not be used as identifier for local function definitions, but all other built-in commands can be. As a result `def-anonymous` and `def-function` contexts can be merged. `cmd-coproc` is re-defined as kind of function definition under `def-coproc`. The token `time` is moved to `cmd-control` context and scoped `keyword.control` as it is a reserved word.
This adds support for the new #elifdef and #elifndef preprocessor directives that are a combination of #else with #ifdef or #ifndef. C++, Objective-C, and Objective-C++ are also updated because they derive from the C syntax family as well. This has already made it into recent C and C++ compilers and is part of the C23 and C++23 standards.
This includes most typedefs or macro type aliases from ISO C headers from C99, C11, and C23. A few from time.h were not included because they're just structs and not typedefs.
This was introduced in C23 and adds support for the new type keywords, the new suffixes for the new types, and the new length modifiers for printf and scanf. Furthermore, the existing matching rules for floats was changed to remove the possibility of '1f' being classified as a floating point literal. This is actually considered to be an integral literal with an invalid suffix instead of a floating point literal by all compilers that I know of and such produces compiler errors if such code is compiled.
…4035) * [JavaScript] Fix top-level properties in css tagged template strings Styled components may just contain property value pairs instead of full stylesheets. This commit therefore adjusts extended CSS syntax to support both, selectors and properties in main top-level context. * [JavaScript] Fix selector interpolation This commit excludes prototype from `main` context to ensure it being applied to selectors, property names and property values only. Without this change selectors starting with interpolation `${...}` are not matched correctly. * [JavaScript] Rename embedded syntax definitions This commit names hidden syntaxes `<name> (for ...)` to indicate them not being intended for standalone use.
In batch scripts (but not on the command line itself), `%` is only escaped by another `%`
Function parameter names are now optional in C and C++. Previously the syntax highlighting rules would assume that the last identifier found in a parameter was the parameter name but this was making it impossible to properly highlight parameters without a parameter name. The only solution I could find was to include the specific types and modifiers before the more general match for the parameter name. With this, the types and modifiers are no longer mistaken for a parameter name.
This commit... 1. fixes image tags not being recognized if name contains - backslashes - code spans with content like ``` `` ``` 2. optimizes patterns and fixes some possible backtracking issues Syntax test file is parsed 7% faster.
This is useful for server-side JS. Especially using one of the following libraries: https://github.com/felixfbecker/node-sql-template-strings https://github.com/blakeembrey/sql-template-tag https://github.com/XeCycle/pg-template-tag Using `version: 1` for the Embedding syntaxes since they need to match the inherited `SQL.sublime-syntax`. It does not currently handle interpolation inside SQL strings.
This commit implements different sets of case clause terminators supported by each shell script dialect: Bash: `;;`, `;&` and `;;&` ZSH: `;;`, `;&` and `;|`
…es (#4098) Add advice to use ST's entire package replacement feature of having an Installed Package with the same name as a shipped package. Co-authored-by: Keith Hall <[email protected]>
Rewrite SQL syntax using inheritance to support MySQL, PostgreSQL, T-SQL and Cassandra. Note: Postegre is still in a somewhat WIP state using most features of MySQL. Co-authored-by: Johannes Rappen <[email protected]> Co-authored-by: deathaxe <[email protected]> Co-authored-by: DeathAxe <[email protected]> Co-authored-by: Aziz Köksal <[email protected]> Co-authored-by: Keith Hall <[email protected]>
This updates hexadecimal floats to follow a design similar to the new decimal float syntax. As a byproduct of the update, it also now matches the latest suffixes added in more recent C standards.
- Use BasicObject for Ruby BlankSlate since `BasicObject` is available as of Ruby v1.9[^1]. - Change tabTrigger from `cla` to `clab` since we already have some snippets triggered by `cla` - Simplify snippet file name [^1]: https://ruby-doc.org/core-1.9.3/BasicObject.html
This commit disables `html` snippet in ... - comments - literal or interpolated strings - embedded or interpolated code blocks (from template languages) - HTML tags - Markdown files (but not in fenced code blocks) Using `- text.html <scope>` in order to only exclude scopes belonging to possibly embedded HTML code block in question. This is required to enable snippets if HTML is embedded in `source` code, source.astro text.html but disable it in embedded CSS/JS or any other source code. text.html source.css
Resolves #3988 This commit implements string interpolation according to https://dlang.org/spec/istring.html
Addresses some issues described in #3512 with least effort. It may not address all theoretical edge cases though. Especially meta scopes don't follow guidelines by any means, so seriously fixing issues would probably end up in significant refactoring, which is not scope of this commit/PR.
This commit excludes `prototype` from various contexts which expect special tokens. It's unlikely or even unwanted to match arbitrary patterns there. It finally saves a couple of bytes in compiled inherited syntaxes.
This commit updates manual installation hints by removing ST3 version number.
Workaround for sublimehq/sublime_text#6539 until it is fixed upstream.
This commit removes dummy XSL syntax definition in favor of fully featured https://github.com/SublimeText/XSL package.
Co-authored-by: Keith Hall <[email protected]>
C23 added this feature previously available in C++. This should close #3972 as well as both C and C++ now have syntax support for the ' digit separator. This was implemented by just copying the digit variables from the C++ syntax file as it is the same construct in the end. The existing tests were updated to fix the part of the existing tests were broken by this new feature. Furthermore, some tests from C++ were adapted for C to add better testing for the new digit seperator. I also included tests for the newer base 2 integer contants. The C file did not have any tests for that yet. Co-authored-by: deathaxe <[email protected]>
This commit... 1. excludes Default/ and User/ packages That's useful if whole repository is cloned to `${stdatadir}/Packages` to test/develop all bundled packages in a single ST instance. Make sure never to add a package with such special name to this repo. 2. excludes known python cache files as they are never to be published, if auto-created by any tool by accident.
* [JavaScript] Fix interpolation punctuation scope This commit renames `punctuation.definition.interpolation` scope to `punctuation.section.interpolation` to comply with scope naming guidelines. * [JavaScript] Use named contexts for JSX interpolation
This commit adds support 1. for REPLACE see: https://dev.mysql.com/doc/refman/8.4/en/replace.html 2. for INSERT without INTO see: https://dev.mysql.com/doc/refman/8.4/en/insert.html
This commit updates default HTML completions selector to 1. enable them, if HTML is embedded in source code Current `text.html - source` disables completions if HTML is embedded resulting in e.g. `source.astro text.html`. 2. but still disable them in embedded CSS/JS/JSON/... source code by `text.html - text.html source` 3. disable them in embedded/interpolated template tags 4. merges Markdown specific selectors into first line by `text.html ... - (text.html.markdown - markup.raw.code-fence text.html)` in order to avoid duplicating all negative selectors again. For those who want HTML tag completions in Markdown, they can remove that part.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )