vscode-markdown
vscode-markdown copied to clipboard
Extension not activated when there is no `search.exclude` in settings.json
What's the problem
I integrated the extension into Eclipse Theia. After launching I got the error message Activating extension 'Markdown All in One' failed: Cannot convert undefined or null to object
and the extension was not actived.
What's the expected result
The extension should activate also with empty (null, undefined) search.exclude
pattern.
How to reproduce
- Download Eclipse Theia Blueplrint
- Add the extension
markdown-all-in-one
to package.json, copy"markdown-all-in-one": "https://open-vsx.org/api/yzhang/markdown-all-in-one/3.5.1/file/yzhang.markdown-all-in-one-3.5.1.vsix",
into thetheiaPlugins
section. - Run
yarn && yarn build:dev && yarn download:plugins
followed byyarn electron package
- Run
yarn electron package:preview
Other information
The problem is in the constructor of MdCompletionItemProvider
in the block where the exclude patterns are constructed.
const Always_Exclude = ["**/node_modules", "**/bower_components", "**/*.code-search", "**/.git"];
const excludePatterns = new Set(Always_Exclude);
if (manager_1.configManager.get("completion.respectVscodeSearchExclude", folder)) {
const vscodeSearchExclude = manager_1.configManager.getByAbsolute("search.exclude", folder);
for (const [pattern, enabled] of Object.entries(vscodeSearchExclude)) {
if (enabled) {
excludePatterns.add(pattern);
}
}
}
manager_1.configManager.getByAbsolute("search.exclude", folder)
returns undefined and then the for()
breaks.
Thanks for the feedback. Never know there is a way to run this inside Eclipse 😲.
Can you change your settings somewhere so that the completion.respectVscodeSearchExclude
is false
? I can add a simple null check here but in general this extension only targets vscode, so there might be more vscode-related incompatibility in Eclipse.