diff --git a/CHANGELOG.md b/CHANGELOG.md index e9f2f09..9bddbae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.2.2] - 2023-09-28 + +- Syntax highlighting: + + Fix: `break`, `continue` are not highlighted when the label name begins with a keyword. + ## [1.2.1] - 2023-09-27 - Syntax highlighting: diff --git a/dist/CHANGELOG.md b/dist/CHANGELOG.md index e9f2f09..9bddbae 100644 --- a/dist/CHANGELOG.md +++ b/dist/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.2.2] - 2023-09-28 + +- Syntax highlighting: + + Fix: `break`, `continue` are not highlighted when the label name begins with a keyword. + ## [1.2.1] - 2023-09-27 - Syntax highlighting: diff --git a/dist/livescript-vscode-1.2.1.vsix b/dist/livescript-vscode-1.2.2.vsix similarity index 85% rename from dist/livescript-vscode-1.2.1.vsix rename to dist/livescript-vscode-1.2.2.vsix index 3612bd7..8bdcb23 100644 Binary files a/dist/livescript-vscode-1.2.1.vsix and b/dist/livescript-vscode-1.2.2.vsix differ diff --git a/dist/package.json b/dist/package.json index 1768d8d..14d1305 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1 +1 @@ -{"name":"livescript-vscode","version":"1.2.1","displayName":"LiveScript 2","description":"Syntax highlighting, autocomplete, and snippets","icon":"./icon.png","publisher":"tientq64","author":{"name":"tientq64","email":"tientq64@gmail.com","url":"https://github.com/tientq64"},"repository":{"type":"git","url":"https://github.com/tientq64/livescript-vscode.git"},"bugs":{"url":"https://github.com/tientq64/livescript-vscode/issues","email":"tientq64@gmail.com"},"engines":{"vscode":"^1.74.0"},"categories":["Programming Languages","Snippets"],"keywords":["livescript","syntax-highlighting","autocomplete","snippets","vscode-extension"],"scripts":{"build-and-publish":"ls2 build.ls && cd dist && vsce publish"},"devDependencies":{"fs-extra":"^11.1.1","livescript2":"^1.5.0","terser":"^5.20.0","js-yaml":"^4.1.0","@vscode/vsce":"^2.21.0"},"contributes":{"languages":[{"id":"livescript","aliases":["LiveScript"],"extensions":[".ls",".livescript"],"configuration":"./language-configuration.json"}],"grammars":[{"language":"livescript","scopeName":"source.livescript","path":"./syntaxes/livescript.tmLanguage.json"}],"snippets":[{"language":"livescript","path":"./snippets/livescript.code-snippets"}]},"license":"MIT"} +{"name":"livescript-vscode","version":"1.2.2","displayName":"LiveScript 2","description":"Syntax highlighting, autocomplete, and snippets","icon":"./icon.png","publisher":"tientq64","author":{"name":"tientq64","email":"tientq64@gmail.com","url":"https://github.com/tientq64"},"repository":{"type":"git","url":"https://github.com/tientq64/livescript-vscode.git"},"bugs":{"url":"https://github.com/tientq64/livescript-vscode/issues","email":"tientq64@gmail.com"},"engines":{"vscode":"^1.74.0"},"categories":["Programming Languages","Snippets"],"keywords":["livescript","syntax-highlighting","autocomplete","snippets","vscode-extension"],"scripts":{"build-and-publish":"ls2 build.ls && cd dist && vsce publish"},"devDependencies":{"fs-extra":"^11.1.1","livescript2":"^1.5.0","terser":"^5.20.0","js-yaml":"^4.1.0","@vscode/vsce":"^2.21.0"},"contributes":{"languages":[{"id":"livescript","aliases":["LiveScript"],"extensions":[".ls",".livescript"],"configuration":"./language-configuration.json"}],"grammars":[{"language":"livescript","scopeName":"source.livescript","path":"./syntaxes/livescript.tmLanguage.json"}],"snippets":[{"language":"livescript","path":"./snippets/livescript.code-snippets"}]},"license":"MIT"} diff --git a/dist/syntaxes/livescript.tmLanguage.json b/dist/syntaxes/livescript.tmLanguage.json index 5d8a55b..495bc39 100644 --- a/dist/syntaxes/livescript.tmLanguage.json +++ b/dist/syntaxes/livescript.tmLanguage.json @@ -1 +1 @@ -{"scopeName":"source.livescript","patterns":[{"include":"#expr"}],"repository":{"expr":{"patterns":[{"include":"#string-triple-single"},{"include":"#string-triple-double"},{"include":"#string-single"},{"include":"#string-double"},{"include":"#string-backslash"},{"include":"#list-words"},{"include":"#embed-backtick"},{"include":"#comment-line"},{"include":"#comment-block"},{"include":"#heregex"},{"include":"#regexp"},{"include":"#function-arrow"},{"include":"#number"},{"include":"#static-methods"},{"include":"#proto-methods"},{"include":"#property"},{"include":"#label"},{"include":"#operator"},{"include":"#function-named"},{"include":"#class"},{"include":"#declare"},{"include":"#storage"},{"include":"#constant"},{"include":"#keyword"},{"include":"#window-props"},{"include":"#window-methods"},{"include":"#punctuation"},{"include":"#variable"}]},"string-triple-single":{"patterns":[{"begin":"\\'''","end":"\\'''","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.single.livescript","patterns":[{"include":"#string-escape"}]}]},"string-triple-double":{"patterns":[{"begin":"\\\"\"\"","end":"\\\"\"\"","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.double.livescript","patterns":[{"include":"#string-escape"},{"include":"#string-interpolate"}]}]},"string-single":{"patterns":[{"begin":"\\'","end":"\\'","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.single.livescript","patterns":[{"include":"#string-escape"}]}]},"string-double":{"patterns":[{"begin":"\\\"","end":"\\\"","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.double.livescript","patterns":[{"include":"#string-escape"},{"include":"#string-interpolate"}]}]},"string-backslash":{"patterns":[{"match":"(\\\\)(\\S[^,;)\\]}\\s]*)","name":"string.other.livescript","captures":{"1":{"name":"punctuation.livescript"},"2":{"patterns":[{"include":"#string-escape"},{"match":"\\\\$","name":"constant.character.escape.livescript"}]}}}]},"string-escape":{"patterns":[{"match":"\\\\u\\{(?:10[\\da-fA-F]{4}|[\\da-fA-F]{1,5})\\}","name":"constant.character.escape.livescript"},{"match":"\\\\u[\\da-fA-F]{4}","name":"constant.character.escape.livescript"},{"match":"\\\\x[\\da-fA-F]{2}","name":"constant.character.escape.livescript"},{"match":"\\\\.","name":"constant.character.escape.livescript"}]},"string-interpolate":{"patterns":[{"begin":"\\#{","end":"\\}","captures":{"0":{"name":"variable.parameter.livescript"}},"patterns":[{"include":"#expr"}]},{"match":"\\#(?:@?[a-zA-Z_$][\\w$]*|@\\d*)","name":"variable.parameter.livescript"}]},"list-words":{"patterns":[{"begin":"<\\[","end":"\\]>","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.other.livescript","patterns":[{"include":"#string-escape"}]}]},"embed-backtick":{"patterns":[{"begin":"\\``","end":"\\``","captures":{"0":{"name":"punctuation.livescript"}},"patterns":[{"include":"source.js"}]}]},"comment-line":{"patterns":[{"match":"\\#.*","name":"comment.line.number-sign.livescript"}]},"comment-block":{"patterns":[{"begin":"/\\*","end":"\\*/","name":"comment.block.livescript"}]},"heregex":{"patterns":[{"begin":"//","end":"//[dgimsuy]{0,7}","captures":{"0":{"name":"keyword.other.livescript"}},"name":"string.regexp.livescript","patterns":[{"include":"#heregex-content"}]}]},"heregex-content":{"patterns":[{"match":"\\\\.","name":"constant.character.escape.livescript"},{"match":"\\.","name":"constant.other.livescript"},{"match":"[+*?^$]","name":"keyword.other.livescript"},{"match":"\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}","name":"keyword.other.livescript"},{"match":" #.*","name":"comment.line.number-sign.livescript"},{"begin":"(\\[)(\\^)?-?","end":"-?(\\])","beginCaptures":{"1":{"name":"keyword.other.livescript"},"2":{"name":"keyword.other.livescript"}},"endCaptures":{"1":{"name":"keyword.other.livescript"}},"patterns":[{"match":"\\\\.","name":"constant.character.escape.livescript"},{"match":"\\-","name":"keyword.operator.livescript"}]},{"begin":"\\((\\?(>?\\*?)","captures":{"1":{"name":"punctuation.accessor.livescript"},"2":{"name":"entity.name.function.livescript"},"3":{"name":"entity.name.function.livescript"},"4":{"name":"keyword.operator.livescript"},"5":{"name":"punctuation.definition.parameters.begin.livescript"},"6":{"patterns":[{"include":"#expr"}]},"7":{"name":"punctuation.definition.parameters.end.livescript"},"8":{"name":"keyword.other.livescript"}}}]},"number":{"patterns":[{"match":"\\d\\d?~[\\da-zA-Z]+","name":"constant.numeric.livescript"},{"match":"\\d+n","name":"constant.numeric.livescript"},{"match":"\\d+(\\.\\d+)?([eE]-?\\d+)?[\\w$]*","name":"constant.numeric.livescript"}]},"static-methods":{"patterns":[{"match":"(?>>?|<<|[&|^])\\.|<<|>>|\\|>|<\\||[<>]\\?|&&|\\|\\|?|\\^\\^?|[<>]=?|[+\\-*/%!?=~]","name":"keyword.operator.livescript"},{"match":"(is|isnt|and|x?or|not|delete|typeof|instanceof)(?![\\w$])","name":"keyword.operator.livescript"}]},"function-named":{"patterns":[{"match":"(!)?(function) +([a-zA-Z_$][\\w$]*)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"keyword.control.livescript"},"3":{"name":"entity.name.function.livescript"}}}]},"class":{"patterns":[{"match":"(class) +(extends) +([a-zA-Z_$][\\w$]*)(?: +(implements) +(.+))?","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"storage.modifier.livescript"},"3":{"name":"storage.type.livescript"},"4":{"name":"storage.modifier.livescript"},"5":{"patterns":[{"include":"#class-implements"}]}}},{"match":"(class) +(implements) +(.+)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"storage.modifier.livescript"},"3":{"patterns":[{"include":"#class-implements"}]}}},{"match":"(class) +([a-zA-Z_$][\\w$]*)(?: +(extends) +([a-zA-Z_$][\\w$]*))?(?: +(implements) +(.+))?","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"entity.name.function.livescript"},"3":{"name":"storage.modifier.livescript"},"4":{"name":"storage.type.livescript"},"5":{"name":"storage.modifier.livescript"},"6":{"patterns":[{"include":"#class-implements"}]}}}]},"class-implements":{"patterns":[{"match":"\\,","name":"punctuation.separator.comma.livescript"},{"match":"[a-zA-Z_$][\\w$]*","name":"storage.type.livescript"}]},"declare":{"patterns":[{"match":"(const) ([a-zA-Z_$][\\w$]*)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"constant.language.livescript"}}}]},"storage":{"patterns":[{"match":"(arguments|this|that|super|it|e|_)(?![\\w$])","name":"storage.type.livescript"},{"match":"(&)(?!&)","name":"storage.type.livescript"}]},"constant":{"patterns":[{"match":"(yes|no|true|false|on|off|void|null|undefined|NaN|Infinity)(?![\\w$])","name":"constant.language.livescript"}]},"keyword":{"patterns":[{"match":"(if|unless|then|else|switch|match|case|default|otherwise|fallthrough|for|own|ever|from|to|til|by|when|while|until|loop|in|of|let|do|var|const|break|continue|return|yield|await|try|catch|finally|throw|new|with|debugger|function|class|extends|implements)(?![\\w$])","name":"keyword.control.livescript"}]},"window-props":{"patterns":[{"match":"(window|document|location|navigator|screen|history|localStorage|sessionStorage|console|process|module|livescript|stylus|m|fs|vscode|dayjs|\\$|os)(?![\\w$])","name":"storage.type.livescript"}]},"window-methods":{"patterns":[{"match":"(parseFloat|parseInt|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|unescape|eval|isFinite|isNaN|webkitURL|webkitRTCPeerConnection|webkitMediaStream|alert|atob|blur|btoa|cancelAnimationFrame|cancelIdleCallback|captureEvents|clearInterval|clearTimeout|close|confirm|createImageBitmap|fetch|find|focus|getComputedStyle|getSelection|matchMedia|moveBy|moveTo|open|postMessage|print|prompt|queueMicrotask|releaseEvents|reportError|requestAnimationFrame|requestIdleCallback|resizeBy|resizeTo|scroll|scrollBy|scrollTo|setInterval|setTimeout|stop|structuredClone|webkitCancelAnimationFrame|webkitRequestAnimationFrame|getScreenDetails|openDatabase|queryLocalFonts|showDirectoryPicker|showOpenFilePicker|showSaveFilePicker|webkitSpeechGrammar|webkitSpeechGrammarList|webkitSpeechRecognition|webkitSpeechRecognitionError|webkitSpeechRecognitionEvent|webkitRequestFileSystem|webkitResolveLocalFileSystemURL|require|import)(?![\\w$])","name":"entity.name.function.livescript"}]},"punctuation":{"patterns":[{"match":"\\.","name":"punctuation.accessor.livescript"},{"match":"\\,","name":"punctuation.separator.comma.livescript"},{"match":"\\;","name":"punctuation.terminator.statement.livescript"}]},"variable":{"patterns":[{"match":"[A-Z][A-Z0-9_$]*(?![\\w$])","name":"constant.language.livescript"},{"match":"[A-Z][\\w$]+(?![\\w$])","name":"storage.type.livescript"},{"match":"[a-zA-Z_$][\\w$]*","name":"variable.other.livescript"}]}}} +{"scopeName":"source.livescript","patterns":[{"include":"#expr"}],"repository":{"expr":{"patterns":[{"include":"#string-triple-single"},{"include":"#string-triple-double"},{"include":"#string-single"},{"include":"#string-double"},{"include":"#string-backslash"},{"include":"#list-words"},{"include":"#embed-backtick"},{"include":"#comment-line"},{"include":"#comment-block"},{"include":"#heregex"},{"include":"#regexp"},{"include":"#function-arrow"},{"include":"#number"},{"include":"#static-methods"},{"include":"#proto-methods"},{"include":"#property"},{"include":"#label"},{"include":"#operator"},{"include":"#function-named"},{"include":"#class"},{"include":"#declare"},{"include":"#storage"},{"include":"#constant"},{"include":"#keyword"},{"include":"#window-props"},{"include":"#window-methods"},{"include":"#punctuation"},{"include":"#variable"}]},"string-triple-single":{"patterns":[{"begin":"\\'''","end":"\\'''","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.single.livescript","patterns":[{"include":"#string-escape"}]}]},"string-triple-double":{"patterns":[{"begin":"\\\"\"\"","end":"\\\"\"\"","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.double.livescript","patterns":[{"include":"#string-escape"},{"include":"#string-interpolate"}]}]},"string-single":{"patterns":[{"begin":"\\'","end":"\\'","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.single.livescript","patterns":[{"include":"#string-escape"}]}]},"string-double":{"patterns":[{"begin":"\\\"","end":"\\\"","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.double.livescript","patterns":[{"include":"#string-escape"},{"include":"#string-interpolate"}]}]},"string-backslash":{"patterns":[{"match":"(\\\\)(\\S[^,;)\\]}\\s]*)","name":"string.other.livescript","captures":{"1":{"name":"punctuation.livescript"},"2":{"patterns":[{"include":"#string-escape"},{"match":"\\\\$","name":"constant.character.escape.livescript"}]}}}]},"string-escape":{"patterns":[{"match":"\\\\u\\{(?:10[\\da-fA-F]{4}|[\\da-fA-F]{1,5})\\}","name":"constant.character.escape.livescript"},{"match":"\\\\u[\\da-fA-F]{4}","name":"constant.character.escape.livescript"},{"match":"\\\\x[\\da-fA-F]{2}","name":"constant.character.escape.livescript"},{"match":"\\\\.","name":"constant.character.escape.livescript"}]},"string-interpolate":{"patterns":[{"begin":"\\#{","end":"\\}","captures":{"0":{"name":"variable.parameter.livescript"}},"patterns":[{"include":"#expr"}]},{"match":"\\#(?:@?[a-zA-Z_$][\\w$]*|@\\d*)","name":"variable.parameter.livescript"}]},"list-words":{"patterns":[{"begin":"<\\[","end":"\\]>","captures":{"0":{"name":"punctuation.livescript"}},"name":"string.quoted.other.livescript","patterns":[{"include":"#string-escape"}]}]},"embed-backtick":{"patterns":[{"begin":"\\``","end":"\\``","captures":{"0":{"name":"punctuation.livescript"}},"patterns":[{"include":"source.js"}]}]},"comment-line":{"patterns":[{"match":"\\#.*","name":"comment.line.number-sign.livescript"}]},"comment-block":{"patterns":[{"begin":"/\\*","end":"\\*/","name":"comment.block.livescript"}]},"heregex":{"patterns":[{"begin":"//","end":"//[dgimsuy]{0,7}","captures":{"0":{"name":"keyword.other.livescript"}},"name":"string.regexp.livescript","patterns":[{"include":"#heregex-content"}]}]},"heregex-content":{"patterns":[{"match":"\\\\.","name":"constant.character.escape.livescript"},{"match":"\\.","name":"constant.other.livescript"},{"match":"[+*?^$]","name":"keyword.other.livescript"},{"match":"\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}","name":"keyword.other.livescript"},{"match":" #.*","name":"comment.line.number-sign.livescript"},{"begin":"(\\[)(\\^)?-?","end":"-?(\\])","beginCaptures":{"1":{"name":"keyword.other.livescript"},"2":{"name":"keyword.other.livescript"}},"endCaptures":{"1":{"name":"keyword.other.livescript"}},"patterns":[{"match":"\\\\.","name":"constant.character.escape.livescript"},{"match":"\\-","name":"keyword.operator.livescript"}]},{"begin":"\\((\\?(>?\\*?)","captures":{"1":{"name":"punctuation.accessor.livescript"},"2":{"name":"entity.name.function.livescript"},"3":{"name":"entity.name.function.livescript"},"4":{"name":"keyword.operator.livescript"},"5":{"name":"punctuation.definition.parameters.begin.livescript"},"6":{"patterns":[{"include":"#expr"}]},"7":{"name":"punctuation.definition.parameters.end.livescript"},"8":{"name":"keyword.other.livescript"}}}]},"number":{"patterns":[{"match":"\\d\\d?~[\\da-zA-Z]+","name":"constant.numeric.livescript"},{"match":"\\d+n","name":"constant.numeric.livescript"},{"match":"\\d+(\\.\\d+)?([eE]-?\\d+)?[\\w$]*","name":"constant.numeric.livescript"}]},"static-methods":{"patterns":[{"match":"(?>>?|<<|[&|^])\\.|<<|>>|\\|>|<\\||[<>]\\?|&&|\\|\\|?|\\^\\^?|[<>]=?|[+\\-*/%!?=~]","name":"keyword.operator.livescript"},{"match":"(is|isnt|and|x?or|not|delete|typeof|instanceof)(?![\\w$])","name":"keyword.operator.livescript"}]},"function-named":{"patterns":[{"match":"(!)?(function) +([a-zA-Z_$][\\w$]*)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"keyword.control.livescript"},"3":{"name":"entity.name.function.livescript"}}}]},"class":{"patterns":[{"match":"(class) +(extends) +([a-zA-Z_$][\\w$]*)(?: +(implements) +(.+))?","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"storage.modifier.livescript"},"3":{"name":"storage.type.livescript"},"4":{"name":"storage.modifier.livescript"},"5":{"patterns":[{"include":"#class-implements"}]}}},{"match":"(class) +(implements) +(.+)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"storage.modifier.livescript"},"3":{"patterns":[{"include":"#class-implements"}]}}},{"match":"(class) +([a-zA-Z_$][\\w$]*)(?: +(extends) +([a-zA-Z_$][\\w$]*))?(?: +(implements) +(.+))?","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"entity.name.function.livescript"},"3":{"name":"storage.modifier.livescript"},"4":{"name":"storage.type.livescript"},"5":{"name":"storage.modifier.livescript"},"6":{"patterns":[{"include":"#class-implements"}]}}}]},"class-implements":{"patterns":[{"match":"\\,","name":"punctuation.separator.comma.livescript"},{"match":"[a-zA-Z_$][\\w$]*","name":"storage.type.livescript"}]},"declare":{"patterns":[{"match":"(const) ([a-zA-Z_$][\\w$]*)","captures":{"1":{"name":"keyword.control.livescript"},"2":{"name":"constant.language.livescript"}}}]},"storage":{"patterns":[{"match":"(arguments|this|that|super|it|e|_)(?![\\w$])","name":"storage.type.livescript"},{"match":"(&)(?!&)","name":"storage.type.livescript"}]},"constant":{"patterns":[{"match":"(yes|no|true|false|on|off|void|null|undefined|NaN|Infinity)(?![\\w$])","name":"constant.language.livescript"}]},"keyword":{"patterns":[{"match":"(if|unless|then|else|switch|match|case|default|otherwise|fallthrough|for|own|ever|from|to|til|by|when|while|until|loop|in|of|let|do|var|const|break|continue|return|yield|await|try|catch|finally|throw|new|with|debugger|function|class|extends|implements)(?![\\w$])","name":"keyword.control.livescript"}]},"window-props":{"patterns":[{"match":"(window|document|location|navigator|screen|history|localStorage|sessionStorage|console|process|module|livescript|stylus|m|fs|vscode|dayjs|\\$|os)(?![\\w$])","name":"storage.type.livescript"}]},"window-methods":{"patterns":[{"match":"(parseFloat|parseInt|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|unescape|eval|isFinite|isNaN|webkitURL|webkitRTCPeerConnection|webkitMediaStream|alert|atob|blur|btoa|cancelAnimationFrame|cancelIdleCallback|captureEvents|clearInterval|clearTimeout|close|confirm|createImageBitmap|fetch|find|focus|getComputedStyle|getSelection|matchMedia|moveBy|moveTo|open|postMessage|print|prompt|queueMicrotask|releaseEvents|reportError|requestAnimationFrame|requestIdleCallback|resizeBy|resizeTo|scroll|scrollBy|scrollTo|setInterval|setTimeout|stop|structuredClone|webkitCancelAnimationFrame|webkitRequestAnimationFrame|getScreenDetails|openDatabase|queryLocalFonts|showDirectoryPicker|showOpenFilePicker|showSaveFilePicker|webkitSpeechGrammar|webkitSpeechGrammarList|webkitSpeechRecognition|webkitSpeechRecognitionError|webkitSpeechRecognitionEvent|webkitRequestFileSystem|webkitResolveLocalFileSystemURL|require|import)(?![\\w$])","name":"entity.name.function.livescript"}]},"punctuation":{"patterns":[{"match":"\\.","name":"punctuation.accessor.livescript"},{"match":"\\,","name":"punctuation.separator.comma.livescript"},{"match":"\\;","name":"punctuation.terminator.statement.livescript"}]},"variable":{"patterns":[{"match":"[A-Z][A-Z0-9_$]*(?![\\w$])","name":"constant.language.livescript"},{"match":"[A-Z][\\w$]+(?![\\w$])","name":"storage.type.livescript"},{"match":"[a-zA-Z_$][\\w$]*","name":"variable.other.livescript"}]}}} diff --git a/package.json b/package.json index b0cdd55..e50dffa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "livescript-vscode", - "version": "1.2.1", + "version": "1.2.2", "displayName": "LiveScript 2", "description": "Syntax highlighting, autocomplete, and snippets", "icon": "./icon.png", diff --git a/sample.ls b/sample.ls index 3005223..f567b2b 100644 --- a/sample.ls +++ b/sample.ls @@ -182,6 +182,18 @@ nam3~10 = -> :build loop break build + break if + break if a > 0 + break ifaa + break if44 + break if$ + break if_ + break aaif + break 44if + break $if + break _if + break and + break class A obj = if: 4 diff --git a/syntaxes/livescript.tmLanguage.yaml b/syntaxes/livescript.tmLanguage.yaml index d442f4b..8dbb2d5 100644 --- a/syntaxes/livescript.tmLanguage.yaml +++ b/syntaxes/livescript.tmLanguage.yaml @@ -339,13 +339,13 @@ repository: label: patterns: - - match: (:)(?!<>)(<>) + - match: (:)(?!(?:<>)(?![\w$]))(<>) captures: 1: name: punctuation.separator.label.livescript 2: name: entity.name.label.livescript - - match: (break|continue)\s+(?!<>)(<>) + - match: (break|continue)\s+(?!(?:<>)(?![\w$]))(<>) captures: 1: name: keyword.control.livescript