提交 edf7e052 编写于 作者: C Christof Marti

Handle error (#31450)

上级 e6a3b8f9
......@@ -72,15 +72,19 @@ export class WelcomePageContribution implements IWorkbenchContribution {
let foldersChecked = 0;
readdir(workSpaceFolder.path, (err, files) => {
foldersChecked += 1;
for (const content of files) {
if (content.toLowerCase().lastIndexOf('readme', 0) === 0) {
const readmeLocation = path.join(workSpaceFolder.path, content);
if (readmeLocation.toLowerCase().slice(readmeLocation.length - 3) === '.md') {
return !editorService.activeEditor && this.commandService
.executeCommand('markdown.showPreview', URI.file(readmeLocation));
if (err) {
onUnexpectedError(err);
} else {
for (const content of files) {
if (content.toLowerCase().lastIndexOf('readme', 0) === 0) {
const readmeLocation = path.join(workSpaceFolder.path, content);
if (readmeLocation.toLowerCase().slice(readmeLocation.length - 3) === '.md') {
return !editorService.activeEditor && this.commandService
.executeCommand('markdown.showPreview', URI.file(readmeLocation));
}
return !editorService.activeEditor && editorService
.openEditor({ resource: URI.file(readmeLocation) });
}
return !editorService.activeEditor && editorService
.openEditor({resource: URI.file(readmeLocation)});
}
}
if (foldersChecked === workSpaceFolders.length - 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册