Skip to content

Commit 5ff264a

Browse files
Reindent all files using .dir-locals.el setup
1 parent e1a9aa2 commit 5ff264a

File tree

5 files changed

+375
-373
lines changed

5 files changed

+375
-373
lines changed

eglot-fsharp.el

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@
108108
(version<= emacs-version "26.2"))
109109
"NORMAL:-VERS-TLS1.3"
110110
gnutls-algorithm-priority))))
111-
(unless (eglot-fsharp-current-version-p version)
112-
(url-copy-file url zip t)
113-
;; FIXME: Windows (unzip preinstalled?)
114-
(let ((default-directory (file-name-directory (eglot-fsharp--path-to-server))))
115-
(unless (zerop (call-process "unzip" nil nil nil "-o" zip))
116-
(error "Failed to unzip %s" zip))
117-
(unless (eq system-type 'windows-nt)
118-
(dolist (file (directory-files-recursively (file-name-directory (eglot-fsharp--path-to-server)) "." t))
119-
(if (file-directory-p file)
120-
(chmod file #o755)
121-
(chmod file #o644)))))
122-
(delete-file zip)))
111+
(unless (eglot-fsharp-current-version-p version)
112+
(url-copy-file url zip t)
113+
;; FIXME: Windows (unzip preinstalled?)
114+
(let ((default-directory (file-name-directory (eglot-fsharp--path-to-server))))
115+
(unless (zerop (call-process "unzip" nil nil nil "-o" zip))
116+
(error "Failed to unzip %s" zip))
117+
(unless (eq system-type 'windows-nt)
118+
(dolist (file (directory-files-recursively (file-name-directory (eglot-fsharp--path-to-server)) "." t))
119+
(if (file-directory-p file)
120+
(chmod file #o755)
121+
(chmod file #o644)))))
122+
(delete-file zip)))
123123

124124

125125
(defun eglot-fsharp--process-tool-action (response)
@@ -169,7 +169,7 @@ Ensure FsAutoComplete is installed (when called INTERACTIVE)."
169169
(t `("mono" ,(eglot-fsharp--path-to-server)))))
170170
(arg-list (if eglot-fsharp-server-verbose
171171
`("--background-service-enabled" "-v")
172-
`("--background-service-enabled")
172+
`("--background-service-enabled")
173173
)))
174174
(cons 'eglot-fsautocomplete (append cmd-list arg-list)))))
175175

fsharp-mode-font.el

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -61,97 +61,97 @@ with initial value INITVALUE and optional DOCSTRING."
6161
(defvar ,sym ,init ,docstring)))
6262

6363
(def-fsharp-compiled-var fsharp-shebang-regexp
64-
"\\(^#!.*?\\)\\([A-Za-z0-9_-]+\\)$"
65-
"Capture the #! and path of a shebag in one group and the
64+
"\\(^#!.*?\\)\\([A-Za-z0-9_-]+\\)$"
65+
"Capture the #! and path of a shebag in one group and the
6666
executable in another.")
6767

6868
(def-fsharp-compiled-var fsharp-access-control-regexp
69-
"private\\s-+\\|internal\\s-+\\|public\\s-+"
70-
"Match `private', `internal', or `public', followed by a space,
69+
"private\\s-+\\|internal\\s-+\\|public\\s-+"
70+
"Match `private', `internal', or `public', followed by a space,
7171
with no capture.")
7272

7373
(def-fsharp-compiled-var fsharp-access-control-regexp-noncapturing
74-
(format "\\(?:%s\\)" fsharp-access-control-regexp)
75-
"Same as `fsharp-access-control-regexp', but captures")
74+
(format "\\(?:%s\\)" fsharp-access-control-regexp)
75+
"Same as `fsharp-access-control-regexp', but captures")
7676

7777
(def-fsharp-compiled-var fsharp-inline-rec-regexp
78-
"inline\\s-+\\|rec\\s-+"
79-
"Match `inline' or `rec', followed by a space.")
78+
"inline\\s-+\\|rec\\s-+"
79+
"Match `inline' or `rec', followed by a space.")
8080

8181
(def-fsharp-compiled-var fsharp-inline-rec-regexp-noncapturing
82-
(format "\\(?:%s\\)" fsharp-inline-rec-regexp)
83-
"Match `inline' or `rec', followed by a space, with no capture.")
82+
(format "\\(?:%s\\)" fsharp-inline-rec-regexp)
83+
"Match `inline' or `rec', followed by a space, with no capture.")
8484

8585
(def-fsharp-compiled-var fsharp-valid-identifier-regexp
86-
"[A-Za-z0-9_']+"
87-
"Match a normal, valid F# identifier -- alphanumeric characters
86+
"[A-Za-z0-9_']+"
87+
"Match a normal, valid F# identifier -- alphanumeric characters
8888
plus ' and underbar. Does not capture")
8989

9090
(def-fsharp-compiled-var fsharp-function-def-regexp
91-
(concat "\\<\\(?:let\\|and\\|with\\)\\s-+"
92-
fsharp-inline-rec-regexp-noncapturing "?"
93-
fsharp-access-control-regexp-noncapturing "*"
94-
(format "\\(%s\\)" fsharp-valid-identifier-regexp)
95-
"\\(?:\\s-+[A-Za-z_]\\|\\s-*(\\)" ;; matches function arguments or open-paren; unclear why 0-9 not in class
96-
))
91+
(concat "\\<\\(?:let\\|and\\|with\\)\\s-+"
92+
fsharp-inline-rec-regexp-noncapturing "?"
93+
fsharp-access-control-regexp-noncapturing "*"
94+
(format "\\(%s\\)" fsharp-valid-identifier-regexp)
95+
"\\(?:\\s-+[A-Za-z_]\\|\\s-*(\\)" ;; matches function arguments or open-paren; unclear why 0-9 not in class
96+
))
9797

9898
(def-fsharp-compiled-var fsharp-pattern-function-regexp
99-
(concat "\\<\\(?:let\\|and\\)\\s-+"
100-
fsharp-inline-rec-regexp-noncapturing "?"
101-
fsharp-access-control-regexp-noncapturing "*"
102-
(format "\\(%s\\)" fsharp-valid-identifier-regexp)
103-
"\\s-*=\\s-*function")
104-
"Matches an implicit matcher, eg let foo m = function | \"cat\" -> etc.")
99+
(concat "\\<\\(?:let\\|and\\)\\s-+"
100+
fsharp-inline-rec-regexp-noncapturing "?"
101+
fsharp-access-control-regexp-noncapturing "*"
102+
(format "\\(%s\\)" fsharp-valid-identifier-regexp)
103+
"\\s-*=\\s-*function")
104+
"Matches an implicit matcher, eg let foo m = function | \"cat\" -> etc.")
105105

106106
;; Note that this regexp is used for iMenu. To font-lock active patterns, we
107107
;; need to use an anchored match in fsharp-font-lock-keywords.
108108
(def-fsharp-compiled-var fsharp-active-pattern-regexp
109-
(concat "\\<\\(?:let\\|and\\)\\s-+"
110-
fsharp-inline-rec-regexp-noncapturing "?"
111-
fsharp-access-control-regexp-noncapturing "*"
112-
"(\\(|[A-Za-z0-9_'|]+|\\))\\(?:\\s-+[A-Za-z_]\\|\\s-*(\\)"))
109+
(concat "\\<\\(?:let\\|and\\)\\s-+"
110+
fsharp-inline-rec-regexp-noncapturing "?"
111+
fsharp-access-control-regexp-noncapturing "*"
112+
"(\\(|[A-Za-z0-9_'|]+|\\))\\(?:\\s-+[A-Za-z_]\\|\\s-*(\\)"))
113113

114114
(def-fsharp-compiled-var fsharp-member-access-regexp
115-
"\\<\\(?:override\\|member\\|abstract\\)\\s-+"
116-
"Matches members declarations and modifiers on classes.")
115+
"\\<\\(?:override\\|member\\|abstract\\)\\s-+"
116+
"Matches members declarations and modifiers on classes.")
117117

118118
(def-fsharp-compiled-var fsharp-member-function-regexp
119-
(concat fsharp-member-access-regexp
120-
fsharp-inline-rec-regexp-noncapturing "?"
121-
fsharp-access-control-regexp-noncapturing "*"
122-
"\\(?:" fsharp-valid-identifier-regexp "\\.\\)?"
123-
"\\(" fsharp-valid-identifier-regexp "\\)")
124-
"Captures the final identifier in a member function declaration.")
119+
(concat fsharp-member-access-regexp
120+
fsharp-inline-rec-regexp-noncapturing "?"
121+
fsharp-access-control-regexp-noncapturing "*"
122+
"\\(?:" fsharp-valid-identifier-regexp "\\.\\)?"
123+
"\\(" fsharp-valid-identifier-regexp "\\)")
124+
"Captures the final identifier in a member function declaration.")
125125

126126
(def-fsharp-compiled-var fsharp-overload-operator-regexp
127-
(concat fsharp-member-access-regexp
128-
fsharp-inline-rec-regexp-noncapturing "?"
129-
fsharp-access-control-regexp-noncapturing "*"
130-
"\\(([!%&*+-./<=>?@^|~]+)\\)")
131-
"Match operators when overloaded by a type/class.")
127+
(concat fsharp-member-access-regexp
128+
fsharp-inline-rec-regexp-noncapturing "?"
129+
fsharp-access-control-regexp-noncapturing "*"
130+
"\\(([!%&*+-./<=>?@^|~]+)\\)")
131+
"Match operators when overloaded by a type/class.")
132132

133133
(def-fsharp-compiled-var fsharp-constructor-regexp
134-
(concat "^\\s-*"
135-
fsharp-access-control-regexp-noncapturing "*"
136-
"\\<\\(new\\) *(.*)[^=]*=")
137-
"Matches the `new' keyword in a constructor")
134+
(concat "^\\s-*"
135+
fsharp-access-control-regexp-noncapturing "*"
136+
"\\<\\(new\\) *(.*)[^=]*=")
137+
"Matches the `new' keyword in a constructor")
138138

139139
(def-fsharp-compiled-var fsharp-type-def-regexp
140-
(concat "^\\s-*\\<\\(?:type\\|inherit\\)\\s-+"
141-
fsharp-access-control-regexp-noncapturing "*" ;; match access control 0 or more times
142-
"\\([A-Za-z0-9_'.]+\\)"))
140+
(concat "^\\s-*\\<\\(?:type\\|inherit\\)\\s-+"
141+
fsharp-access-control-regexp-noncapturing "*" ;; match access control 0 or more times
142+
"\\([A-Za-z0-9_'.]+\\)"))
143143

144144
(def-fsharp-compiled-var fsharp-var-or-arg-regexp
145-
"\\_<\\([A-Za-z_][A-Za-z0-9_']*\\)\\_>")
145+
"\\_<\\([A-Za-z_][A-Za-z0-9_']*\\)\\_>")
146146

147147
(def-fsharp-compiled-var fsharp-explicit-field-regexp
148-
(concat "^\\s-*\\(?:val\\|abstract\\)\\s-*\\(?:mutable\\s-+\\)?"
149-
fsharp-access-control-regexp-noncapturing "*" ;; match access control 0 or more times
150-
"\\([A-Za-z_][A-Za-z0-9_']*\\)\\s-*:\\s-*\\([A-Za-z_][A-Za-z0-9_'<> \t]*\\)"))
148+
(concat "^\\s-*\\(?:val\\|abstract\\)\\s-*\\(?:mutable\\s-+\\)?"
149+
fsharp-access-control-regexp-noncapturing "*" ;; match access control 0 or more times
150+
"\\([A-Za-z_][A-Za-z0-9_']*\\)\\s-*:\\s-*\\([A-Za-z_][A-Za-z0-9_'<> \t]*\\)"))
151151

