nvim-cmp plugin that scans specified node_modules for scss variable files
The only thing you have to add in the option table are the folders you want cmp-scss to search for variable scss files.
require'cmp'.setup {
sources = {
{
name = 'scss',
option = {
folders = { "node_modules/@dnr-ui/tokens/scss" }
}
}
}
}
When scanning the option.folders directories for scss variables it expects to find lines like these in the files it searches in. It will skip all other lines.
$dnr-color-neutrals-50: #ffffff;
The line is accepted as a match when it starts with '$', some variable name, followed by a colon (:), then the value the variable has and ends with a ';'
You can change the start trigger(s), the extension it will search for, the filter pattern, and the folder(s) it will search for files in.
require'cmp'.setup {
sources = {
{
name = 'scss',
option = {
triggers = { "$" }, -- default value
extension = ".scss", -- default value
pattern = [=[\%(\s\|^\)\zs\$[[:alnum:]_\-0-9]*:\?]=], -- default value
folders = { "node_modules/@dnr-ui/tokens/scss" },
}
}
}
}