提交 af57ecdf 编写于 作者: P Pine Wu

Fix #67544

上级 ed8af3b1
......@@ -28,9 +28,14 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol
wfCSSConfig.workspaceFolderValue.experimental &&
wfCSSConfig.workspaceFolderValue.experimental.customData
) {
wfCSSConfig.workspaceFolderValue.experimental.customData.forEach(p => [
dataPaths.push(path.resolve(wf.uri.fsPath, p))
]);
const customData = wfCSSConfig.workspaceFolderValue.experimental.customData;
if (Array.isArray(customData)) {
customData.forEach(t => {
if (typeof t === 'string') {
dataPaths.push(path.resolve(wf.uri.fsPath, t));
}
});
}
}
});
......
......@@ -26,11 +26,15 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol
if (
wfHtmlConfig &&
wfHtmlConfig.workspaceFolderValue &&
wfHtmlConfig.workspaceFolderValue.experimental
wfHtmlConfig.workspaceFolderValue.experimental &&
wfHtmlConfig.workspaceFolderValue.experimental.customData
) {
if (wfHtmlConfig.workspaceFolderValue.experimental.customData) {
wfHtmlConfig.workspaceFolderValue.experimental.customData.forEach(t => {
dataPaths.push(path.resolve(wf.uri.fsPath, t));
const customData = wfHtmlConfig.workspaceFolderValue.experimental.customData;
if (Array.isArray(customData)) {
customData.forEach(t => {
if (typeof t === 'string') {
dataPaths.push(path.resolve(wf.uri.fsPath, t));
}
});
}
}
......@@ -45,7 +49,12 @@ export function getCustomDataPathsFromAllExtensions(): string[] {
for (const extension of extensions.all) {
const contributes = extension.packageJSON && extension.packageJSON.contributes;
if (contributes && contributes.html && contributes.html.experimental.customData && Array.isArray(contributes.html.experimental.customData)) {
if (
contributes &&
contributes.html &&
contributes.html.experimental.customData &&
Array.isArray(contributes.html.experimental.customData)
) {
const relativePaths: string[] = contributes.html.customData;
relativePaths.forEach(rp => {
dataPaths.push(path.resolve(extension.extensionPath, rp));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册