diff --git a/Readme.md b/Readme.md index b176008..8d780e6 100644 --- a/Readme.md +++ b/Readme.md @@ -193,7 +193,7 @@ some regex patterns can't be supported by javascript, including - `snippets.userSnippetsDirectory`, Directory that contains custom user ultisnips snippets, use ultisnips in extension root by default. - `snippets.shortcut`, shortcut in completion menu, default `S`. - `snippets.autoTrigger`: enable auto trigger for auto trigger ultisnips snippets, default `true`. -- `snippets.execContext`: execute a snippet's `context` (if it exists) to check if the snippet should be shown in completion menu, default `false` (i.e., snippets with a `context` are never shown in completion menu) +- `snippets.execContext`: execute a snippet's `context` (if it exists) to check if the snippet should be shown in completion menu, default `true` (i.e., snippets with a `context` are never shown in completion menu) - `snippets.triggerCharacters`: trigger characters for completion, default `[]`. - `snippets.loadFromExtensions`: load snippets from coc.nvim extensions, default: `true`. - `snippets.loadVSCodeProjectSnippets`: Load code snippets in folder `${workspaceFolder}/.vscode`, default: `true`. diff --git a/package.json b/package.json index 8c63114..c9108e3 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ }, "snippets.execContext": { "type": "boolean", - "default": false, + "default": true, "description": "Execute a snippet's context (if it exists) to check if the snippet should be shown in completion menu" }, "snippets.ultisnips.enable": { diff --git a/src/provider.ts b/src/provider.ts index f4eb924..81fa384 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -126,7 +126,7 @@ export class ProviderManager implements CompletionItemProvider { let noneWords = before_content.endsWith(' ') ? '' : before_content.match(/\W*$/)[0] let contextPrefixes: string[] = [] const configuration = workspace.getConfiguration('snippets') - const execContext = configuration.get('execContext', false) + const execContext = configuration.get('execContext', true) for (let snip of snippets) { if (!execContext && snip.context) continue if (snip.prefix === '') continue