Giter Club home page Giter Club logo

Comments (6)

jasdefer avatar jasdefer commented on June 3, 2024 3

I am using Visual Studio 2022 Community and my template files are not located in the installation folder but in the AppData folder:
%userfolder%\AppData\Local\Microsoft\VisualStudio\17.0_6e63176c\Extensions\jxnhm1ga.wt4\Templates

from addanyfile.

Ackara avatar Ackara commented on June 3, 2024 2

Hey guys, I found that you can add your own templates as is (v3.5.134) by creating new files in the following folder (the extension's installation path).

%localappdata%\Microsoft\VisualStudio\15.0_f5f2761e\Extensions\3duco4g1.iyl\Templates

The only problem is that when the extension updates, I believe my own templates will be removed (correct?). Therefore I was wondering what if we extend the search for templates to an additional folder outside of the installation path (Templatemap.cs), ideally a folder of my choice. We can add said folder-path in the Visual Studio > Tools > Option > File Nesting > General dialog.

What do you guys think?

from addanyfile.

GW-FUB avatar GW-FUB commented on June 3, 2024 1

Thanks @Ackara for the hint. That worked.

If you need to find the correct folder (there are a lot different), use the following:

  1. Navigate to %localappdata%\Microsoft\VisualStudio
  2. Go to the highest version folder (like 14.0, 15.0)
  3. Go to the Extensions folder
  4. Search for AddAnyFile. You should find e.g. the dll. You can navigate to it's folder through the right click menu (Open in explorer)
  5. Navigate to the Templates folder
  6. Edit the templates

from addanyfile.

sameera avatar sameera commented on June 3, 2024

Back around v2.6 of this extension, I sent a PR that implemented support for VS Item Templates. The PR was merged but after few subsequent releases the code for VS Template support was dropped.

If you would like to use that behavior and don't mind losing features between 2.6 and now (and gain a few other features like automatic file extension inclusion based on project type), you can try the extension from my fork
https://github.com/sameera/AddAnyFile

If you need VS 2017 support, please pull from "dev" branch and build in VS 2017.

from addanyfile.

martea avatar martea commented on June 3, 2024

This would be graet, if you can make it available so that you can use convension based names to resolve a template that is produced in every project.

if i create _Template_Service.cs when i create i file like MyCusotmService.cs it should resolve to that template.

this would mean that you can create lots of templates that would make producing context quicker.

from addanyfile.

sameera avatar sameera commented on June 3, 2024

The code in the above branch already has regex based template mappings and you can customize to what you want.

from addanyfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.