1,931 questions
0
votes
1
answer
52
views
Is there a quick way to edit snippets for the current language?
When I want to add a snippet for the current language, I open the command palette, type "snippet", go "Configure Snippets", then I have to select the language even though the file ...
2
votes
1
answer
75
views
How can I limit my code snippet to only show up in the intellisense ddl when typing the shortcut
I've recently created my first code snippet and the problem I'm having is that whenever I go to surround my code with something, instead of automatically selecting the usual "Visual C#" ...
0
votes
2
answers
100
views
Custom HTML snippet in Visual Studio only prints default values
I have an HTML snippet which adds a Label and Input element. But when I invoke the snippet, it doesn't let me alter the literal's, it just adds the tags with default values.
I made a different snippet ...
0
votes
0
answers
39
views
Python tempfile SpooledTemporaryFile write to a gzip without writing to disk where possible?
I am trying to create a snippet of Python code that first writes a possibly large text file (think csv) to a SpooledTemporaryFile in memory. Then that spooled file is compressed with gzip. While some ...
0
votes
0
answers
68
views
configure autocomplete snippits in nvim for .hbs file
How do I configure autocomplete snippets for .hbs (Handlebars) files in Neovim using the NvChad framework?
I'm using Neovim with the NvChad configuration framework, and I want to enable autocomplete/...
1
vote
1
answer
100
views
Using a bash terminal to list gitlab "snippets"
I'm trying to list "snippets" but everything I've found so far only refers to listing repos.
In gitlab there's a submenu, "snippets", where we occasionally need to pull new code ...
4
votes
2
answers
267
views
How can I use predefined code snippets outside of code chunks in Quarto within RStudio/Posit?
I'm working on a Quarto document in RStudio/Posit where I frequently need to insert recurring formatting code. I've set up some custom code snippets in RStudio that work perfectly inside code chunks. ...
0
votes
1
answer
76
views
VS Code snippet - how to get the relative_filepath without the file extension
How can I get the relative_filepath without the extension and backslash change ?
I found two transforms:
"${RELATIVE_FILEPATH/[\\]/\//g/}"
"${RELATIVE_FILEPATH/(.js)//}"
If the ...
0
votes
1
answer
76
views
Can you add a comma to a VS Code Snippet placeholder option?
I want to create a VS Code snippet that uses the choices feature:
"Fool's Dart Types": {
"scope": "dart",
"prefix": "foolsTypes",
...
1
vote
1
answer
45
views
How to open dropdown from separate button in stackoverflow code snippet
Running code snippet using "Run code snippet" button and clicking "Open menu" button does nothing. It should open menu.
Menu is defined in other place in DOM and display is set to ...
0
votes
0
answers
29
views
is it possible to get support for more advanced snippets than default in Visual Studio?
I'm creating some snippets for both VS and VS Code, and I would love all the features from the VS Code ones in VS. And the ability to define file extension types instead of just language. Is it ...
0
votes
1
answer
87
views
Stop Visual Studio Xaml Editor showing snippets when I press the Tab button
After a recent update of either Visual Studio 2022 or R#, now when I'm in the xaml editor and I press the tab key, the snippets dialog pops up.
This is new behaviour, and is incredibly annoying. Can I ...
1
vote
0
answers
1k
views
nvim snippets how to create custom peace of codes
I try to write some custom snippets. For that I install and configure Luasnip in my nvim.cmp. Also installed rafamadriz/friendly-snippets
So far it is ok; means autocompletion shows snippets from ...
0
votes
1
answer
46
views
ACF get_field not returning value inside function with foreach loop
I have a function that loops all Woocommerce subcategories for the current category. Inside the subcategory loop there is an advanced-custom-field that is supposed to display an icon. But I do ...
0
votes
1
answer
89
views
How can I make hashing algorithm for code snippets?
I would like to make an algorithm, which can detect code snippets when iterating through source codes, based on some hashing algorithms.
So for example, here is that short code snippet from a fragment ...
0
votes
0
answers
48
views
Macros, Code Snippets, or even Keyboard Shortcuts not working in Visual Studio 2008 for C++
I am working in Visual Studio 2008 and cannot update due to constraint of my software compatibility issue. I search everywhere on the Internet, read many posts here as well, but no solution found to ...
0
votes
0
answers
18
views
I am having issues to get the piece of code in my snippet whith the html labels
This is my snippet and what I hope to get when I write "html-em" in my html file:
{
"HTML EM template": {
"prefix": "html-em",
"body": [
...
-2
votes
1
answer
146
views
Code Snippet for Add to Cart Redirect only works for the Add to Cart Button in SINGLE PRODUCT PAGE
The code snippet for redirecting the add to cart to the checkout page only works when I press the add to cart on the SINGLE PRODUCT PAGE. It does not work when I click the add to cart button on the ...
1
vote
1
answer
198
views
How do I remove and replace line breaks from my clipboard while using snippets in Visual Studio Code?
I am planning to replace every line break in my clipboard with a space, followed a vertical bar and then another space.
For instance, if my clipboard has the following text:
My
Clipboard
Content
the ...
2
votes
1
answer
741
views
Snippet of current time in nvim
I'm trying to create a snippet for vimwiki. The snippet must change __ to current time.
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
s(
{...
0
votes
1
answer
150
views
PHP Code Snippet Not Working in CartFlows (WooCommerce Plugin)
I followed THIS tutorial to change the coupon field and button text, using the following script in a Code Snippet:
/**
* Change the CartFlows Coupon Field text and Button text.
*
* @param array $...
1
vote
1
answer
369
views
Unexpected token error while using javascript snippet with WPCode in wordpress
I am trying to add custom javascript into my website for a widget on wordpress using the wpcode plugin but I keep getting an unexpected token error. There is a already created that isn't accessible ...
2
votes
1
answer
3k
views
Neovim nvim-cmp and LuaSnip: Tab Key Not Navigating Completion Menu or Expanding Snippets
I'm working on setting up my Neovim configuration for development, specifically focusing on integrating nvim-cmp for autocompletion and LuaSnip for snippet support. However, I'm encountering an issue ...
0
votes
1
answer
132
views
Is it possible to use html snippets inside of Razor (cshtml) pages in ASP.NET MVC
I tried so many ways but I didn't achieve to do it . I can't use html snippets inside of cshtml razor page and it sucks.I don't wanna use VS Code to write ASP.NET MVC because I'm used to use Visual ...
1
vote
0
answers
112
views
How can I hide or override built-in code snippets?
I edit the built in code snippet propdp for personal preferences. My problem is that Visual Studio updates reset the edited propdp to its default.
I could add a custom snippet with the same shortcut ...