152152
(def-fsharp-compiled-var fsharp-attributes-regexp
153-
"\\(\\[<[A-Za-z0-9_]+[( ]?\\)\\(\".*\"\\)?\\()?>\\]\\)"
154-
"Match attributes like [<EntryPoint>]; separately groups contained strings in attributes like [<Attribute(\"property\")>]")
153+
"\\(\\[<[A-Za-z0-9_]+[( ]?\\)\\(\".*\"\\)?\\()?>\\]\\)"
154+
"Match attributes like [<EntryPoint>]; separately groups contained strings in attributes like [<Attribute(\"property\")>]")
155155

156156
;; F# makes extensive use of operators, many of which have some kind of
157157
;; structural significance.
@@ -164,27 +164,27 @@ with initial value INITVALUE and optional DOCSTRING."
164164
;; | -- match / type expressions
165165

166166
(def-fsharp-compiled-var fsharp-operator-quote-regexp
167-
"\\(<@\\{1,2\\}\\)\\(?:.*\\)\\(@\\{1,2\\}>\\)"
168-
"Font lock <@/<@@ and @>/@@> operators.")
167+
"\\(<@\\{1,2\\}\\)\\(?:.*\\)\\(@\\{1,2\\}>\\)"
168+
"Font lock <@/<@@ and @>/@@> operators.")
169169

