emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/graphql-mode 3c25bf5cbd 040/122: Adapt more regexs to unde


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode 3c25bf5cbd 040/122: Adapt more regexs to understand _ as part f symbols
Date: Sat, 29 Jan 2022 08:03:31 -0500 (EST)

branch: elpa/graphql-mode
commit 3c25bf5cbd5ba4c60dca9c96286412eb765de7c9
Author: David Vazquez Pua <dvazquezpua@deloitte.nl>
Commit: David Vazquez Pua <dvazquezpua@deloitte.nl>

    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]
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]