All Questions
Tagged with code-snippets c++
36 questions
2
votes
1
answer
187
views
How do I disable suggestions when I type '#' [duplicate]
When I type '#' vscode suggests "#pragma region" and "#pragma endregion". I never use those snippets and the suggestions can be quite annoying especially if I intend to navigate ...
0
votes
1
answer
240
views
VSCode - custom snippet to create multiple different lines from selected C++ declaration
I have a line:
int INTVAR;
I would like to highlight this line, and run a snippet which automatically creates the following set of three lines in place of the single line above.
int INTVAR;
int ...
1
vote
0
answers
803
views
remove brackets on a new line in code block ms-vscode
Okay, I'm stuck!
At the moment, when I pressing tab, my code is complemented basic constructs(e.g if, for, while). This snippets(as I know), not formatting code. Curly brackets inserted a new line ...
9
votes
1
answer
2k
views
Modify default C++ snippets in VS Code
I would like to modify the default code snippets for C++ in Visual Studio Code. I've found a similar question here, but they actually show how to create your own snippets - and not how to modify the ...
0
votes
0
answers
79
views
How to create 'intelligent' snippet for VScode
I'm extending the functionality of VSCode for C++.
Can I create this snippet?
Before snippet:
(Cursor is marked by |)
stuff* arr;
// ...
arr = |
After snippet
stuff* arr;
// ...
arr = new stuff; // &...
1
vote
1
answer
1k
views
Format for curly braces in VS Code Snipets for C/C++
I installed the C/C++ Snippets extension in VS Code, and it creates a snippet like this:
for ( )
{
// your code
}
but I want the open brace on the keyword line:
for ( ) {
I found this topic for ...
0
votes
0
answers
110
views
How to do sequential variable transforms on a TM variable in snippet?
I'm working on a custom vscode snippet that, when typed on the same line as a c++ function declaration, it will parse out the names of the various parameters to the function and format them in a ...
1
vote
1
answer
238
views
VSCode User Snippet not working inside other snippet
I created some VSCode User Snippet, but it not working inside other snippet.
This is newest version of VSCode, 1.36.
If I have this snippet,
"tmp": {
"prefix": "tmp",
"body": [
...
0
votes
1
answer
84
views
Recursive function to reverse linked list(Code Snippet Explanation) [closed]
Can someone please explain the code below:
void reverseList(node **href){
node *first;
node *rest;
if(*href == NULL){
return;
}
first = *href;
rest = first->next;
...
2
votes
0
answers
122
views
Is there a way to merge snippets or make a disjoint snippet in Doxygen?
I would really like to use the \snippet function in the manual of my code, since it would embody DRY. However, part of my manual shows a user how to build up an example use case piece by piece for ...
1
vote
0
answers
166
views
Can Doxygen include a function declaration automatically?
I'm writing a manual that links with Doxygen. In the manual I reference functions in the code. Ideally I'd like to tell the manual to simply include the function declaration as a code snippet rather ...
0
votes
0
answers
80
views
Sublime Auto Complete C++ [duplicate]
I have started using sublime text 3 for coding in C++.
How can I get suggessions/auto completions while writing codes as I get in the codeblocks?
-4
votes
2
answers
345
views
What is wrong in the following snippet?
I know it is a fairly basic violation, but what is it?
class xyz
{
void function1()
{
cout<<"in class";
}
};
int main()
{
xyz s1 = new xyz(100);
xyz s2 = s1;
s2....
3
votes
1
answer
634
views
Complete statement in Visual Studio (2015) with a semicolon at the end and a newline
With automatic brace completion in place it would be nice to automate the <end>-';'-<enter> with one shortcut (also to save the trouble for the little finger), for instance to end the ...
0
votes
1
answer
279
views
Vim snipMate installed with pathogen not triggering
Sorry I searched for answer to the above question but none matched my exact situation. I am a beginner at vim and trying to set it up for C++ programming. I am using Xubuntu 14.04 and installed vim ...