-
Notifications
You must be signed in to change notification settings - Fork 4
/
.luarc.json
516 lines (442 loc) · 21.2 KB
/
.luarc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
{
/*==============================================================================================*\
|* WORKSPACE: Controls workspace behavior. *|
\*==============================================================================================*/
"workspace": {
"library": [
"./src/.vscode/docs",
"./src/.vscode/plugin/docs"
],
// Figura does not use third-party libraries.
"checkThirdParty": false,
"userThirdParty": [],
// Modify ignored files
"ignoreDir": [".**"], // Directories starting with `.` are ignored.
"useGitIgnore": true, // Ignore the same files as Git.
"ignoreSubmodules": true, // Git submodules are ignored.
// Include all file schemes
"supportScheme": ["file", "untitled", "git"],
// Avoid excessive memory usage.
"maxPreload": 5000,
"preloadFileSize": 500
},
/*==============================================================================================*\
|* RUNTIME: Controls the emulated Lua runtime. *|
\*==============================================================================================*/
"runtime": {
// Figura uses Lua 5.2
"version": "Lua 5.2",
// Change built-in features of Lua to fit Figura's implementation.
"builtin": {
"basic": "disable", // Figura reworks and removes many of the functions in this library.
"bit": "disable", // `bit` is LuaJIT only.
"bit32": "enable", //
"builtin": "enable", // TODO: Turn this off if the Lua server ever supports ops on types.
"coroutine": "disable", // `coroutine` does not exist in Figura.
"debug": "disable", // `debug` does not exist in Figura.
"ffi": "disable", // `ffi` is LuaJIT only.
"io": "disable", // `io` does not exist in Figura.
"jit": "disable", // `jit` is, you guessed it, LuaJIT only.
"math": "enable", //
"os": "disable", // `os` does not exist in Figura.
"package": "disable", // `package` does not exist in Figura. `require` is reworked.
"string": "enable", //
"table": "enable", //
"table.clear": "disable", // `table.clear` is LuaJIT only.
"table.new": "disable", // `table.new` is LuaJIT only.
"utf8": "disable" // `utf8` is Lua 5.3+ only.
},
// Figura's require only allows direct paths.
"path": ["?.lua"],
"pathStrict": true,
// Internal crap.
"fileEncoding": "utf8",
"meta": "${version} ${language} ${encoding}",
// Figura does not use non-standard features.
"nonstandardSymbol": [],
"plugin": "./src/.vscode/plugin/main.lua",
"pluginArgs": [
"allowAddons=false" // Allow user-created plugin addons to run?
],
"special": {},
"unicodeName": false
},
/*==============================================================================================*\
|* COMPLETION: Controls auto-completion and suggestion behavior. *|
\*==============================================================================================*/
"completion": {
// Enable completion changes.
"enable": true,
// Modify visible snippets.
"keywordSnippet": "Both", // Show snippets for both keywords and control blocks.
"callSnippet": "Disable", // Disable seperate call snippets as they clutter suggestions.
// Show parameter names on function suggestions.
"showParams": true,
// Automatically try to `require` words that look like file names.
"autoRequire": true,
// Shows context for hovered function calls by showing the first few lines of the function.
// You can disable this by setting this to 0. Enable by setting to the amount of visbile lines.
"displayContext": 0,
// The character used as the postfix operator for suggestions.
"postfix": "@",
// The character used as the path seperator of requires.
"requireSeparator": "/",
// Disable word suggestions as they are mostly useless.
"showWord": "Disable",
"workspaceWord": false
},
/*==============================================================================================*\
|* DIAGNOSTICS: Controls active diagnostics and the behavior of those diagnostics. *|
\*==============================================================================================*/
"diagnostics": {
// Enable diagnostics.
"enable": true,
// Slow down diagnostics on files that are not currently active to save resources.
"workspaceDelay": 5000,
"workspaceRate": 25,
// Sets the severity of diagnostics to better fit Figura's environment.
// Removing diagnostics from this list does not disable them, use the "disable" list below if
// you wish to do that instead.
"severity": {
// Ambiguity
"ambiguity-1": "Warning", // Requires ambiguous operators to be ordered with `(...)`.
"count-down-loop": "Error", // Don't allow for loops that could be infinite.
"different-requires": "Error", // Requires in Figura are very specific.
"newfield-call": "Warning", // If parentheses are found at the start of a line, it will...
"newline-call": "Warning", // ...be treated as a function call for the variable before it.
// Await
"await-in-sync": "Error", // Async functions can only be called in async contexts.
"not-yieldable": "Error", // `coroutine.yield` can only be used in coroutines.
// Code Style
"codestyle-check": "Information", // Checks code style for consistency.
"spell-check": "Hint", // Check spelling.
// Duplicate
"duplicate-index": "Warning", // Duplicate table indexes will conflict.
"duplicate-set-field": "Warning", // Duplicate class indexes will conflict.
// Global
"global-in-nil-env": "Error", // Attempting to make a global with a missing _ENV fails.
"lowercase-global": "Information", // This is likely caused by not making a variable local.
"undefined-env-child": "Warning", // Basically `undefined-global`, but for new _ENVs.
"undefined-global": "Warning", // Detects attempt to use undefined global variables.
// Luadoc
"circle-doc-class": "Error", // Circular references cause a class to be useless.
"doc-field-no-class": "Error", // `@field`s need a `@class` to work.
"duplicate-doc-alias": "Warning", // Duplicate `@alias` names may conflict.
"duplicate-doc-field": "Warning", // Duplicate `@field` names in a class may conflict.
"duplicate-doc-param": "Warning", // Duplicate `@param` names in a function may conflict.
"undefined-doc-class": "Warning", // Duplicate `@class` names may conflict.
"undefined-doc-name": "Error", // Undefined type annotations act like the `table` type.
"undefined-doc-param": "Warning", // `@param`s need a matching parameter to annotate.
"unknown-cast-variable": "Error", // Undefined variables cannot be typecasted.
"unknown-diag-code": "Information", // `@diagnostic` only accepts valid diagnostic codes.
"unknown-operator": "Error", // Lua cannot have new `@operator`s added to it.
// Redefined
"redefined-local": "Warning", // It is pointless to redefine a local variable.
// Strict
"close-non-object": "Error", // Non-object values cannot be closed.
"deprecated": "Warning", // Deprecated features are not meant to be used in code.
"discard-returns": "Warning", // Some functions cannot discard their return values.
// Strong
"no-unknown": "Warning", // If a varaible's type cannot be inferred, it cannot safely be used.
// Type Check
"assign-type-mismatch": "Warning", // Types of both values in an assignment must match.
"cast-local-type": "Warning", // Casts can only be to matching types.
"cast-type-mismatch": "Warning", // Casts can only be to matching types.
"need-check-nil": "Warning", // Require a check if a value is *possibly* nil.
"param-type-mismatch": "Warning", // Require call arguments to match function parameters.
"return-type-mismatch": "Warning", // Require functions to return the correct type of value.
"undefined-field": "Warning", // Undefined fields have no known type and are not safe.
// Unbalanced
"missing-parameter": "Error", // Functions must receive at least the minimum arguments.
"missing-return": "Warning", // Functions with a `@return` require a return statement.
"missing-return-value": "Warning", // Functions with a `@return` require a return value.
"redundant-parameter": "Warning", // Functions must receive at most the maximum arguments.
"redundant-return-value": "Warning", // Functions must return at most the maximum returns.
"redundant-value": "Warning", // Unbalanced assignments can cause useless values.
"unbalanced-assignments": "Warning", // Unbalanced assignments can cause undefined variables.
// Unused
"code-after-break": "Information", // Code after a break statement will never run.
"empty-block": "Hint", // Empty blocks create clutter.
"redundant-return": "Warning", // Empty returns at the end of a function are redundant.
"trailing-space": "Hint", // Disallows trailing spaces in code.
"unreachable-code": "Information", // If code is unreachable, it is useless.
"unused-function": "Hint", // Unused functions cause clutter.
"unused-label": "Hint", // Unused labels cause clutter.
"unused-local": "Hint", // Unused variables cause clutter.
"unused-vararg": "Hint" // Unused varargs cause clutter.
},
"neededFileStatus": {
"codestyle-check": "Any"
},
// Diagnostics that are deemed useless in Figura's environment.
// Remove the `/ /;` before an option to disable it. Re-add it to enable it.
"disable": [
// Ambiguity
//;"ambiguity-1",
//;"count-down-loop",
"different-requires", // Figura will soon support relative requires.
//;"newfield-call",
//;"newline-call",
// Await
"await-in-sync", // Nothing in Figura is true async.
"not-yieldable", // `coroutine.yield` does not exist in Figura.
// Code Style
//;"codestyle-check",
"spell-check", // Who needs spell check? Lmao.
// Duplicate
//;"duplicate-index",
//;"duplicate-set-field",
// Global
//;"global-in-nil-env",
//;"lowercase-global",
//;"undefined-env-child",
//;"undefined-global",
// Luadoc
//;"circle-doc-class",
//;"doc-field-no-class",
//;"duplicate-doc-alias",
//;"duplicate-doc-field",
//;"duplicate-doc-param",
//;"undefined-doc-class",
//;"undefined-doc-name",
//;"undefined-doc-param",
//;"unknown-cast-variable",
//;"unknown-diag-code",
//;"unknown-operator",
// Redefined
//;"redefined-local",
// Strict
"close-non-object", // <close> is Lua 5.4+ only.
//;"deprecated",
//;"discard-returns",
// Strong
"no-unknown", // Too strict for Figura scripters.
// Type Check
//;"assign-type-mismatch",
"cast-local-type", // Allow casting as a way of forcibly changing a variable's type.
"cast-type-mismatch", // Allow casting as a way of forcibly changing a variable's type.
"need-check-nil", // Too strict for Figura scripters.
//;"param-type-mismatch",
//;"return-type-mismatch",
//;"undefined-field",
// Unbalanced
//;"missing-parameter",
//;"missing-return",
//;"missing-return-value",
//;"redundant-parameter",
//;"redundant-return-value",
//;"redundant-value",
//;"unbalanced-assignments",
// Unused
//;"code-after-break",
//;"empty-block",
//;"redundant-return",
"trailing-space" // Personal preference.
//;"unreachable-code",
//;"unused-function",
//;"unused-label",
//;"unused-local",
//;"unused-vararg"
],
// Group severity is not used by the docs.
"groupSeverity": {
"ambiguity": "Fallback",
"await": "Fallback",
"codestyle": "Fallback",
"duplicate": "Fallback",
"global": "Fallback",
"luadoc": "Fallback",
"redefined": "Fallback",
"strict": "Fallback",
"strong": "Fallback",
"type-check": "Fallback",
"unbalanced": "Fallback",
"unused": "Fallback"
},
"groupFileStatus": {
"ambiguity": "Fallback",
"await": "Fallback",
"codestyle": "Fallback",
"duplicate": "Fallback",
"global": "Fallback",
"luadoc": "Fallback",
"redefined": "Fallback",
"strict": "Fallback",
"strong": "Fallback",
"type-check": "Fallback",
"unbalanced": "Fallback",
"unused": "Fallback"
},
// Allow all schemes.
"disableScheme": [],
// Don't run diagnostics on library files and ignored files.
"ignoredFiles": "Opened",
"libraryFiles": "Opened",
// The docs handle global variables themselves.
"globals": [],
// All local variables must be checked (except for the empty variable "_")
"unusedLocalExclude": []
},
/*==============================================================================================*\
|* FORMAT: Controls the formatter and code checking options. *|
\*==============================================================================================*/
"format": {
// Only use the formatter for code checking.
"enable": false,
// Formatter settings.
"defaultConfig": {
"align_call_args": "false",
"align_chained_expression_statement": "false",
"align_function_define_params": "false",
"align_table_field_to_first_field": "false",
"call_arg_parentheses": "keep",
"class_name_define_style": "pascal_case",
"continuation_indent_size": "2",
"continuous_assign_statement_align_to_equal_sign": "true",
"continuous_assign_table_field_align_to_equal_sign": "true",
"detect_end_of_line": "true",
"do_statement_no_indent": "false",
"enable_check_codestyle": "true",
"enable_name_style_check": "true",
"end_of_line": "lf",
"function_name_define_style": "camel_case",
"function_param_name_style": "snake_case",
"global_variable_name_define_style": "upper_case",
"if_branch_comments_after_block_no_indent": "false",
"if_condition_no_continuation_indent": "false",
"indent_size": "2",
"indent_style": "space",
"insert_final_newline": "true",
"keep_line_after_do_statement": "keepLine",
"keep_line_after_expression_statement": "keepLine",
"keep_line_after_for_statement": "keepLine",
"keep_line_after_function_define_statement": "keepLine",
"keep_line_after_if_statement": "keepLine",
"keep_line_after_local_or_assign_statement": "keepLine",
"keep_line_after_repeat_statement": "keepLine",
"keep_line_after_while_statement": "keepLine",
"keep_one_space_between_namedef_and_attribute": "true",
"keep_one_space_between_table_and_bracket": "false",
"label_no_indent": "false",
"local_assign_continuation_align_to_first_expression": "false",
"local_function_name_define_style": "camel_case",
"local_name_define_style": "snake_case",
"long_chain_expression_allow_one_space_after_colon": "false",
"max_continuous_line_distance": "0",
"max_line_length": "100",
"module_name_define_style": "same('this')|same(filename, snake_case|pascal_case|camel_case)",
"quote_style": "double",
"remove_empty_header_and_footer_lines_in_function": "true",
"remove_expression_list_finish_comma": "true",
"require_module_name_style": "off",
"space_before_function_open_parenthesis": "false",
"space_before_open_square_bracket": "false",
"space_inside_function_call_parentheses": "false",
"space_inside_function_param_list_parentheses": "false",
"space_inside_square_brackets": "false",
"statement_inline_comment_space": "1",
"table_append_expression_no_space": "true",
"table_field_name_define_style": "snake_case",
"table_seperator_style": "comma",
"trailing_table_separator": "smart"
}
},
/*==============================================================================================*\
|* HINT: Controls the behavior of inline hints. *|
\*==============================================================================================*/
"hint": {
// Enable inline hints.
"enable": true,
// Show an inline hint at assignment.
"setType": true,
// Parameter settings.
"paramName": "All", // Show the name of parameters in function calls.
"paramType": true, // Show the type of parameters in function definitions.
// Show a virtual "await" next to called async functions.
"await": true,
// Show virtual number indexes if it may be hard to count them.
"arrayIndex": "Auto",
// Show a virtual semicolon to seperate statements on the same line.
"semicolon": "Disable"
},
/*==============================================================================================*\
|* HOVER: Controls the behavior of hover hints. *|
\*==============================================================================================*/
"hover": {
// Enable hover hints.
"enable": true,
// Allows large enum lists to be visible.
"enumsLimit": 100,
// Stops enum lists from making huge inline hints.
"expandAlias": false,
// Allows large tables to be visible.
"previewFields": 100,
// Allow viewing the raw form of a value.
"viewNumber": true,
"viewString": true,
"viewStringMax": 1024
},
/*==============================================================================================*\
|* TYPE: Controls type casting behavior. *|
\*==============================================================================================*/
"type": {
// Allows casting between `number` and `integer` (since they are the same thing in Lua.)
"castNumberToInteger": true,
// Allow "casting out" nil. (i.e: You can assign `number` to `number|nil`.)
"weakNilCheck": true,
// Disallow forced narrowing of union types. You must explicitly narrow with code.
"weakUnionCheck": false
},
/*==============================================================================================*\
|* SEMANTIC: Controls semantic coloring. *|
\*==============================================================================================*/
"semantic": {
// Enable semantic coloring.
"enable": true,
// Enable coloring for type annotations.
"annotation": true,
// VSCode already handles keyword coloring.
"keyword": false,
// Enable coloring for variables.
"variable": true
},
/*==============================================================================================*\
|* SIGNATURE HELP: No clue lol. *|
\*==============================================================================================*/
"signatureHelp": {
// Enables this, whatever it is.
"enable": true
},
/*==============================================================================================*\
|* SPELL: Controls the spell-check dictionary. *|
\*==============================================================================================*/
"spell": {
// Custom words for spell-check.
"dict": [
"figura"
]
},
/*==============================================================================================*\
|* TELEMETRY: Big brother is watching. *|
\*==============================================================================================*/
"telemetry": {
// If you wish to send telemetry data, you can enable this.
"enable": false
},
/*==============================================================================================*\
|* WINDOW: Controls the VSCode window's behavior. *|
\*==============================================================================================*/
"window": {
// Show workspace loading progress in the taskbar.
"progressBar": true,
// Show a funny little "😺Lua" indicator in the status bar while the Lua server is running.
"statusBar": true
},
/*==============================================================================================*\
|* MISC: Controls other features and behaviors. *|
\*==============================================================================================*/
"misc": {
// Startup parameters for the Lua language server.
"parameters": []
}
}