[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/graphql-mode d0a85fe1d3 067/122: Shorten long lines
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/graphql-mode d0a85fe1d3 067/122: Shorten long lines |
Date: |
Sat, 29 Jan 2022 08:03:33 -0500 (EST) |
branch: elpa/graphql-mode
commit d0a85fe1d378d8819b30b33b9c8423802c305884
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Shorten long lines
---
graphql-mode.el | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index 464ce0f808..15e0e3d036 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -97,16 +97,18 @@ QUERY query definition(s) of query, mutation, and/or
subscription
OPERATION name of the operation if multiple definition is given in QUERY
VARIABLES list of variables for query operation"
(let* ((body (graphql-encode-json query operation variables))
- (response (request url
- :type "POST"
- :data body
- :headers '(("Content-Type" . "application/json"))
- :parser 'json-read
- :sync t
- :complete (lambda (&rest _)
- (message "%s" (if (string-equal ""
operation)
- url
- (format
"%s?operationName=%s" url operation)))))))
+ (response (request
+ url
+ :type "POST"
+ :data body
+ :headers '(("Content-Type" . "application/json"))
+ :parser 'json-read
+ :sync t
+ :complete (lambda (&rest _)
+ (message "%s" (if (string-equal "" operation)
+ url
+ (format "%s?operationName=%s"
+ url operation)))))))
(json-encode (request-response-data response))))
(defun graphql-beginning-of-query ()
@@ -152,7 +154,8 @@ VARIABLES list of variables for query operation"
"Return the name of the current graphql query."
(let* ((query
(save-excursion
- (replace-regexp-in-string "^[ \t\n]*" "" (or
(graphql-current-query) ""))))
+ (replace-regexp-in-string "^[ \t\n]*" ""
+ (or (graphql-current-query) ""))))
(tokens
(split-string query "[ \f\t\n\r\v]+"))
(first (nth 0 tokens)))
@@ -239,7 +242,8 @@ VARIABLES list of variables for query operation"
(goto-char indent-pos))))
(defvar graphql-keywords
- '("type" "input" "interface" "fragment" "query" "enum" "mutation"
"subscription"
+ '("type" "input" "interface" "fragment"
+ "query" "enum" "mutation" "subscription"
"Int" "Float" "String" "Boolean" "ID"
"true" "false" "null"))
@@ -253,7 +257,8 @@ This is the function to be used for the hook
`completion-at-point-functions'."
(defvar graphql-definition-regex
- (concat "\\(" (regexp-opt '("type" "input" "interface" "fragment" "query"
"mutation" "subscription" "enum")) "\\)"
+ (concat "\\(" (regexp-opt '("type" "input" "interface" "fragment" "query"
+ "mutation" "subscription" "enum")) "\\)"
"[[:space:]]+\\(\\_<.+?\\_>\\)")
"Keyword Regular Expressions.")
@@ -344,7 +349,7 @@ This is the function to be used for the hook
`completion-at-point-functions'."
nil
nil))
(setq imenu-generic-expression `((nil ,graphql-definition-regex 2)))
- (add-hook 'completion-at-point-functions 'graphql-completion-at-point nil
'local))
+ (add-hook 'completion-at-point-functions 'graphql-completion-at-point nil t))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.graphql\\'" . graphql-mode))
- [nongnu] elpa/graphql-mode 1bff11f21c 056/122: fix the line-boundary issue to enhance {} sexp, (continued)
- [nongnu] elpa/graphql-mode 1bff11f21c 056/122: fix the line-boundary issue to enhance {} sexp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode ba5952590c 079/122: Merge pull request #22 from cbowdon/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 061d6d0b34 001/122: Initial commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode cbd07029fa 009/122: Better indentation of closing pairs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 096df5b167 005/122: Basic line indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 3965a4c370 046/122: add request dependency, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 52137014df 073/122: Update packages, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode c3471642f5 072/122: Merge pull request #19 from cbowdon/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 880701685d 038/122: Add some types/field to the test schema, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 0f2b4b1604 077/122: Merge branch 'next', ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode d0a85fe1d3 067/122: Shorten long lines,
ELPA Syncer <=
- [nongnu] elpa/graphql-mode 7aa3532aed 026/122: Don't depend on json-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 0b41444096 028/122: Add installation notes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 43434aa6d5 061/122: Format some docs and docstrings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 8b2fe76635 057/122: fix a recursive bug in graphql-current-operation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode f3cfd9fc1e 062/122: Don't send the query as a query parameter, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 301d2419a0 012/122: Prompt the user for the GraphQL, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 17c2150ff6 058/122: rebase branch 'queries support' into branch 'next', ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 83e3a73f21 033/122: Fix: don't add slash between url and query parameters, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 22a4340ec3 044/122: add post body json support: query, operationName, variables, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 41df2a3140 019/122: Add docstring for graphql-mode, ELPA Syncer, 2022/01/29