diff --git a/messages.json b/messages.json index 64087fd..468f7d5 100644 --- a/messages.json +++ b/messages.json @@ -28,5 +28,6 @@ "2.19.0": "messages/2.19.0.txt", "2.19.1": "messages/2.19.1.txt", "2.19.2": "messages/2.19.2.txt", - "2.20.0": "messages/2.20.0.txt" + "2.20.0": "messages/2.20.0.txt", + "2.21.1": "messages/2.21.1.txt" } diff --git a/messages/2.21.1.txt b/messages/2.21.1.txt new file mode 100644 index 0000000..68374e3 --- /dev/null +++ b/messages/2.21.1.txt @@ -0,0 +1,4 @@ +# Bug Fixes +Much better syntax highlighting for requester files, thanks to @jcberquist! + +Also, fixed bug in explore request command, which choked on requests with a dangling, trailing comma. diff --git a/syntax/requester-source-identifiers.tmPreferences b/syntax/requester-source-identifiers.tmPreferences index 74ef3ab..cd0b757 100644 --- a/syntax/requester-source-identifiers.tmPreferences +++ b/syntax/requester-source-identifiers.tmPreferences @@ -12,8 +12,7 @@ 1 symbolTransformation - s/(requests\.)?(get|options|head|post|put|patch|delete)(.*)/\U\2\E:\3/g; - s/\(/ /g; + s/.*?(get|options|head|post|put|patch|delete)\s*\(\s*(.*)/\U\1\E: \2/g; diff --git a/syntax/requester-source.sublime-syntax b/syntax/requester-source.sublime-syntax index e946044..538ab0f 100644 --- a/syntax/requester-source.sublime-syntax +++ b/syntax/requester-source.sublime-syntax @@ -13,8 +13,11 @@ contexts: push: env - match: "^(?=##)" push: header - - match: ^(?=([\w_][\w\d_]*\.)?(get|options|head|post|put|patch|delete)) - push: identifier + - match: ^([\w_][\w\d_]*\.)?(get|options|head|post|put|patch|delete)\s*(\() + captures: + 2: variable.function.python + 3: punctuation.section.arguments.begin.python + push: [function-call, identifier] env: - match: "\n" @@ -28,13 +31,16 @@ contexts: - match: .* scope: storage.header.requester + function-call: + - meta_scope: meta.function-call.python + - match: \) + scope: punctuation.section.arguments.end.python + pop: true + - include: "Packages/Python/Python.sublime-syntax#arguments" + identifier: - - meta_content_scope: meta.identifier.requester - - match: "[,)]" + - meta_scope: meta.identifier.requester + - match: (?=[,)]) pop: true - - match: "'.*?'" - scope: string.quoted.single.python - - match: '".*?"' - scope: string.quoted.double.python - - match: '\+' - scope: keyword.operator.arithmetic.python + - include: "Packages/Python/Python.sublime-syntax#arguments" +