code-snippets

Are there any alternatives to FastSharp?

这一生的挚爱 提交于 2019-12-07 16:11:27
Are there any alternatives to Matt Manela's FastSharp tool? I have a vague recollection that there was at least one alternative. Here FastSharp is the download link . Snippet Compiler LINQPad (by Joseph Albahari, author of C# 3.0 in a Nutshell) - definitely worth checking out, can connect to a DB and try out some LINQ to SQL etc. Snippy (by Jon Skeet, used for demos in his C# in Depth book) - apparently also has an add-in for Reflector . Are you looking for SnippetCompiler ? 来源: https://stackoverflow.com/questions/1067358/are-there-any-alternatives-to-fastsharp

OS/IDE-agnostic method of storing snippets

吃可爱长大的小学妹 提交于 2019-12-07 12:03:00
问题 I would like a way to store code snippets in a very straightforward way (to store and to retrieve). I code sometimes at home sometimes at work or various other workspaces, so I'd like a repository that's in the cloud. I would also like there to be an option for some kind of OS integration (via shortcut key perhaps; don't want to have to navigate to a webpage (snipplr) or an application (evernote) to retrieve the code). Ideally something that combines the best of Snipplr and Ditto. There's a

Change the snippets location in Visual Studio Code

匆匆过客 提交于 2019-12-07 11:19:37
问题 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. 回答1: Update: project level snippets are now a built-in feature as of the September 2018 release, so this no longer requires a third-party extension. There is currently an open feature request for this (#8102), but you can already get this functionality by using the Project Snippets extension - it lets you

Tab is conflicting intellisense and snippets in vs code

限于喜欢 提交于 2019-12-06 22:30:24
问题 I want to use a 'for' snippet for example. I write for and press tab twice so it autocompletes to the whole for loop and selects the counter so I can change it. I change that and then press tab to go to next variable(the one 'counter < [here]' in the condition statement). Then the problem is i write 'arr' and it autocompletes to something like 'ANGLE_instanced_arrays'. I want to just write 'arr' then press tab to go to next variable in the loop, BUT if I press tab it autocompletes. Any

How to add common language snippets in Visual Studio Code?

若如初见. 提交于 2019-12-06 20:20:45
问题 In official vscode documentation i have seen that is possible to create custom snippets for each language. https://code.visualstudio.com/Docs/customization/userdefinedsnippets Ex. (languageId).json But if i want to define snippets common for all languages? It is possible? 回答1: Common users snippets are currently not supported, but there is a VSCode issue tracking this feature request. Please let us know if this is something you would find useful. For completeness, VSCode extensions can

C++ snippet support in visual studio?

╄→гoц情女王★ 提交于 2019-12-06 19:00:09
问题 I'm writing code in native C++ (not C++/CLR). I know that there is no built-in support for C++ with regards to the snippet manager and snipper picker interfaces, however I found a utility called "snippy" which supposedly can generate C++ snippets. Here is a c++ snippet that the program generated: <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>MySnippet</Title> <Shortcut

Sublime Text snippet to insert PSR-0 namespace

梦想与她 提交于 2019-12-06 13:43:54
I'm trying to make a Sublime Text-snippet that inserts a PHP boilerplate class, in the lines of: <?php namespace Namespace\Subnamespace; class TestClass { public function __construct() { //code... } } When using PHP-FIG standards(or similar), both the namespace and classname can be obtained from the path of the file. The file in the example above would be placed in /Users/Projects/Whatever/src/Namespace/Subnamespace/TestClass.php . This is what I have so far: <snippet> <content><![CDATA[ <?php namespace ${1:Namespace}; class ${TM_FILENAME/(.*)[.](.*)/$1/g} { public function __construct() { ${0

Sublime Doctype HTML Snippet

房东的猫 提交于 2019-12-06 09:21:25
问题 Is there a way that this here below ↓↓↓ can be inserted as a snippet? <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> </head> <body> </body> </html> I tried using Preferences -> Key Bindings - User but quotation marks really matters. 回答1: You can create a new snippet via Tools -> New Snippet... You can read more about creating and

XDocument deleting a node

让人想犯罪 __ 提交于 2019-12-06 04:07:49
How do I delete a specific node from a loaded XDocument? My XML document looks like this: <Snippets> <Snippet name="if"> <SnippetCode> if (condition) { } </SnippetCode> </Snippet> <Snippets> <Snippet name="foreach"> <SnippetCode> ... </SnippetCode> </Snippet> .... </Snippets> So say if I wanted to delete just the foreach snippet, how would I do that? I tried doc.Descendants.Remove(), but it didn't work for me (the node didn't get deleted). Edit - on that note, how can I also rename the snippet and edit the snippets through code? I haven't looked into that yet but some help would be appreciated

How do I expand a snippet, while inside of another snippet?

↘锁芯ラ 提交于 2019-12-06 02:53:09
In Sublime Text 3, I'm trying to insert a snippet inside of a snippet, aka ul[TAB] which produces <ul>|</ul> with the cursor nested between the elements. Now, what I'd want to do is be able to expand another snippet inside of this snippet, aka ul[TAB]li[TAB] rendering <ul><li>|</li></ul> once again with the cursor nested between the elements, unfortunately as part of snippets in sublime text 3, [TAB] brings you to the next anchor point, in this case, exiting the tag. I find this feature incredibly handy, but in this case, a PITA. The above listed keystrokes would render: <ul>li</ul>| with the