vscode-csharp-snippets icon indicating copy to clipboard operation
vscode-csharp-snippets copied to clipboard

Support for context aware class snippets

Open danspark opened this issue 4 years ago • 1 comments

I don't know if this is actually possible since I've never developed any extension for vscode, but one thing that I think would be nice is if there was some snippet for scaffolding a class with its namespace already resolved.

Example

I just created a file named "Person.cs" on the "Entities" folder that belongs to the "MyProject.csproj". If I typed the snippet classn, it would generate the following data:

namespace MyProject.Entities
{
    public class Person
    {
        
    }
}

Extras

  • Account for the RootNamespace tag on the .csproj file

danspark avatar Jan 08 '21 00:01 danspark

Thank you @danspark

I think that it is possible.

If I am not wrong, it could be done with TypeScript, but I have to investigate about it and see if it works as you comment.

Thank you very much for your suggestion!

Best regards,

Jorge

J0rgeSerran0 avatar Jan 09 '21 19:01 J0rgeSerran0