@@ -41,7 +41,7 @@ local function getPathDocUpdate()
41
41
return section .DOC
42
42
end
43
43
end
44
- end )
44
+ end )
45
45
if ok then
46
46
local doc_json_dir = doc_json_path :string ():gsub (' /doc.json' , ' ' )
47
47
return doc_json_dir , doc_path
@@ -131,7 +131,7 @@ local function injectBuildScript()
131
131
},
132
132
{__index = _G }))
133
133
if err or not data then
134
- error (err , 0 )
134
+ error (err , 0 )
135
135
end
136
136
data ()
137
137
return module
@@ -193,6 +193,15 @@ function doc.runCLI()
193
193
194
194
print (' root uri = ' .. rootUri )
195
195
196
+ --- If '--configpath' is specified, get the folder path of the '.luarc.doc.josn' configuration file (without the file name)
197
+ --- 如果指定了'--configpath',则获取`.luarc.doc.josn` 配置文件的文件夹路径(不包含文件名)
198
+ --- This option is passed into the callback function of the initialized method in provide.
199
+ --- 该选项会被传入到`provide`中的`initialized`方法的回调函数中
200
+ local luarcParentUri
201
+ if CONFIGPATH then
202
+ luarcParentUri = furi .encode (fs .absolute (fs .path (CONFIGPATH )):parent_path ():string ())
203
+ end
204
+
196
205
util .enableCloseFunction ()
197
206
198
207
local lastClock = os.clock ()
@@ -203,6 +212,7 @@ function doc.runCLI()
203
212
204
213
client :initialize {
205
214
rootUri = rootUri ,
215
+ luarcParentUri = luarcParentUri
206
216
}
207
217
io.write (lang .script (' CLI_DOC_INITING' ))
208
218
@@ -222,11 +232,11 @@ function doc.runCLI()
222
232
if os.clock () - lastClock > 0.2 then
223
233
lastClock = os.clock ()
224
234
local output = ' \x0D '
225
- .. (' >' ):rep (math.ceil (i / max * 20 ))
226
- .. (' =' ):rep (20 - math.ceil (i / max * 20 ))
227
- .. ' '
228
- .. (' 0' ):rep (# tostring (max ) - # tostring (i ))
229
- .. tostring (i ) .. ' /' .. tostring (max )
235
+ .. (' >' ):rep (math.ceil (i / max * 20 ))
236
+ .. (' =' ):rep (20 - math.ceil (i / max * 20 ))
237
+ .. ' '
238
+ .. (' 0' ):rep (# tostring (max ) - # tostring (i ))
239
+ .. tostring (i ) .. ' /' .. tostring (max )
230
240
io.write (output )
231
241
end
232
242
end )
0 commit comments