branch: elpa/graphql-mode
commit 3c25bf5cbd5ba4c60dca9c96286412eb765de7c9
Author: David Vazquez Pua <[email protected]>
Commit: David Vazquez Pua <[email protected]>
Adapt more regexs to understand _ as part f symbols
---
graphql-mode.el | 8 ++++----
test/schema.graphql | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index 0dd61afdb7..aa8879623c 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -174,7 +174,7 @@ response from the server."
;; the search can continue.
((graphql--in-arguments-p)
(let* ((end (save-excursion (up-list) (point)))
- (match (search-forward-regexp "\\(\\w+\\):" end t)))
+ (match (search-forward-regexp "\\(\\_<.+?\\_>\\):" end t)))
(if match
;; unless we are inside a string or comment
(let ((state (syntax-ppss)))
@@ -209,14 +209,14 @@ response from the server."
(,(regexp-opt graphql-constants) . font-lock-constant-face)
;; Variables
- ("\\$\\w+" . font-lock-variable-name-face)
+ ("\\$\\_<.+?\\_>" . font-lock-variable-name-face)
;; Types
- (":[[:space:]]*\\[?\\(\\w+\\)\\]?"
+ (":[[:space:]]*\\[?\\(\\_<.+?\\_>\\)\\]?"
(1 font-lock-type-face))
;; Directives
- ("@\\w+" . font-lock-keyword-face)
+ ("@\\_<.+?\\_>" . font-lock-keyword-face)
;; Field parameters
(graphql--field-parameter-matcher
diff --git a/test/schema.graphql b/test/schema.graphql
index 85d77c0566..e63a0f65ab 100644
--- a/test/schema.graphql
+++ b/test/schema.graphql
@@ -1,8 +1,8 @@
type Query {
- person(id: ID): Person
+ person(id: ID): Person_type
}
-type Person {
+type Person_type {
name: String
- friends: [Person]
+ friends_foo: [Person_fo]
}