File templates extension problem

VS2005, R#211

I've used ReSharper's File Templates to create a "Singleton" template (included
below if anyone wants to use it). I've then set the "Available in" to "C#
projects", with the extension for created files to be "cs".

Yet when I create a file using this template, the file is never given the
extension of CS, so ReSharper doesn't AutoFormat it, and until I rename it,
none of the syntax highlighting etc. works.

Is this a bug, or am I missing something?

Cheers -
/gerrod


-



namespace $NAMESPACE$ {
public class $SINGLETON$ {
// Thread safe initialisation of the singleton instance
static private readonly $SINGLETON$ instance = new $SINGLETON$();

$END$


#region Initialisation

/// /// Obtain a reference to the singleton instance of this class /// static public $SINGLETON$ Instance { get { return instance; } } ///

/// Private constructor - prevent external initialisation /// ]]>
private $SINGLETON$() {
}

#endregion
}
}


1 comment
Comment actions Permalink

This is a bug, will be fixed soon.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

VS2005, R#211

I've used ReSharper's File Templates to create a "Singleton" template
(included below if anyone wants to use it). I've then set the
"Available in" to "C# projects", with the extension for created files
to be "cs".

Yet when I create a file using this template, the file is never given
the extension of CS, so ReSharper doesn't AutoFormat it, and until I
rename it, none of the syntax highlighting etc. works.

Is this a bug, or am I missing something?

Cheers -
/gerrod
-------------------

namespace $NAMESPACE$ {
public class $SINGLETON$ {
// Thread safe initialisation of the singleton instance
static private readonly $SINGLETON$ instance = new $SINGLETON$();
$END$

#region Initialisation

/// <summary>
/// Obtain a reference to the singleton instance of this class
/// </summary>
static public $SINGLETON$ Instance {
get { return instance; }
}
/// <summary>
/// Private constructor - prevent external initialisation
/// </summary>
private $SINGLETON$() {
}
#endregion
}
}



0

Please sign in to leave a comment.