vscode-snippets

Setting character $ to wrap text as parentheses in vscode

半世苍凉 提交于 2020-07-22 01:44:05
问题 Suppose following code exists. sample text When user double click text , then press { or ( , it just wraps the text while keeping it. sample {text} sample (text) But I don't know how to apply this rule to $ in VS Code Settings. What I expect is sample $text$ Which setting in VS Code is related to this feature? 回答1: Edit> Auto Surround is the setting in vscode. But it only applies to quotes and brackets like (), {}, <> and [] (and possibly some other language-defined cases). You cannot change

Intellisense not working in code snippets - VS Code

人走茶凉 提交于 2020-07-18 05:45:47
问题 I have installed the C# extension in VS Code. The problem I am having is, after using a code snippet prop , Intellisense no longer suggests variable types. This happens with other things like ctor as well, it will not autocomplete the class name, for example. I have tried uninstalling/reinstalling the extension. I have Googled without luck as well. I expect for Intellisense to suggest variable types, for example. Intellisense does not suggest anything. Hitting Ctrl+. does suggest the correct

VS Code Python Extension Default Snippets

吃可爱长大的小学妹 提交于 2020-07-08 03:29:12
问题 This is a followup to this question. The answer in there properly answers how to override snippets, but it doesn't address the actual location of the default ones. Recall the problematic snippet I'm trying to override results in code like def __init__(self, *args, **kwargs): return super().__init__(*args, **kwargs) when writing def __ini and auto-completing — namely it's a snippet for overriden method autocompletion. I'm trying to find where exactly this problematic snippet is located (so I

VSCode Advanced Custom Snippets

岁酱吖の 提交于 2020-07-07 11:30:28
问题 Context For the past 18 months, I've been using the LaTeX Workshop extension of VSCode for all my LaTeXing needs. Up to this point, I've primarily used it for longer-form articles and reports, and sporadically for note-taking purposes in class. I've been able to make it work sufficiently well in real-time so far with just a few custom macros (Linear Algebra typesets pretty easily). However, as I move on to different classes, I'm looking to expand my real-time abilities by implementing Gilles

How to increment a variable, like the line number, in a vscode snippet

早过忘川 提交于 2020-06-29 04:28:23
问题 I have a multi-line snippet in VScode. The problem is, TM_LINE_NUMBER gives the number of the line where the snippet was triggered, I need to increase that number by 1 so it equals the line number that it is actually on. "Console_Log_Test": { "prefix": "clg", "body": [ "//Debugging (remove)", "console.log('Line #${TM_LINE_NUMBER}');" ] }, How can I do that? 回答1: There are at least these two options: "Console_Log_Test": { "prefix": "clg", "body": [ "//Debugging (remove)", "console.log('Line #$

how to make user snippets work inside strings: vscode

≯℡__Kan透↙ 提交于 2020-06-16 02:50:24
问题 I've made own user snippet code for javascript "inner backquote concat variable" : { "prefix": "$", "body": "\\${$1}", "description": "concat variable with backquote sting" } I want that snippet to work inside backquote string or single quote string when I press '$' like this but it does not work when inside a string. How do make the snippet work inside a string? 回答1: Add the following snippet in settings.json "editor.quickSuggestions": { "strings": true }, It makes all snippets/emmets

Snippet to create Snippet in SSMS

☆樱花仙子☆ 提交于 2020-04-17 22:52:16
问题 Problem: Usually, if you want to save your code as a snippet, you have to open some xml template, investigate tags etc. Reference Is it possible to simplify this process as much as possible: i.e. create a SurroundsWith snippet that will wrap selected code by snippet code? 回答1: Please try following: Save this code as a create_new_snippet.snippet and add it to your SSMS through code snippet manager (Ctrl+K, Ctrk+B) <?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas

Pad selected lines to cursor position in VSCode

半城伤御伤魂 提交于 2020-04-03 10:57:27
问题 In Visual Studio 2019, I can use Alt + Shift + (Arrow Keys) to multi-line edit the "virtual" whitespace then press any key to make all the lines padded with space to the selected column, I use this a lot to make initialization code easier to read. However, when I switched to Visual Studio Code, I could not find the equivalent. The closest thing I was able to find was Ctrl + Alt + (Arrow Keys) . This is not quite what I need since it only places each line cursor at the end instead of the