170170
(def-fsharp-compiled-var fsharp-operator-pipe-regexp
171-
"<|\\{1,3\\}\\||\\{1,3\\}>"
172-
"Match the full range of pipe operators -- |>, ||>, |||>, etc.")
171+
"<|\\{1,3\\}\\||\\{1,3\\}>"
172+
"Match the full range of pipe operators -- |>, ||>, |||>, etc.")
173173

174174
(def-fsharp-compiled-var fsharp-custom-operator-with-pipe-regexp
175-
(let ((op-chars "!%&\\*\\+\\-\\./<=>@\\^~") ;; all F# custom operator chars except for `|`
176-
(backward-pipe "<|\\{1,3\\}")
177-
(forward-pipe "|\\{1,3\\}>")
178-
(alt "\\|"))
179-
(concat "[" op-chars "|]*" backward-pipe "[" op-chars "]+"
180-
alt "[" op-chars "|]+" backward-pipe "[" op-chars "]*"
181-
alt "[" op-chars "]*" forward-pipe "[" op-chars "|]+"
182-
alt "[" op-chars "]+" forward-pipe "[" op-chars "|]*"))
183-
"Match operators that contains pipe sequence -- <|>, |>>, <<|, etc.")
175+
(let ((op-chars "!%&\\*\\+\\-\\./<=>@\\^~") ;; all F# custom operator chars except for `|`
176+
(backward-pipe "<|\\{1,3\\}")
177+
(forward-pipe "|\\{1,3\\}>")
178+
(alt "\\|"))
179+
(concat "[" op-chars "|]*" backward-pipe "[" op-chars "]+"
180+
alt "[" op-chars "|]+" backward-pipe "[" op-chars "]*"
181+
alt "[" op-chars "]*" forward-pipe "[" op-chars "|]+"
182+
alt "[" op-chars "]+" forward-pipe "[" op-chars "|]*"))
183+
"Match operators that contains pipe sequence -- <|>, |>>, <<|, etc.")
184184

