File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 43
43
:risky t
44
44
:group 'lsp-graphql )
45
45
46
+ (defcustom lsp-graphql-target-file-extensions '(" ts" " js" " jsx" " tsx" " vue" " graphql" " graphqls" " gql" )
47
+ " List of target file extensions for the GraphQL language server."
48
+ :type '(repeat string)
49
+ :group 'lsp-graphql )
50
+
46
51
(defun lsp-graphql-activate-p (filename &optional _ )
47
52
" Check if the GraphQL language server should be enabled based on FILENAME."
48
- (or ( string-match-p ( rx (one-or-more anything) " . "
49
- (or " ts " " js " " jsx " " tsx " " vue " " graphql " " gql " )eos )
50
- filename )
51
- ( and (derived-mode-p 'js -mode 'js2-mode 'typescript-mode 'typescript-ts-mode )
52
- ( not ( derived-mode-p 'json-mode )))))
53
+ (let ((target-extensions ( mapconcat 'identity lsp-graphql-target-file-extensions " \\ | " )))
54
+ (or ( string-match-p ( format " \\ . %s \\ ' " target-extensions) filename )
55
+ ( and ( derived-mode-p 'js-mode 'js2-mode 'typescript-mode 'typescript-ts-mode )
56
+ ( not (derived-mode-p 'json -mode ))))) )
57
+
53
58
54
59
(lsp-register-client
55
60
(make-lsp-client :new-connection (lsp-stdio-connection (lambda ()
You can’t perform that action at this time.
0 commit comments