History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-42505
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Serge Baltic
Reporter: Adam Vandenberg
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
ReSharper

Option for "Acts as String.Format"

Created: 06 Jun 07 19:35   Updated: 12 Jun 07 03:04
Component/s: Options
Fix Version/s: 3.0
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Relates
This issue relates to:
RSRP-42938 Feedback for the String Formatting Me... Normal Open
RSRP-42939 A ContextAction for Marking the Metho... Normal Open
RSRP-42937 Type Chooser for the String Formattin... Normal Open
RSRP-42936 Special Methods As String.Format Func... Normal Closed
 

Build: 453
Fixed in build: 454


 Description  « Hide
I'd like to be able an attribute that allows a method to be treated like a string formatting method:

[StringFormatter]
private void WriteFormat(string moreText, params object[] args)
{
// buf is an internal StringBuilder
buf.AppendFormat(moreText, args);
}

This would apply format string analysis to the arguments of WriteFormat.



 All   Comments   Work Log   Change History      Sort Order:
Ilya Ryzhenkov - 06 Jun 07 19:57
Not an attribute, but option like for null/notnull attribute

Robert S Wojciechowski Jr - 11 Jun 07 20:35
It's great that you can now specify the method and string format parameter, but it would still be nice to be able to specify an attribute such as:

[StringFormatter("moreText")]
private void WriteFormat(string moreText, params object[] args) { ... }

instead of having to specify it in the options. Actually, that has a problem in that you would have to support a user attribute that takes a parameter, unlike the null/not-null attributes. Perhaps it could be like this, instead where I specify a simple StringFormat attribute:

private void WriteFormat([StringFormat] string moreText, params object[] args) { ... }

Then it could act just lie the null/not-null attributes!


Robert S Wojciechowski Jr - 11 Jun 07 21:42
Also, this feature doesn't seem to work on constructors. I tried with the method name as "Namespace1.Namespace2.Class.Class" to no avail.

Serge Baltic - 12 Jun 07 02:55
The trouble of the attributes is that you cannot use them to mark a third-party library.

As for the .ctor question, I've filed an issue, see the link. BTW posting requests as comments to old issues has lesser chances to be noticed by the team than a new issue created in the JIRA.