185185
(def-fsharp-compiled-var fsharp-operator-case-regexp
186-
"\\s-+\\(|\\)[A-Za-z0-9_' ]"
187-
"Match literal | in contexts like match and type declarations.")
186+
"\\s-+\\(|\\)[A-Za-z0-9_' ]"
187+
"Match literal | in contexts like match and type declarations.")
188188

189189
(defvar fsharp-imenu-generic-expression
190190
`((nil ,(concat "^\\s-*" fsharp-function-def-regexp) 1)
@@ -215,52 +215,52 @@ with initial value INITVALUE and optional DOCSTRING."
215215

216216
;; Preprocessor directives (3.3)
217217
(def-fsharp-compiled-var fsharp-ui-preproessor-directives
218-
'("#if" "#else" "#endif" "#light"))
218+
'("#if" "#else" "#endif" "#light"))
219219

220220
;; Compiler directives (12.4)
221221
(def-fsharp-compiled-var fsharp-ui-compiler-directives
222-
'("#nowarn" "#load" "#r" "#reference" "#I"
223-
"#Include" "#q" "#quit" "#time" "#help"))
222+
'("#nowarn" "#load" "#r" "#reference" "#I"
223+
"#Include" "#q" "#quit" "#time" "#help"))
224224

225225
;; Lexical matters (18.4)
226226
(def-fsharp-compiled-var fsharp-ui-lexical-matters
227-
'("#indent"))
227+
'("#indent"))
228228

229229
;; Line Directives (3.9)
230230
(def-fsharp-compiled-var fsharp-ui-line-directives
231-
'("#line"))
231+
'("#line"))
232232

233233
;; Identifier replacements (3.11)
234234
(def-fsharp-compiled-var fsharp-ui-identifier-replacements
235-
'("__SOURCE_DIRECTORY__" "__SOURCE_FILE__" "__LINE__"))
235+
'("__SOURCE_DIRECTORY__" "__SOURCE_FILE__" "__LINE__"))
236236

237237
;; F# keywords (5.0)
238238
(def-fsharp-compiled-var fsharp-ui-fsharp-threefour-keywords
239-
'("abstract" "and" "and!" "as" "assert" "base" "begin"
240-
"class" "default" "delegate" "do" "do!" "done"
241-
"downcast" "downto" "elif" "else" "end"
242-
"exception" "extern" "false" "finally" "for" "fun"
243-
"function" "global" "if" "in" "inherit" "inline"
244-
"interface" "internal" "lazy" "let" "let!"
245-
"match" "match!" "member" "module" "mutable" "namespace"
246-
"new" "not" "null" "of" "open" "or" "override"
247-
"private" "public" "rec" "return" "return!"
248-
"select" "static" "struct" "then" "to" "true"
249-
"try" "type" "upcast" "use" "use!" "val" "void"
250-
"when" "while" "with" "yield" "yield!"))
239+
'("abstract" "and" "and!" "as" "assert" "base" "begin"
240+
"class" "default" "delegate" "do" "do!" "done"
241+
"downcast" "downto" "elif" "else" "end"
242+
"exception" "extern" "false" "finally" "for" "fun"
243+
"function" "global" "if" "in" "inherit" "inline"
244+
"interface" "internal" "lazy" "let" "let!"
245+
"match" "match!" "member" "module" "mutable" "namespace"
246+
"new" "not" "null" "of" "open" "or" "override"
247+
"private" "public" "rec" "return" "return!"
248+
"select" "static" "struct" "then" "to" "true"
249+
"try" "type" "upcast" "use" "use!" "val" "void"
250+
"when" "while" "with" "yield" "yield!"))
251251

252252
;; "Reserved because they are reserved in OCaml"
253253
(def-fsharp-compiled-var fsharp-ui-ocaml-reserved-words
254-
'("asr" "land" "lor" "lsl" "lsr" "lxor" "mod" "sig"))
254+
'("asr" "land" "lor" "lsl" "lsr" "lxor" "mod" "sig"))
255255

256256
;; F# reserved words for future use
257257
(def-fsharp-compiled-var fsharp-ui-reserved-words
258-
'("atomic" "break" "checked" "component" "const"
259-
"constraint" "constructor" "continue" "eager"
260-
"event" "external" "fixed" "functor" "include"
261-
"method" "mixin" "object" "parallel" "process"
262-
"protected" "pure" "sealed" "tailcall" "trait"
263-
"virtual" "volatile"))
258+
'("atomic" "break" "checked" "component" "const"
259+
"constraint" "constructor" "continue" "eager"
260+
"event" "external" "fixed" "functor" "include"
261+
"method" "mixin" "object" "parallel" "process"
262+
"protected" "pure" "sealed" "tailcall" "trait"
263+
"virtual" "volatile"))
264264

265265
;; RMD 2016-09-30 -- This was pulled out separately with the following comment
266266
;; when I got here. Not clear to me why it's on it's own, or even precisely what
@@ -270,21 +270,21 @@ with initial value INITVALUE and optional DOCSTRING."
270270
;; Workflows not yet handled by fsautocomplete but async
271271
;; always present
272272
(def-fsharp-compiled-var fsharp-ui-async-words
273-
'("async")
274-
"Just the word async, in a list.")
273+
'("async")
274+
"Just the word async, in a list.")
275275

276276
(def-fsharp-compiled-var fsharp-ui-word-list-regexp
277-
(regexp-opt
278-
`(,@fsharp-ui-async-words
279-
,@fsharp-ui-compiler-directives
280-
,@fsharp-ui-fsharp-threefour-keywords
281-
,@fsharp-ui-identifier-replacements
282-
,@fsharp-ui-lexical-matters
283-
,@fsharp-ui-ocaml-reserved-words
284-
,@fsharp-ui-preproessor-directives
285-
,@fsharp-ui-reserved-words
286-
,@fsharp-ui-line-directives)
287-
'symbols))
277+
(regexp-opt
278+
`(,@fsharp-ui-async-words
279+
,@fsharp-ui-compiler-directives
280+
,@fsharp-ui-fsharp-threefour-keywords
281+
,@fsharp-ui-identifier-replacements
282+
,@fsharp-ui-lexical-matters
283+
,@fsharp-ui-ocaml-reserved-words
284+
,@fsharp-ui-preproessor-directives
285+
,@fsharp-ui-reserved-words
286+
,@fsharp-ui-line-directives)
287+
'symbols))
288288

289289
(defconst fsharp-font-lock-keywords
290290
(eval-when-compile

0 commit comments

Comments
 (0)