Reinstall Figura documentation

This commit is contained in:
NullBite 2024-11-27 19:57:01 -05:00
parent a19683b439
commit d93c689a93
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
5 changed files with 134 additions and 334 deletions

6
.luarc-local.json Normal file
View File

@ -0,0 +1,6 @@
{
"workspace": {
"ignoreDir": [ ".**", "figuradocs/**"],
"ignoreSubmodules": false
}
}

View File

@ -1,11 +1,6 @@
{ {
/*==============================================================================================*\
|* WORKSPACE: Controls workspace behavior. *|
\*==============================================================================================*/
"workspace": { "workspace": {
"library": [ "library": [
"nulllib",
".vim/figuradocs/src/.vscode/docs",
".vscode/docs", ".vscode/docs",
"../../avatars/.vscode/docs", "../../avatars/.vscode/docs",
"../../../avatars/.vscode/docs", "../../../avatars/.vscode/docs",
@ -13,280 +8,146 @@
"../../../../../avatars/.vscode/docs", "../../../../../avatars/.vscode/docs",
"../../../../../../avatars/.vscode/docs" "../../../../../../avatars/.vscode/docs"
], ],
// Figura does not use third-party libraries.
"checkThirdParty": false, "checkThirdParty": false,
"userThirdParty": [], "userThirdParty": [],
"ignoreDir": [
// Modify ignored files ".**",
"ignoreDir": [".**"], // Directories starting with `.` are ignored. "figuradocs/**"
"useGitIgnore": true, // Ignore the same files as Git. ],
"ignoreSubmodules": true, // Git submodules are ignored. "useGitIgnore": true,
"ignoreSubmodules": false,
// Include all file schemes "supportScheme": [
"supportScheme": ["file", "untitled", "git"], "file",
"untitled",
// Avoid excessive memory usage. "git"
],
"maxPreload": 5000, "maxPreload": 5000,
"preloadFileSize": 500 "preloadFileSize": 500
}, },
/*==============================================================================================*\
|* RUNTIME: Controls the emulated Lua runtime. *|
\*==============================================================================================*/
"runtime": { "runtime": {
// Figura uses Lua 5.2
"version": "Lua 5.2", "version": "Lua 5.2",
// Change built-in features of Lua to fit Figura's implementation.
"builtin": { "builtin": {
"basic": "disable", // Figura reworks and removes many of the functions in this library. "basic": "disable",
"bit": "disable", // `bit` is LuaJIT only. "bit": "disable",
"bit32": "enable", // "bit32": "enable",
"builtin": "enable", // TODO: Turn this off if the Lua server ever supports ops on types. "builtin": "enable",
"coroutine": "disable", // `coroutine` does not exist in Figura. "coroutine": "disable",
"debug": "disable", // `debug` does not exist in Figura. "debug": "disable",
"ffi": "disable", // `ffi` is LuaJIT only. "ffi": "disable",
"io": "disable", // `io` does not exist in Figura. "io": "disable",
"jit": "disable", // `jit` is, you guessed it, LuaJIT only. "jit": "disable",
"math": "enable", // "math": "enable",
"os": "disable", // `os` does not exist in Figura. "os": "disable",
"package": "disable", // `package` does not exist in Figura. `require` is reworked. "package": "disable",
"string": "enable", // "string": "enable",
"table": "enable", // "table": "enable",
"table.clear": "disable", // `table.clear` is LuaJIT only. "table.clear": "disable",
"table.new": "disable", // `table.new` is LuaJIT only. "table.new": "disable",
"utf8": "disable" // `utf8` is Lua 5.3+ only. "utf8": "disable"
}, },
"path": [
// Figura's require only allows direct paths. "?.lua"
"path": ["?.lua"], ],
"pathStrict": false, "pathStrict": true,
// Internal crap.
"fileEncoding": "utf8", "fileEncoding": "utf8",
"meta": "${version} ${language} ${encoding}", "meta": "${version} ${language} ${encoding}",
// Figura does not use non-standard features.
"nonstandardSymbol": [], "nonstandardSymbol": [],
"plugin": "", "plugin": "",
"pluginArgs": [], "pluginArgs": [],
"special": {}, "special": {},
"unicodeName": false "unicodeName": false
}, },
/*==============================================================================================*\
|* COMPLETION: Controls auto-completion and suggestion behavior. *|
\*==============================================================================================*/
"completion": { "completion": {
// Enable completion changes.
"enable": true, "enable": true,
"keywordSnippet": "Both",
// Modify visible snippets. "callSnippet": "Disable",
"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, "showParams": true,
// Automatically try to `require` words that look like file names.
"autoRequire": true, "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, "displayContext": 0,
// The character used as the postfix operator for suggestions.
"postfix": "@", "postfix": "@",
// The character used as the path seperator of requires.
"requireSeparator": ".", "requireSeparator": ".",
// Disable word suggestions as they are mostly useless.
"showWord": "Disable", "showWord": "Disable",
"workspaceWord": false "workspaceWord": false
}, },
/*==============================================================================================*\
|* DIAGNOSTICS: Controls active diagnostics and the behavior of those diagnostics. *|
\*==============================================================================================*/
"diagnostics": { "diagnostics": {
// Enable diagnostics.
"enable": true, "enable": true,
// Slow down diagnostics on files that are not currently active to save resources.
"workspaceDelay": 5000, "workspaceDelay": 5000,
"workspaceRate": 25, "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": { "severity": {
// Ambiguity "ambiguity-1": "Warning",
"ambiguity-1": "Warning", // Requires ambiguous operators to be ordered with `(...)`. "count-down-loop": "Error",
"count-down-loop": "Error", // Don't allow for loops that could be infinite. "different-requires": "Error",
"different-requires": "Error", // Requires in Figura are very specific. "newfield-call": "Warning",
"newfield-call": "Warning", // If parentheses are found at the start of a line, it will... "newline-call": "Warning",
"newline-call": "Warning", // ...be treated as a function call for the variable before it. "await-in-sync": "Error",
"not-yieldable": "Error",
// Await "codestyle-check": "Information",
"await-in-sync": "Error", // Async functions can only be called in async contexts. "spell-check": "Hint",
"not-yieldable": "Error", // `coroutine.yield` can only be used in coroutines. "duplicate-index": "Warning",
"duplicate-set-field": "Warning",
// Code Style "global-in-nil-env": "Error",
"codestyle-check": "Information", // Checks code style for consistency. "lowercase-global": "Information",
"spell-check": "Hint", // Check spelling. "undefined-env-child": "Warning",
"undefined-global": "Warning",
// Duplicate "circle-doc-class": "Error",
"duplicate-index": "Warning", // Duplicate table indexes will conflict. "doc-field-no-class": "Error",
"duplicate-set-field": "Warning", // Duplicate class indexes will conflict. "duplicate-doc-alias": "Warning",
"duplicate-doc-field": "Warning",
// Global "duplicate-doc-param": "Warning",
"global-in-nil-env": "Error", // Attempting to make a global with a missing _ENV fails. "undefined-doc-class": "Warning",
"lowercase-global": "Information", // This is likely caused by not making a variable local. "undefined-doc-name": "Error",
"undefined-env-child": "Warning", // Basically `undefined-global`, but for new _ENVs. "undefined-doc-param": "Warning",
"undefined-global": "Warning", // Detects attempt to use undefined global variables. "unknown-cast-variable": "Error",
"unknown-diag-code": "Information",
// Luadoc "unknown-operator": "Error",
"circle-doc-class": "Error", // Circular references cause a class to be useless. "redefined-local": "Warning",
"doc-field-no-class": "Error", // `@field`s need a `@class` to work. "close-non-object": "Error",
"duplicate-doc-alias": "Warning", // Duplicate `@alias` names may conflict. "deprecated": "Warning",
"duplicate-doc-field": "Warning", // Duplicate `@field` names in a class may conflict. "discard-returns": "Warning",
"duplicate-doc-param": "Warning", // Duplicate `@param` names in a function may conflict. "no-unknown": "Warning",
"undefined-doc-class": "Warning", // Duplicate `@class` names may conflict. "assign-type-mismatch": "Warning",
"undefined-doc-name": "Error", // Undefined type annotations act like the `table` type. "cast-local-type": "Warning",
"undefined-doc-param": "Warning", // `@param`s need a matching parameter to annotate. "cast-type-mismatch": "Warning",
"unknown-cast-variable": "Error", // Undefined variables cannot be typecasted. "need-check-nil": "Warning",
"unknown-diag-code": "Information", // `@diagnostic` only accepts valid diagnostic codes. "param-type-mismatch": "Warning",
"unknown-operator": "Error", // Lua cannot have new `@operator`s added to it. "return-type-mismatch": "Warning",
"undefined-field": "Warning",
// Redefined "missing-parameter": "Error",
"redefined-local": "Warning", // It is pointless to redefine a local variable. "missing-return": "Warning",
"missing-return-value": "Warning",
// Strict "redundant-parameter": "Warning",
"close-non-object": "Error", // Non-object values cannot be closed. "redundant-return-value": "Warning",
"deprecated": "Warning", // Deprecated features are not meant to be used in code. "redundant-value": "Warning",
"discard-returns": "Warning", // Some functions cannot discard their return values. "unbalanced-assignments": "Warning",
"code-after-break": "Information",
// Strong "empty-block": "Hint",
"no-unknown": "Warning", // If a varaible's type cannot be inferred, it cannot safely be used. "redundant-return": "Warning",
"trailing-space": "Hint",
// Type Check "unreachable-code": "Information",
"assign-type-mismatch": "Warning", // Types of both values in an assignment must match. "unused-function": "Hint",
"cast-local-type": "Warning", // Casts can only be to matching types. "unused-label": "Hint",
"cast-type-mismatch": "Warning", // Casts can only be to matching types. "unused-local": "Hint",
"need-check-nil": "Warning", // Require a check if a value is *possibly* nil. "unused-vararg": "Hint",
"param-type-mismatch": "Warning", // Require call arguments to match function parameters. "inject-field": "Warning"
"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": { "neededFileStatus": {
"codestyle-check": "Any" "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": [ "disable": [
// Ambiguity "different-requires",
//;"ambiguity-1", "await-in-sync",
//;"count-down-loop", "not-yieldable",
//;"different-requires", "codestyle-check",
//;"newfield-call", "spell-check",
//;"newline-call", "duplicate-set-field",
"close-non-object",
// Await "no-unknown",
"await-in-sync", // Nothing in Figura is true async. "cast-local-type",
"not-yieldable", // `coroutine.yield` does not exist in Figura. "cast-type-mismatch",
"need-check-nil",
// Code Style "trailing-space",
"codestyle-check", // Code style checking is completely subjective. "inject-field"
"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": { "groupSeverity": {
"ambiguity": "Fallback", "ambiguity": "Fallback",
"await": "Fallback", "await": "Fallback",
@ -315,29 +176,14 @@
"unbalanced": "Fallback", "unbalanced": "Fallback",
"unused": "Fallback" "unused": "Fallback"
}, },
// Allow all schemes.
"disableScheme": [], "disableScheme": [],
// Don't run diagnostics on library files and ignored files.
"ignoredFiles": "Opened", "ignoredFiles": "Opened",
"libraryFiles": "Opened", "libraryFiles": "Opened",
// The docs handle global variables themselves.
"globals": [], "globals": [],
// All local variables must be checked (except for the empty variable "_")
"unusedLocalExclude": [] "unusedLocalExclude": []
}, },
/*==============================================================================================*\
|* FORMAT: Controls the formatter and code checking options. *|
\*==============================================================================================*/
"format": { "format": {
// Only use the formatter for code checking. "enable": true,
"enable": false,
// Formatter settings.
"defaultConfig": { "defaultConfig": {
"align_call_args": "false", "align_call_args": "false",
"align_chained_expression_statement": "false", "align_chained_expression_statement": "false",
@ -395,126 +241,51 @@
"trailing_table_separator": "smart" "trailing_table_separator": "smart"
} }
}, },
/*==============================================================================================*\
|* HINT: Controls the behavior of inline hints. *|
\*==============================================================================================*/
"hint": { "hint": {
// Enable inline hints.
"enable": true, "enable": true,
// Show an inline hint at assignment.
"setType": true, "setType": true,
"paramName": "All",
// Parameter settings. "paramType": true,
"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, "await": true,
// Show virtual number indexes if it may be hard to count them.
"arrayIndex": "Auto", "arrayIndex": "Auto",
// Show a virtual semicolon to seperate statements on the same line.
"semicolon": "Disable" "semicolon": "Disable"
}, },
/*==============================================================================================*\
|* HOVER: Controls the behavior of hover hints. *|
\*==============================================================================================*/
"hover": { "hover": {
// Enable hover hints.
"enable": true, "enable": true,
// Allows large enum lists to be visible.
"enumsLimit": 100, "enumsLimit": 100,
// Stops enum lists from making huge inline hints.
"expandAlias": false, "expandAlias": false,
// Allows large tables to be visible.
"previewFields": 100, "previewFields": 100,
// Allow viewing the raw form of a value.
"viewNumber": true, "viewNumber": true,
"viewString": true, "viewString": true,
"viewStringMax": 1024 "viewStringMax": 1024
}, },
/*==============================================================================================*\
|* TYPE: Controls type casting behavior. *|
\*==============================================================================================*/
"type": { "type": {
// Allows casting between `number` and `integer` (since they are the same thing in Lua.)
"castNumberToInteger": true, "castNumberToInteger": true,
// Allow "casting out" nil. (i.e: You can assign `number` to `number|nil`.)
"weakNilCheck": true, "weakNilCheck": true,
// Disallow forced narrowing of union types. You must explicitly narrow with code.
"weakUnionCheck": false "weakUnionCheck": false
}, },
/*==============================================================================================*\
|* SEMANTIC: Controls semantic coloring. *|
\*==============================================================================================*/
"semantic": { "semantic": {
// Enable semantic coloring.
"enable": true, "enable": true,
// Enable coloring for type annotations.
"annotation": true, "annotation": true,
// VSCode already handles keyword coloring.
"keyword": false, "keyword": false,
// Enable coloring for variables.
"variable": true "variable": true
}, },
/*==============================================================================================*\
|* SIGNATURE HELP: No clue lol. *|
\*==============================================================================================*/
"signatureHelp": { "signatureHelp": {
// Enables this, whatever it is.
"enable": true "enable": true
}, },
/*==============================================================================================*\
|* SPELL: Controls the spell-check dictionary. *|
\*==============================================================================================*/
"spell": { "spell": {
// Custom words for spell-check.
"dict": [ "dict": [
"figura" "figura"
] ]
}, },
/*==============================================================================================*\
|* TELEMETRY: Big brother is watching. *|
\*==============================================================================================*/
"telemetry": { "telemetry": {
// If you wish to send telemetry data, you can enable this.
"enable": false "enable": false
}, },
/*==============================================================================================*\
|* WINDOW: Controls the VSCode window's behavior. *|
\*==============================================================================================*/
"window": { "window": {
// Show workspace loading progress in the taskbar.
"progressBar": true, "progressBar": true,
// Show a funny little "😺Lua" indicator in the status bar while the Lua server is running.
"statusBar": true "statusBar": true
}, },
/*==============================================================================================*\
|* MISC: Controls other features and behaviors. *|
\*==============================================================================================*/
"misc": { "misc": {
// Startup parameters for the Lua language server.
"parameters": [] "parameters": []
} }
} }

1
.vscode Symbolic link
View File

@ -0,0 +1 @@
figuradocs/src/.vscode

1
avatar.code-workspace Symbolic link
View File

@ -0,0 +1 @@
figuradocs/src/avatar.code-workspace

21
update-docs.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq hjson stow
set -Eeuxo pipefail
cd "$(dirname "$0")"
(
cd figuradocs
git checkout latest
git fetch --all
git pull
stow src --ignore='^\.luarc\.json$'
)
< figuradocs/src/.luarc.json hjson -c | jq -s '.[0] * .[1]' - ./.luarc-local.json > .luarc.json
git add .luarc.json
git status