code-snippets Questions

4

Solved

With the November 2016 (version 1.8) release of VSCode Snippet Variables are now supported, specifically TM_SELECTED_TEXT. This makes me happy as I have used these heavily in both Sublime Text and...

1

In Visual Studio Code, snippets is not work in comments or string. For example, I create snippet 't' for 'test', then type 't' in comment like # t or in string like "this is a string t" then ...
Thrice asked 18/1, 2019 at 18:13

3

Solved

Recently when I was using Xcode 10 beta 3, I tried to make a code snippet and add it to the code snippet library. But the drag drop cannot be done as the code snippet library is detached in Xcode ...
Facia asked 9/7, 2018 at 8:14

1

I have couple of snippets that shared between js, jsx and html files. Now I have the same snippet code in 3 files. Is it possible to create snippet and specify to what files/types it should be appl...
Palmy asked 28/11, 2017 at 15:9

1

Solved

I have created quite a lot of custom JavaScript snippets in VsCode. Recently, I started working on a project in typescript and, not unexpectedly, the JavaScript snippets do not work in typescript f...

0

I am looking for a javascript testing tool, like LinqPad for C#. Chrome has snippets, which let you edit and test javascript, and that looks close. However I cannot Open an existing file. Ctrl+P sh...
Lemmy asked 28/12, 2018 at 1:37

2

Solved

I'm trying to make a vscode snippet for python. Suppose I have a line of code like this: my_var = call_some_function() I'd like to double click on my_var to select it, hit a key, and it produces...
Dane asked 3/12, 2018 at 17:56

4

I created a simple code snippet in c# which add the line Debug.WriteLine(""); now the next step would be, when you use the snippet, to autocreate using System.Diagnostic; is there any way to ...
Defant asked 1/7, 2013 at 15:46

2

Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically? It would be great for ot...
Kerb asked 23/10, 2008 at 3:55

2

Solved

I am using visual studio code, and need to place the user snippets in my project repository. How can I change the location of the snippets file to a custom one? I am working on windows 10.
Ouzo asked 7/2, 2017 at 15:51

2

Solved

I'm using VS Code, and there is a default log snippet for JavaScript, that basically adds a console.log() line BUT also adds a new blank line. I want to remove that new blank line. Do you know how ...
Reopen asked 12/6, 2018 at 3:33

2

Solved

I have a code snippet that creates a C# class for me. It puts the regions in all the right places and sets it up just the way I like it. When I create a class by adding a new item it automatically...
Jillane asked 4/5, 2009 at 14:12

1

Solved

I am trying to write a snippet to allow me to quickly insert comment text using my standard format: #######################################><################### ## [date and time goes here] ...
Gyneco asked 24/7, 2018 at 17:56

1

When importing a directory containing snippets in the Code Snippet Manager in VS2017 (v15.7.5), in the Output pane I get the warning Missing or unspecified Language attribute even though a langu...
Gardner asked 28/7, 2018 at 11:7

2

Solved

For example: export const setVisibilityFilter = (filter) => ({ type: 'SET_VISIBILITY_FILTER', filter }) The name of the function setVisibilityFilter has camelCase. The same in the written v...
Hoffert asked 5/3, 2018 at 20:52

3

Solved

I would like to create SQL snippet in VS2013 and VS2015. I don't know why, but I've got an error while importing (in both of VS): "C:\sql.snippet: Missing or unspecified Language attribute" My s...

10

Solved

What is a good implementation of a IsLeapYear function in VBA? Edit: I ran the if-then and the DateSerial implementation with iterations wrapped in a timer, and the DateSerial was quicker on the ...
Discomfort asked 24/9, 2008 at 16:10

1

Is there any way to prevent the addition of an extra line below a multi-line snippet in VB.NET? (hit tab key to expand snippet...) I've double checked that the snippet itself does not have an...
Infrequent asked 10/4, 2014 at 14:16

6

Solved

Particularly, what is the best snippets package out there? Features: easy to define new snippets (plain text, custom input with defaults) simple navigation between predefined positions in ...
Precedence asked 14/9, 2008 at 16:27

6

Solved

I am aware of the Eclipse snippet "sysout" which is neatly replaced with System.out.println(); when tab-completed. This is very useful but sometimes, I need to wrap some existing code in a System....
Pest asked 19/6, 2009 at 21:7

6

Solved

I have the same installation of Visual Studio on two machines, but on one, I can't find the snippet "propdp" for DependencyProperty. I only have prop/propg, can't really understand why. I...
Paraffinic asked 18/3, 2011 at 8:1

4

Solved

I am currently trying to create a dark SO theme with Stylish. Everything was going great until I had to customize the snippet. I can't seem to change the selection color to any other than the one p...
Pourpoint asked 28/11, 2017 at 10:35

3

Solved

Is there any way that I can change how a Literal of a code snippet renders when it is used in the code that the snippet generates? Specifically I'd like to know if I can have a literal called say,...
Bowsprit asked 2/10, 2008 at 21:14

2

Solved

Trying to echo the array value from my mysql query (inside Wordpress snippet) function get_customer_gain() { global $wpdb; $users = $wpdb->get_results( "SELECT SUM(wp_wpdatatable_1.payback) ...
Pricillaprick asked 20/10, 2017 at 10:20

4

Solved

Is there a way to create a 'surround with' snippet in visual studio 2010? I know how to create a replacement type of snippet. A simple surround with snippet could surround a block of text with an a...
Orlon asked 5/5, 2011 at 16:49

© 2022 - 2024 — McMap. All rights reserved.