tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
568 stars 98 forks source link

Add .usf (Unreal Engine shaders) to the list of supported extensions #25

Closed inequation closed 8 years ago

inequation commented 8 years ago

I work with the Unreal Engine 4 and I'd love it if I didn't have to manually change the GUID every time a HLSL Tools update arrives. ;)

Perhaps you could just add this extension to the manifest? It's not a widely used one, there is little chance of ambiguity.

tgjones commented 8 years ago

As @samizzo noted here, I should be able to implement IVsEditorFactory and then have HLSL Tools show up in Tools -> Options -> Text Editor -> File Extension. (Although as noted here, there appear to be some bugs in VS around this feature.)

samizzo commented 8 years ago

I'm not 100% certain that it isn't my implementation at fault, because writing VS extensions is stupidly complex! But I did find a blog post about the issue where VS kept losing the extension associations.

tgjones commented 8 years ago

@samizzo I've found a solution to the File > Recent Files bug. You need to add an entry to the FileExtensionMapping registry key, like Roslyn does here. I've written a ProvideFileExtensionMapping attribute class to do it in C# instead of a .pkgdef file.

samizzo commented 8 years ago

Awesome thanks for letting me know!

samizzo commented 8 years ago

I just implemented this for NShader and I noticed that if I have both ProvideEditorFactory and ProvideFileExtensionMapping on my package, I get two entries in the drop down in Tools->Options->Text Editor->File Extension. Do you see that?

tgjones commented 8 years ago

If I have both ProvideEditorExtension and ProvideFileExtensionMapping on the package, then yes, I see two entries. Thanks for spotting that, I'll fix it now. (But I can have both ProvideEditorFactory and ProvideFileExtensionMapping without causing a duplicate.)

inequation commented 8 years ago

Hey guys, just dropping by to say I really appreciate the change. :) Thanks for making my life easier!