Skip to content

Commit

Permalink
change execContext-default to true for personal convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
xi-lef committed Feb 7, 2024
1 parent ceaf957 commit 0a6b94a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>('execContext', false)
const execContext = configuration.get<boolean>('execContext', true)
for (let snip of snippets) {
if (!execContext && snip.context) continue
if (snip.prefix === '') continue
Expand Down

0 comments on commit 0a6b94a

Please sign in to comment.