Skip to content

Commit

Permalink
Merge pull request #79 from tahabasri/73-disable-syntax-resolving
Browse files Browse the repository at this point in the history
Disable auto syntax resolving
  • Loading branch information
tahabasri committed Sep 2, 2023
2 parents 636ef3f + 79c9d51 commit a3caf44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/config/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ export async function addSnippetFolder(snippetsExplorer: vscode.TreeView<Snippet
}

export function editSnippet(context: vscode.ExtensionContext, snippet: Snippet, snippetsProvider: SnippetsProvider) {
// note: enable syntax resolving by default if property is not yet defined in JSON
if (snippet.resolveSyntax === undefined) {
snippet.resolveSyntax = true;
// 3.1 update: disable syntax resolving by default if property is not yet defined in JSON
snippet.resolveSyntax = false;
}
// Create and show a new webview for editing snippet
new EditSnippet(context, snippet, snippetsProvider);
Expand Down
7 changes: 4 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ export function activate(context: vscode.ExtensionContext) {
if (!snippet) {
return;
}
// note: enable syntax resolving by default if property is not yet defined in JSON
// 3.1 update: disable syntax resolving by default if property is not yet defined in JSON
if (snippet.resolveSyntax === undefined) {
snippet.resolveSyntax = true;
snippet.resolveSyntax = false;
}
if (snippet.resolveSyntax) {
vscode.commands.executeCommand("editor.action.insertSnippet", { snippet: snippet.value }
Expand Down Expand Up @@ -552,7 +552,8 @@ export function activate(context: vscode.ExtensionContext) {
const draggedSnippet = parsedSource[0];
// same as open snippet command
if (draggedSnippet.resolveSyntax === undefined) {
draggedSnippet.resolveSyntax = true;
// 3.1 update: disable syntax resolving by default if property is not yet defined in JSON
draggedSnippet.resolveSyntax = false;
}
if (draggedSnippet.resolveSyntax) {
vscode.commands.executeCommand("editor.action.insertSnippet", { snippet: draggedSnippet.value }
Expand Down

0 comments on commit a3caf44

Please sign in to comment.