The Task List in Visual Studio 2010 will show all the TODO comments in a solution, but is there some way to filter it to only show TODOs for files with pending changes or for files that are open? In other words, I don't want to see everyone else's TODOs, only the TODOs in my changeset. If it isn't built in, is there a plug-in that you like that can do that?
Task List window lists all comments what contains TODO keyword. Also there are two default keywords; HACK and UNDONE. VS doesn't allow to change or delete TODO keyword but allows add new keywords. If you add a special keyword (like RoToDo) into Token List (it located in Tools/Options/Enviroment/Task List) and use this keyword in your comments like "//RoToDo comment here", Task List window will show these comments too. Finally; you can use Task List window's sorting property for gathering your special comments.
RoToDo comment here1
RoToDo comment here2
RoToDo comment here3
RoToDo comment here4
todo : comment here1
todo : comment here2
todo : comment here3
Related
I have a recorded Visual Studio Load Test (using Visual Studio 2015).
It seems to have recorded fine, but if I just play it back as it is, I am going to get primary key violations.
I have logic like this in my application:
Ask the web service for an ID.
Take that ID and pass it into a save call.
I know that I can put in the value of a "Context Parameter" using {{ variable }} syntax.
But I have not been able to find a way save a value off at run time into a Context Parameter.
Is there a way to take part of a result and then use it for future calls?
The simple way is to add an extraction rule to the request. There are several types of extraction rule for getting different types of data from the response. They are added via the context (right click) menu of the requests. Select the required extraction rule and set the properties as needed.
More complicated extractions can be done by writing your own extraction rule or by writing a Plugin.
If the text to be extracted can be selected in the "Response" tab of the web test execution results then, sometimes, the context menu of that selected text has a "Add extraction rule" entry (I may have mis-remembered the exact wording). If using this then check the rule that is added. It often creates a rule looking for a very short Starts with string and looking for the Nth occurrence. Eg, in HTML the text Value=" is common and the generated rule might be to find the 17th occurence of alue=. The rule may be a good starting point but works better to select the first (ie index 0) occurrence of a longer string.
(Little or nothing has changed between the 2010 and the 2015 versions of Visual Studio as far as the referenced articles are concerned.)
In atom some special words such as TODO, FIXME, IDEA, NOTE, ... are automatically highlighted in comments inside code. I want to add some words to this list, how can I do?
All of the words you have identified are implemented by the atom/language-todo package and supports TODO, FIXME, CHANGED, XXX, IDEA, HACK, NOTE, and REVIEW words in comments.
language-todo has subsequently been extended to include some extra words in the dkiyatkin/language-todo-extra-words package to include: INFO, DEBUG, REMOVE, OPTIMIZE, UNDONE, TO DO, REFACTOR, DEPRECATED, TASK, CHGME, NOTREACHED, WTF, BUG, ERROR, OMG, ERR, OMFGRLY, WARNING, WARN and BROKEN.
If you wanted even more words then you could extend the grammars of one of the above packages to support the words you would like to see supported. If you need some help with this then feel free to post questions using the atom-editor tag on Stack Overflow or on the Atom Discussion Boards.
I recommend also todo-show. To open it use Ctrl+Shift+T. Is shows list of all todos in project. Yo can redefine keywords it looks for. It's realy nice to manage all todos in project.
While programming I often realize that I need to add something before already typed code. For example I type the name of the variable:
input[0]
and then I realize that my array is of type string and I need to convert it. So, I move to the beginning of the word (with Ctrl-Left Arrow) and start typing
Convert.To|input[0]
with pipe used to show the position of my cursor. I get some suggestions from Intellisense, including the ToInt32() method I am looking for. But as long as I confirm this suggestion with Tab or Space, I get the following:
Convert.ToInt32(|)[0]
So, the text from the cursor position to the end of the word is substituted with suggestion, and this is definitely not what I want.
This problem is not specific for VS 2012 and might be due to some extensions I have installed, but my attempt to pursue its origin did not yield anything. I have following extensions installed: ReSharper, PowerCommands, Productivity Power Tools.
If you are entering an unrelated expression before an identifier, add a space before you start typing the new expression. This will prevent the completion from replacing the existing identifier.
For example, if | marks the caret, the following scenario would avoid the problem you are facing.
Convert.To| input
This code completion feature is designed to prevent the insertion of incorrect identifiers. If Visual Studio behaved like some other IDEs I know of, using the code completion feature in your original example would result in the insertion of ToInt32input, which would never be valid.
If you are interested in additional thoughts regarding this feature in general, I have described this as the Extend (default for Visual Studio) and No-extend (default for NetBeans, Eclipse, and others) modes in my blog article Code Completion filtering, selection, and replacement algorithms.
A two years later answer. But it might still be useful for some.
What helped for me in VS2015 (which might also work in VS2012) is to add the a space character to the list of 'Member List Commit Characters' in the Intellisense settings.
After this the characters after the cursor are not removed by an auto-completion.
Is it possible to reject the check in of files or break the build if a file is checked in which contains a TODO (or certain string) using TFS/TeamCity?
It would need to ignore any files which already contained the TODO and would only be break the build/reject the check in if a file is changed and then checked in.
This could be used to force existing TODOs to be dealt with when a dev makes changes to a file which contains the TODO.
Could this be done?
One way would be to use a Custom FX Cop Rule.
Create a custom FX Cop rule to find TODO in your code.
Enable this Rule in All your current projects as an "Error" when found.
Build the Solution.
Select all of the Code Analysis Warnings that are generated by the Rule and add them to the GlobalSuppression.cs Files.
Check In the above changes.
Now if anyone adds a new TODO they will have to suppress the FX Cop Rule to be able to build the code - unless they add it as a suppression.
Adding a comment such as this:
// TODO: Refactor this code
...creates a task in the Task List that I can view etc. There is a column labeled ! that lets you sort these tasks by priority.
How can I set a specific task's priority?
The priority of the task depends on the keyword you use to tag it. You can see and edit a list of keywords and their priorities by going to Tools->Options->Environment->Task List.
For example, on my installation, I've got HACK, TODO and UNDONE as normal priority, and UnresolvedMergeConflict as high priority.
If you want to add a new tag, type it into the "Name" box, choose a priority, and then click "Add".
A cheap hack is to always put a priority just after the the TODO tag, then sort by description. Only use priority 1-9 to avoid alphabetic sorting confusion.
Any comments without a priority will drop to the bottom.
(Click to enlarge the image)
A very simple way/hack to define the priority is the number of Os at the end of TODO, then you sort the task List by "Description".
Pros:
No need to restrict yourself at 1 or 2 digit numbers
It's funnier than 1-9
I got this idea from a video by Tsoding where he talks about it being an extension for emacs. Link in the video description.