Spell-checking SpecFlow feature files in Visual Studio - visual-studio

Is there a Spell Checker (like http://etherealcode.com/respeller/ or http://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce) that could check the spelling in SpecFlow feature files inside Visual Studio? I've got ReSharper along with ReSpeller installed, but it does not seem to spell-check anything in my .feature files...

I use Visual Studio Spell Checker for spell checking feature files (note that you can also find it in the "Extension Manager" online gallery).
Here's the description from the website:
This extension provides spell checking support for various "natural
language" portions of files. This includes:
* Plain text files (the entire file is spell checked)
* Source code (comments and strings are spell checked)
* HTML/ASP (things that aren't HTML tags are spell checked)
Custom dictionaries can also be added to spell check in different languages (e.g. OpenOffice versions 2, 3, and 4 dictionaries).

I've not seen one in VS, but that doesn't necessarily mean that is a problem.
Let's consider how you create your scenarios and features. In best practice, these are created from a conversation between the stakeholder and the developer. Think if it, if you like, as akin to pair-programming, this is pair-specification design. This process would start with a verbal conversation and only as we find common understanding do we then reach for a tool to record this.
Since features are just plain-text specification files then there are many tools that can record this. To me, VS feels a little one-sided in favour of the developer. Why not be more partisan and instead use email so you can both use its spell-checker and send both parties a copy of exactly what was agreed upon? Maybe use Word, or any other tool that can save as plain-text.

Related

Is it possible to auto-format code in Visual Studio's Web Essentials

I would like to have a way to auto-format specific code in Web Essentials to suit our internal design rules. So, for example, when a user types a hex code with lower case letters, it will automatically set all letters in the code to upper case. I've been searching around for a solution to this but I can't seem to find anything or know if it's even possible.
For clarity, I would like to "write" a set of rules (ideally to a file that could be distributed) that people could use to auto-format their code.
In addition to this, is it possible to output a block of code from a smaller, pre-defined string of text. So, for example, instead of writing out:
/*------------------------------------*\
Tables
\*------------------------------------*/
the user could write:
section Tables
and have it output like above.
Thank you in advance.
JetBrains Resharper is my opinion the best tool for Visual Studio that can help with all of this (and much more). Some find it expensive and might slow down Visual Studio somewhat if you're using an older computer.
https://www.jetbrains.com/resharper/

Handling white space and formatting in source control

I work on a team that uses TFS for source control. Recently some team members are complaining that others are checking in files that have been heavily modified in the sense that the IDE (Visual Studio) has done some sort of automatic formatting on them. This is particularly burdensome on users who make heavy use of the comparison functionality. I am admittedly unfamiliar with the nuts and bolts of Visual Studio. One member has suggested that we all use the same editor settings so that this doesn't happen.
Is having all team members adopt the same code editor settings the best way to handle this problem?
Having everybody use the same settings is a good idea in general. If everybody adheres to the same format, settings, and conventions, then this can help reduce the "learning curve" when switching between code that another person wrote.
That being said, if most of the differences are whitespaces then that may indicate a shortcoming of the diff tool. Fortunately, Visual Studio allows you to swap out the built-in diff tool with something of your choosing. You just have to find one that works best for your needs. KDiff3 is a pretty good one.
Here's an example on how to configure KDiff3 with Visual Studio. There's a setting (possibly a command line parameter) in KDiff that you can set and it will ignore whitespace differences.

binary files in team foundation server

We recently switched to team foundation server 2010 for our source code management, everything works just fine, except for some legacy code written in FoxPRO 7 and 9, source code files are some sort of tables. For Forms, there are two kind of files, one ending in .scx and another in .sct, both can be explored using the fox studio but there is no way to open them in a text editor.
does anyone have any experience getting the fox code to work/merge... on TFS ?
I'm not aware of all of the ins and outs for source control and FoxPro, but if some of the source is binary, you can configure file extensions to disallow merges.
Right-click on the collection (root node) in the TeamExplorer window. Go to Team Project Collection Settings | File Types.
You should be able to add the extensions (like .sct), and specify that merging and multiple checkout is not allowed for those files.
The downside will be that only 1 person at a time can check those files out, but since the forms are FoxPro tables, I would imagine that's the same problem that you would have with any source control tool.
For merging you can set up a merge tool that is capable of merging those files. This must be done on every developer station (Tools->Source Control->VS Team Foundation Server->Configure User Tools).
It may be that VS uses a server-side merge tool to do auto-merges, I don't know if or where you can change that.
I've worked with VFP since it was FoxBase back in late 80's. Visual Foxpro used .dbf files (renamed extensions) for purposes of building forms (.scx/.sct) and visual class libraries (.vcx/.vct) and reports (.frx/.frt).
I've written some code to run through a given project and dump out a text version of all the code as if it was all text-based. All the controls are dumped in alpha order, embedded procedures, etc too. List all property settings in same place too.
Its not PERFECT, but I've used over the years in comparing source code versions when dealing with other developers who liked to change things and not notify me (or others) of such changes and finding later by other horrendous means.
If this is something you might be interested in, I can strip-down the code (some) and send it to you via an email, but would need an email address. The code is written in VFP as a .prg file, so nothing compiled that you would need to worry about any viruses or anything.
At least this way, you COULD get a text version associated with the binary pair's of files used within VFP.

Alternatives for "Find in Files"

I've fallen foul of the "find-in-files-isn't" issue as suggested here and reported on Connect, but it seems that the issue will not be fixed until "the next major release" of VS.
While I could live with the issue and work-around of "clean source tree, restart VS", I still can't trust that it is not giving me false negatives.
Some form of "Find in files" is critical to aggressive refactoring across a source tree, so I'm looking for an alternative. Ideally a pluging to VS, but I'd settle for a good external app that could support regex and file type filters
I don't trust Windows Search (for similar false negative reasons).
Any suggestions?
Tools I use and like:
I have found grepwin to be a good tool to find and also replace things in text files.
It is easy to install, easy to use, and it can replace... it can show the contents of the file, the line that it found the text, and has support to regular expressions. Lots of things to play with, in a single interface.
It covers all your requirements, but this: 'Ideally a pluging to VS'... but it can be integrated manually, like described bellow.
Supports: 'aggressive refactoring' =), 'regex' and 'file type filters'.
Home page or http://tools.tortoisesvn.net/grepWin.html
Download page
Integrating manually:Integrating grepWin into Visual Studio
I like it and used it for some time now.
Other tools:
If you don't like it take a look here:
http://www.thefreecountry.com/programming/searchandreplace.shtml
lots of external tools exists... you could eventually make a VS Macro to open the external application, and give it some parameters. But this is just an option... I would not follow this option, because it is too complex for the matter.
I use Resharper with Visual Studio 2008, and this lets me search through classes (with Ctrl + T) or find find through files (Ctrl + Shift + T)
Visual Studio 2010 has this search functionality built in if I can remember it correctly.

Visual Studio 2005/2008: How can you share/force all developers to use the same formatting rules?

I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules?
I would like to not rely on export/import settings as that brings many settings along. I (for example) don't care what font colors the developer uses when typing, I just want similar formatting. Can you import a subset of settings?
StyleCop, originally called "Source Analysis" is the best choice for C#. The first version was rather inflexible, but after recognizing the value that it provides for the community, Microsoft has opened it up to extensions and customizations. It's a solid tool.
For Visual Studio settings, it's trivial to export a sub-set of your settings into a .settings file and require that other team members import and use these settings.
Like any standards, the tools are only as good as the team members, so it probably goes without saying that you will need team buy-in regardless of what tool you use for enforcement.
If you're using C#, take a look at StyleCop.
Visual Studio uses the settings in Tools > Options > Text Editor > [your language] > Formatting to set how it auto-formats code.
You can set it up how you like and then use Tools > Import and Export settings to create a .settings file for your team to import and use. It won't enforce rules, but it will make the default VS behavior the same for everyone.
There is a tool called NArrange which will arrange your code. This is particular useful to avoid conflicts in source control systems, but also has several other advantages. Check out the web site.
No-one's mentioned Team Settings yet? You just export the desired settings to a network share, then get everyone to map to it. Job's a good 'un.
Tools -> Options -> Import and Export Settings, then tick "Use Team Settings"
An extensive use of Visual Assist's snippets (bits of pre-formatted codes) may help...
I second Luke's answer. StyleCop can help you enforce common coding style across your team. If you want to share formatting rules take a look at ReSharper AFAIK it allows you to export and share this settings.
Editor settings are stored in the registry, so no luck having a single source for them. You'll need to go with an external tool to ensure uniformity.
A free, quick solution would be exporting the relevant registry settings and loading them up on everyone's machine. They'll still be able to change them (and they will -- naughty developers!), but you'll at least have a common starting point.
We use the following tools:
StyleCop (as mentioned before)
Resharper
StyleCop for Resharper
The reason we use the latter two is twofold: First you are able to do a Clean Up of your code. This allows you to clean your code in one go and solve all warnings. At least that is what the brochure says. In reality you need to set quite a few settings in Resharper. Have a look at links like this to see how that works. Second: Resharper integrates the Stylecop violations in the source editor. Extremely useful as they are visible while writing code and can therefore be solved on the spot.
Code Review.

Resources