-
Hello, I'd like to add a custom dictionary to a Multi-root Workspace. My folder structure is like this:
I want to create a custom dictionary at the root Workspace folder, so it'll be Here's my VSCode Workspace {
"folders": [
{
"path": "client"
},
{
"path": "server"
}
],
"settings": {
"cSpell.language": "en,en-GB,en-US",
"cSpell.diagnosticLevel": "Warning",
"cSpell.customDictionaries": {
"custom-dictionary": {
"name": "Workspace Dictionary",
"description": "Custom dictionary",
"path": "${workspaceFolder}/custom-dictionary.txt",
"addWords": true,
"scope": "workspace"
}
}
}
}
However, this didn't work. CSpell end up creating a custom dictionary at
The only way I could get this to work is if define a third folder in my Workspace confingurations for the root Workspace folder, e.g.: {
"folders": [
{
"path": "client"
},
{
"path": "server"
},
{
"name": "Root", // <--------- Extra folder
"path": "./"
}
],
"settings": {
"cSpell.language": "en,en-GB,en-US",
"cSpell.diagnosticLevel": "Warning",
"cSpell.customDictionaries": {
"custom-dictionary": {
"name": "Workspace Dictionary",
"description": "Custom dictionary",
"path": "${workspaceFolder:Root}/custom-dictionary.txt", // <------- Notice the added "Root"
"addWords": true,
"scope": "workspace"
}
}
}
} Is this the proper way to add a custom Workspace dictionary, or is this a bug in the extension? The docs and this comment doesn't mention anything about defining a root folder in your Workspace. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It is common for one of the folders in a multi-root workspace to be the "root" and it is generally the first. But, a multi-root workspace does not have to have a root, so the extension has to guess. If you leave the name off, it looks at the first workspace. "settings": {
"cSpell.language": "en,en-GB,en-US",
"cSpell.diagnosticLevel": "Warning",
"cSpell.customDictionaries": {
"custom-dictionary": {
"name": "Workspace Dictionary",
"description": "Custom dictionary",
"path": "${workspaceFolder:client}/../custom-dictionary.txt", // <------- You can make it relative to the client or server.
"addWords": true,
"scope": "workspace"
}
}
} |
Beta Was this translation helpful? Give feedback.
@Yohanna,
It is common for one of the folders in a multi-root workspace to be the "root" and it is generally the first. But, a multi-root workspace does not have to have a root, so the extension has to guess.
If you leave the name off, it looks at the first workspace.