sphinx-lua-ls 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sphinx_lua_ls/__init__.py +166 -0
- sphinx_lua_ls/_version.py +21 -0
- sphinx_lua_ls/autodoc.py +632 -0
- sphinx_lua_ls/doctree.py +477 -0
- sphinx_lua_ls/domain.py +1156 -0
- sphinx_lua_ls/intersphinx.py +204 -0
- sphinx_lua_ls/lua_ls.py +694 -0
- sphinx_lua_ls/py.typed +0 -0
- sphinx_lua_ls-0.0.4.dist-info/LICENSE +21 -0
- sphinx_lua_ls-0.0.4.dist-info/METADATA +92 -0
- sphinx_lua_ls-0.0.4.dist-info/RECORD +13 -0
- sphinx_lua_ls-0.0.4.dist-info/WHEEL +5 -0
- sphinx_lua_ls-0.0.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Linking to standard lua library.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import docutils.nodes
|
|
7
|
+
import sphinx.addnodes
|
|
8
|
+
import sphinx.application
|
|
9
|
+
import sphinx.environment
|
|
10
|
+
import sphinx.errors
|
|
11
|
+
import sphinx.ext.intersphinx
|
|
12
|
+
|
|
13
|
+
targets = {
|
|
14
|
+
"_G": "pdf-_G",
|
|
15
|
+
"_VERSION": "pdf-_VERSION",
|
|
16
|
+
"assert": "pdf-assert",
|
|
17
|
+
"collectgarbage": "pdf-collectgarbage",
|
|
18
|
+
"dofile": "pdf-dofile",
|
|
19
|
+
"error": "pdf-error",
|
|
20
|
+
"getmetatable": "pdf-getmetatable",
|
|
21
|
+
"ipairs": "pdf-ipairs",
|
|
22
|
+
"load": "pdf-load",
|
|
23
|
+
"loadfile": "pdf-loadfile",
|
|
24
|
+
"next": "pdf-next",
|
|
25
|
+
"pairs": "pdf-pairs",
|
|
26
|
+
"pcall": "pdf-pcall",
|
|
27
|
+
"print": "pdf-print",
|
|
28
|
+
"rawequal": "pdf-rawequal",
|
|
29
|
+
"rawget": "pdf-rawget",
|
|
30
|
+
"rawlen": "pdf-rawlen",
|
|
31
|
+
"rawset": "pdf-rawset",
|
|
32
|
+
"require": "pdf-require",
|
|
33
|
+
"select": "pdf-select",
|
|
34
|
+
"setmetatable": "pdf-setmetatable",
|
|
35
|
+
"tonumber": "pdf-tonumber",
|
|
36
|
+
"tostring": "pdf-tostring",
|
|
37
|
+
"type": "pdf-type",
|
|
38
|
+
"warn": "pdf-warn",
|
|
39
|
+
"xpcall": "pdf-xpcall",
|
|
40
|
+
"coroutine": "6.2",
|
|
41
|
+
"coroutine.close": "pdf-coroutine.close",
|
|
42
|
+
"coroutine.create": "pdf-coroutine.create",
|
|
43
|
+
"coroutine.isyieldable": "pdf-coroutine.isyieldable",
|
|
44
|
+
"coroutine.resume": "pdf-coroutine.resume",
|
|
45
|
+
"coroutine.running": "pdf-coroutine.running",
|
|
46
|
+
"coroutine.status": "pdf-coroutine.status",
|
|
47
|
+
"coroutine.wrap": "pdf-coroutine.wrap",
|
|
48
|
+
"coroutine.yield": "pdf-coroutine.yield",
|
|
49
|
+
"debug": "6.10",
|
|
50
|
+
"debug.debug": "pdf-debug.debug",
|
|
51
|
+
"debug.gethook": "pdf-debug.gethook",
|
|
52
|
+
"debug.getinfo": "pdf-debug.getinfo",
|
|
53
|
+
"debug.getlocal": "pdf-debug.getlocal",
|
|
54
|
+
"debug.getmetatable": "pdf-debug.getmetatable",
|
|
55
|
+
"debug.getregistry": "pdf-debug.getregistry",
|
|
56
|
+
"debug.getupvalue": "pdf-debug.getupvalue",
|
|
57
|
+
"debug.getuservalue": "pdf-debug.getuservalue",
|
|
58
|
+
"debug.sethook": "pdf-debug.sethook",
|
|
59
|
+
"debug.setlocal": "pdf-debug.setlocal",
|
|
60
|
+
"debug.setmetatable": "pdf-debug.setmetatable",
|
|
61
|
+
"debug.setupvalue": "pdf-debug.setupvalue",
|
|
62
|
+
"debug.setuservalue": "pdf-debug.setuservalue",
|
|
63
|
+
"debug.traceback": "pdf-debug.traceback",
|
|
64
|
+
"debug.upvalueid": "pdf-debug.upvalueid",
|
|
65
|
+
"debug.upvaluejoin": "pdf-debug.upvaluejoin",
|
|
66
|
+
"io": "6.8",
|
|
67
|
+
"io.close": "pdf-io.close",
|
|
68
|
+
"io.flush": "pdf-io.flush",
|
|
69
|
+
"io.input": "pdf-io.input",
|
|
70
|
+
"io.lines": "pdf-io.lines",
|
|
71
|
+
"io.open": "pdf-io.open",
|
|
72
|
+
"io.output": "pdf-io.output",
|
|
73
|
+
"io.popen": "pdf-io.popen",
|
|
74
|
+
"io.read": "pdf-io.read",
|
|
75
|
+
"io.stderr": "pdf-io.stderr",
|
|
76
|
+
"io.stdin": "pdf-io.stdin",
|
|
77
|
+
"io.stdout": "pdf-io.stdout",
|
|
78
|
+
"io.tmpfile": "pdf-io.tmpfile",
|
|
79
|
+
"io.type": "pdf-io.type",
|
|
80
|
+
"io.write": "pdf-io.write",
|
|
81
|
+
"file.close": "pdf-file:close",
|
|
82
|
+
"file.flush": "pdf-file:flush",
|
|
83
|
+
"file.lines": "pdf-file:lines",
|
|
84
|
+
"file.read": "pdf-file:read",
|
|
85
|
+
"file.seek": "pdf-file:seek",
|
|
86
|
+
"file.setvbuf": "pdf-file:setvbuf",
|
|
87
|
+
"file.write": "pdf-file:write",
|
|
88
|
+
"math": "6.7",
|
|
89
|
+
"math.abs": "pdf-math.abs",
|
|
90
|
+
"math.acos": "pdf-math.acos",
|
|
91
|
+
"math.asin": "pdf-math.asin",
|
|
92
|
+
"math.atan": "pdf-math.atan",
|
|
93
|
+
"math.ceil": "pdf-math.ceil",
|
|
94
|
+
"math.cos": "pdf-math.cos",
|
|
95
|
+
"math.deg": "pdf-math.deg",
|
|
96
|
+
"math.exp": "pdf-math.exp",
|
|
97
|
+
"math.floor": "pdf-math.floor",
|
|
98
|
+
"math.fmod": "pdf-math.fmod",
|
|
99
|
+
"math.huge": "pdf-math.huge",
|
|
100
|
+
"math.log": "pdf-math.log",
|
|
101
|
+
"math.max": "pdf-math.max",
|
|
102
|
+
"math.maxinteger": "pdf-math.maxinteger",
|
|
103
|
+
"math.min": "pdf-math.min",
|
|
104
|
+
"math.mininteger": "pdf-math.mininteger",
|
|
105
|
+
"math.modf": "pdf-math.modf",
|
|
106
|
+
"math.pi": "pdf-math.pi",
|
|
107
|
+
"math.rad": "pdf-math.rad",
|
|
108
|
+
"math.random": "pdf-math.random",
|
|
109
|
+
"math.randomseed": "pdf-math.randomseed",
|
|
110
|
+
"math.sin": "pdf-math.sin",
|
|
111
|
+
"math.sqrt": "pdf-math.sqrt",
|
|
112
|
+
"math.tan": "pdf-math.tan",
|
|
113
|
+
"math.tointeger": "pdf-math.tointeger",
|
|
114
|
+
"math.type": "pdf-math.type",
|
|
115
|
+
"math.ult": "pdf-math.ult",
|
|
116
|
+
"os": "6.9",
|
|
117
|
+
"os.clock": "pdf-os.clock",
|
|
118
|
+
"os.date": "pdf-os.date",
|
|
119
|
+
"os.difftime": "pdf-os.difftime",
|
|
120
|
+
"os.execute": "pdf-os.execute",
|
|
121
|
+
"os.exit": "pdf-os.exit",
|
|
122
|
+
"os.getenv": "pdf-os.getenv",
|
|
123
|
+
"os.remove": "pdf-os.remove",
|
|
124
|
+
"os.rename": "pdf-os.rename",
|
|
125
|
+
"os.setlocale": "pdf-os.setlocale",
|
|
126
|
+
"os.time": "pdf-os.time",
|
|
127
|
+
"os.tmpname": "pdf-os.tmpname",
|
|
128
|
+
"package": "6.3",
|
|
129
|
+
"package.config": "pdf-package.config",
|
|
130
|
+
"package.cpath": "pdf-package.cpath",
|
|
131
|
+
"package.loaded": "pdf-package.loaded",
|
|
132
|
+
"package.loadlib": "pdf-package.loadlib",
|
|
133
|
+
"package.path": "pdf-package.path",
|
|
134
|
+
"package.preload": "pdf-package.preload",
|
|
135
|
+
"package.searchers": "pdf-package.searchers",
|
|
136
|
+
"package.searchpath": "pdf-package.searchpath",
|
|
137
|
+
# "string": "6.4",
|
|
138
|
+
"string.byte": "pdf-string.byte",
|
|
139
|
+
"string.char": "pdf-string.char",
|
|
140
|
+
"string.dump": "pdf-string.dump",
|
|
141
|
+
"string.find": "pdf-string.find",
|
|
142
|
+
"string.format": "pdf-string.format",
|
|
143
|
+
"string.gmatch": "pdf-string.gmatch",
|
|
144
|
+
"string.gsub": "pdf-string.gsub",
|
|
145
|
+
"string.len": "pdf-string.len",
|
|
146
|
+
"string.lower": "pdf-string.lower",
|
|
147
|
+
"string.match": "pdf-string.match",
|
|
148
|
+
"string.pack": "pdf-string.pack",
|
|
149
|
+
"string.packsize": "pdf-string.packsize",
|
|
150
|
+
"string.rep": "pdf-string.rep",
|
|
151
|
+
"string.reverse": "pdf-string.reverse",
|
|
152
|
+
"string.sub": "pdf-string.sub",
|
|
153
|
+
"string.unpack": "pdf-string.unpack",
|
|
154
|
+
"string.upper": "pdf-string.upper",
|
|
155
|
+
# "table": "6.6",
|
|
156
|
+
"table.concat": "pdf-table.concat",
|
|
157
|
+
"table.insert": "pdf-table.insert",
|
|
158
|
+
"table.move": "pdf-table.move",
|
|
159
|
+
"table.pack": "pdf-table.pack",
|
|
160
|
+
"table.remove": "pdf-table.remove",
|
|
161
|
+
"table.sort": "pdf-table.sort",
|
|
162
|
+
"table.unpack": "pdf-table.unpack",
|
|
163
|
+
"utf8": "6.5",
|
|
164
|
+
"utf8.char": "pdf-utf8.char",
|
|
165
|
+
"utf8.charpattern": "pdf-utf8.charpattern",
|
|
166
|
+
"utf8.codepoint": "pdf-utf8.codepoint",
|
|
167
|
+
"utf8.codes": "pdf-utf8.codes",
|
|
168
|
+
"utf8.len": "pdf-utf8.len",
|
|
169
|
+
"utf8.offset": "pdf-utf8.offset",
|
|
170
|
+
# "getfenv": "pdf-getfenv",
|
|
171
|
+
# "loadstring": "pdf-loadstring",
|
|
172
|
+
# "module": "pdf-module",
|
|
173
|
+
# "setfenv": "pdf-setfenv",
|
|
174
|
+
# "unpack": "pdf-unpack",
|
|
175
|
+
# "debug.getfenv": "pdf-debug.getfenv",
|
|
176
|
+
# "debug.setfenv": "pdf-debug.setfenv",
|
|
177
|
+
# "math.atan2": "pdf-math.atan2",
|
|
178
|
+
# "math.cosh": "pdf-math.cosh",
|
|
179
|
+
# "math.frexp": "pdf-math.frexp",
|
|
180
|
+
# "math.ldexp": "pdf-math.ldexp",
|
|
181
|
+
# "math.log10": "pdf-math.log10",
|
|
182
|
+
# "math.pow": "pdf-math.pow",
|
|
183
|
+
# "math.sinh": "pdf-math.sinh",
|
|
184
|
+
# "math.tanh": "pdf-math.tanh",
|
|
185
|
+
# "package.loaders": "pdf-package.loaders",
|
|
186
|
+
# "package.seeall": "pdf-package.seeall",
|
|
187
|
+
# "table.maxn": "pdf-table.maxn",
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def resolve_std_reference(
|
|
192
|
+
app: sphinx.application.Sphinx,
|
|
193
|
+
env: sphinx.environment.BuildEnvironment,
|
|
194
|
+
node: sphinx.addnodes.pending_xref,
|
|
195
|
+
contnode: docutils.nodes.Node,
|
|
196
|
+
):
|
|
197
|
+
if node["refdomain"] == "lua" or node["reftype"] == "any":
|
|
198
|
+
target = node["reftarget"]
|
|
199
|
+
if target in targets:
|
|
200
|
+
lua = env.config["lua_ls_lua_version"]
|
|
201
|
+
uri = f"https://www.lua.org/manual/{lua}/manual.html#{targets[target]}"
|
|
202
|
+
ref = docutils.nodes.reference("", "", contnode)
|
|
203
|
+
ref["refuri"] = uri
|
|
204
|
+
return ref
|