madskristensen / Community.VisualStudio.Toolkit

A community toolkit for writing Visual Studio extensions
Other
24 stars 3 forks source link

Develop API to read .editorconfig settings for a file that is part of a solution #5

Closed RobertvanderHulst closed 3 years ago

RobertvanderHulst commented 3 years ago

For a project that I am working on we want to add support for .editorconfig. We want to read some settings (like C# does) for editor options, such as formatting and code style. I know there is some support for this in VS, but is very well hidden.. It would be nice if we could add something like Vs.Editor.GetConfigOption( strFileName, strOption, strDefault) that would automatically

myCrack commented 3 years ago

Just do it by yourself and make a pull request, should you?

RobertvanderHulst commented 3 years ago

Sure , I can do it, but if that would be using a "best practice "? I doubt it,

myCrack commented 3 years ago

but if that would be using a "best practice "? I doubt it

I think it is not a problem at all. Just make a PR, and mads will review it.

madskristensen commented 3 years ago

There is a solution for this out there already. See here how the ResxFormatter extension uses the EditorConfig NuGet package.

madskristensen commented 3 years ago

@RobertvanderHulst would the above solution work for you? If so, can we close this issue?

RobertvanderHulst commented 3 years ago

Mads I have not been able to check this , but it looks promising

RobertvanderHulst commented 3 years ago

Mads, Yes that seems to do what I want. Thanks for the tip !

madskristensen commented 3 years ago

Awesome. Glad it worked out for you!