File tree 14 files changed +83
-4
lines changed
14 files changed +83
-4
lines changed Original file line number Diff line number Diff line change 3
3
## Unreleased
4
4
<!-- Add all new changes here. They will be moved under a version at release -->
5
5
* ` FIX ` cannot debug in Linux due to lua-debug expecting host process to have lua54 symbols available
6
+ * ` NEW ` support custom addons path for enhanced editor flexibility
6
7
7
8
## 3.14.0
8
9
` 2025-4-7 `
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ boolean
14
14
true
15
15
```
16
16
17
+ # addonRepositoryPath
18
+
19
+ Specifies the addon repository path (not related to the addon manager).
20
+
21
+ ## type
22
+
23
+ ``` ts
24
+ string
25
+ ```
26
+
17
27
# codeLens.enable
18
28
19
29
Enable code lens.
@@ -2320,4 +2330,4 @@ Array<string>
2320
2330
2321
2331
``` jsonc
2322
2332
[]
2323
- ```
2333
+ ```
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ boolean
14
14
true
15
15
```
16
16
17
+ # addonRepositoryPath
18
+
19
+ Specifies the addon repository path (not related to the addon manager).
20
+
21
+ ## type
22
+
23
+ ``` ts
24
+ string
25
+ ```
26
+
17
27
# codeLens.enable
18
28
19
29
Enable code lens.
@@ -2320,4 +2330,4 @@ Array<string>
2320
2330
2321
2331
``` jsonc
2322
2332
[]
2323
- ```
2333
+ ```
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ boolean
14
14
true
15
15
```
16
16
17
+ # addonRepositoryPath
18
+
19
+ 指定插件仓库的路径(与 Addon Manager 无关)。
20
+
21
+ ## type
22
+
23
+ ``` ts
24
+ string
25
+ ```
26
+
17
27
# codeLens.enable
18
28
19
29
启用代码度量。
@@ -2318,4 +2328,4 @@ Array<string>
2318
2328
2319
2329
``` jsonc
2320
2330
[]
2321
- ```
2331
+ ```
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ boolean
14
14
true
15
15
```
16
16
17
+ # addonRepositoryPath
18
+
19
+ Specifies the addon repository path (not related to the addon manager).
20
+
21
+ ## type
22
+
23
+ ``` ts
24
+ string
25
+ ```
26
+
17
27
# codeLens.enable
18
28
19
29
Enable code lens.
@@ -2318,4 +2328,4 @@ Array<string>
2318
2328
2319
2329
``` jsonc
2320
2330
[]
2321
- ```
2331
+ ```
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch =
6
6
" Specifies the git branch used by the addon manager."
7
7
config .addonManager .repositoryPath =
8
8
" Specifies the git path used by the addon manager."
9
+ config .addonRepositoryPath =
10
+ " Specifies the addon repository path (not related to the addon manager)."
9
11
config .runtime .version =
10
12
" Lua runtime version."
11
13
config .runtime .path =
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch =
6
6
" Especifica la rama de git usada por el manejador de extensiones."
7
7
config .addonManager .repositoryPath =
8
8
" Especifica la ruta git usada por el manejador de extensiones."
9
+ config .addonRepositoryPath = -- TODO: need translate!
10
+ " Specifies the addon repository path (not related to the addon manager)."
9
11
10
12
config .runtime .version =
11
13
" Versión de Lua que se ejecuta."
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch = -- TODO: need translate!
6
6
" Specifies the git branch used by the addon manager."
7
7
config .addonManager .repositoryPath = -- TODO: need translate!
8
8
" Specifies the git path used by the addon manager."
9
+ config .addonRepositoryPath = -- TODO: need translate!
10
+ " Specifies the addon repository path (not related to the addon manager)."
9
11
config .runtime .version = -- TODO: need translate!
10
12
" Lua runtime version."
11
13
config .runtime .path = -- TODO: need translate!
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch = -- TODO: need translate!
6
6
" Specifies the git branch used by the addon manager."
7
7
config .addonManager .repositoryPath = -- TODO: need translate!
8
8
" Specifies the git path used by the addon manager."
9
+ config .addonRepositoryPath = -- TODO: need translate!
10
+ " Specifies the addon repository path (not related to the addon manager)."
9
11
config .runtime .version = -- TODO: need translate!
10
12
" Lua runtime version."
11
13
config .runtime .path = -- TODO: need translate!
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch =
6
6
" 指定插件管理器(Addon Manager)使用的git仓库分支"
7
7
config .addonManager .repositoryPath =
8
8
" 指定插件管理器(Addon Manager)使用的git仓库路径"
9
+ config .addonRepositoryPath =
10
+ " 指定插件仓库的路径(与 Addon Manager 无关)"
9
11
config .runtime .version =
10
12
" Lua运行版本。"
11
13
config .runtime .path =
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ config.addonManager.repositoryBranch = -- TODO: need translate!
6
6
" Specifies the git branch used by the addon manager."
7
7
config .addonManager .repositoryPath = -- TODO: need translate!
8
8
" Specifies the git path used by the addon manager."
9
+ config .addonRepositoryPath = -- TODO: need translate!
10
+ " Specifies the addon repository path (not related to the addon manager)."
9
11
config .runtime .version =
10
12
" Lua執行版本。"
11
13
config .runtime .path =
Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ local template = {
414
414
},
415
415
-- testma
416
416
[" Lua.docScriptPath" ] = Type .String ,
417
+ [" Lua.addonRepositoryPath" ] = Type .String ,
417
418
-- VSCode
418
419
[" Lua.addonManager.enable" ] = Type .Boolean >> true ,
419
420
[" Lua.addonManager.repositoryPath" ] = Type .String ,
Original file line number Diff line number Diff line change 908
908
909
909
local addonsPath
910
910
911
+ --- Updates the variable 'addonsPath' with the user's configuration.
912
+ --- The path is only updated if 'addonsPath' is not set and the provided path is a valid string.
913
+ --- It first expands the input path and then verifies its existence via fs.exists.
914
+ --- @param path string
915
+ function m .updateAddonsPath (path )
916
+ if addonsPath then
917
+ return
918
+ end
919
+ if not (path and type (path ) == " string" ) then
920
+ return
921
+ end
922
+
923
+ path = util .expandPath (fs .path (path ):string ())
924
+ if fs .exists (fs .path (path )) then
925
+ addonsPath = path
926
+ log .info (' Updating addon repository path to: ' , path )
927
+ end
928
+ end
929
+
911
930
--- Resolve path variables/placeholders like ${3rd} and ${addons}
912
931
--- @param path string
913
932
--- @return string resolvedPath
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ local globInteferFace = {
131
131
end
132
132
}
133
133
134
+ local addonRepositoryPathUpdated = false
134
135
--- 创建排除文件匹配器
135
136
--- @param scp scope
136
137
function m .getNativeMatcher (scp )
@@ -175,6 +176,11 @@ function m.getNativeMatcher(scp)
175
176
end
176
177
end
177
178
for _ , path in ipairs (config .get (scp .uri , ' Lua.workspace.library' )) do
179
+ if not addonRepositoryPathUpdated then
180
+ addonRepositoryPathUpdated = true
181
+ local addonRepositoryPath = config .get (scp .uri , ' Lua.addonRepositoryPath' )
182
+ files .updateAddonsPath (addonRepositoryPath )
183
+ end
178
184
path = m .getAbsolutePath (scp .uri , path )
179
185
if path then
180
186
log .debug (' Ignore by library:' , path )
You can’t perform that action at this time.
0 commit comments