allthedrones / agentsmithplugin

Automatically exported from code.google.com/p/agentsmithplugin
0 stars 0 forks source link

Request: Resharper 6 compatible plugin #173

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm currently using Resharper 6 EAP and I guess the beta will be released in a 
couple of weeks I just want to know if you will port agentsmith to Resharper 6.

Original issue reported on code.google.com by nebri...@gmail.com on 10 Jun 2011 at 12:47

GoogleCodeExporter commented 8 years ago
@robert i'd guess it's something to do with the install - the plugin is 
definitely marked 1.5.0.1 and it shows as 1.5.0.1 in the resharper options for 
me... That extra space behavior should be fixed.

Re the single line comments - i might have changed something accidently (or 
resharper might have changed some behavior under it - i'll double check.

@mvonballmo: The bulb items for the documentation highlights will let you 
configure the level of warning they show as. Select one and choose "Inspection 
options for...". You can then choose the level you'd like. Only restriction is 
that public, protected and protected internal are currently grouped into one 
(being the same as the compile warning you get if you generate xml 
documentation).

Original comment by cds...@gmail.com on 5 Jan 2012 at 9:08

GoogleCodeExporter commented 8 years ago
@mvonballmo: also - there's a bug :) I just looked at the code and the private 
highlight accidently shares the same id as the public one.

I'll fix that and post a new version (maybe towards the end of my day in case 
other things turn up).

Original comment by cds...@gmail.com on 5 Jan 2012 at 9:10

GoogleCodeExporter commented 8 years ago
@robert:

Ah - yes i have changed it accidently to get the retag and reflow thing going 
(which is much more useful for me :$)

Hmm... do you have a rule about when you want the tags and text all on the same 
line or do you really need the old behavior where it would always inline 
things? (which i found incredibly annoying so i guess is why i didn't notice).

Original comment by cds...@gmail.com on 5 Jan 2012 at 9:22

GoogleCodeExporter commented 8 years ago
@cds: As 'forever...' pointed out, I believe that the old behavior was that if 
it was inline, it left it inline; if it was 'out-of-line', it left it 
'out-of-line'.  This is my preferred behavior that I found quite useful.  As my 
previous example showed, I was able to reflow and have an output similar to the 
following where the summary is out-of-line and the params are inline:

/// <summary>
/// Foo3 demonstrates what Rob expects.  One space at the beginning of each 
line and the
/// parameter is untouched (with tags inline).
/// </summary>
/// <param name="someParam">Some description.</param>
private void Foo3(bool someParam)
{ }

In summary, I liked the old behavior just fine.

Original comment by robert.w...@gmail.com on 5 Jan 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Ok well I'll have a go - they've changed the way white space gets reported so 
it may take a fair bit of trial and error...

Original comment by cds...@gmail.com on 5 Jan 2012 at 10:15

GoogleCodeExporter commented 8 years ago
The parameter wrapper is a bit overzealous. I imagine that it's matching 
against the R# database of symbols, but should we instead restrict to a more 
local subset? Parameters only? Or should class-names be searched as well? I'm 
not sure what's being searched right now (still haven't had a chance to grab 
the source ... sorry), so I can't say what's going wrong.

Original comment by mvonbal...@gmail.com on 6 Jan 2012 at 12:52

Attachments:

GoogleCodeExporter commented 8 years ago
Mmm - i've had that too. You can change the search level in the AgentSmith 
options however the default is "Project Only" (the minimum). Usually 
highlighting "A" means you have a class called "A" in your project. I made the 
"Retag & Reflow" always ignore "A" so that it wont automatically expand that.

The easiest way around it is to add "^A$" to the set of ignore regexes for 
metatagging in the Xml Documentation options. Perhaps the default for that 
setting should include that in the future.

Original comment by cds...@gmail.com on 6 Jan 2012 at 9:41

GoogleCodeExporter commented 8 years ago
Hi all,

I've posted beta 3 which includes the following changes:

- Temporarily removed SmartPaste menu item (because it broke Visual Studio's 
menus).

- Fixed basic comment reflow (should be back to R#5.1 functionality)

- Greatly improved the Reflow & Retag option:
   - Now uses XML parsing so should be more robust (although it'll remove your comment if the XML is malformed to start with).
   - Will replace not-quite-right tags with the correct ones:
      - html style lists (<ul> or <ol>) are replaced with xml doc lists of the appropriate type
      - html <p> </p> is replaced with <para> </para>
      - "return" or "result" is replaced by "returns"
      - "remark" is replaced by "remarks"
      - tags/text directly within a list are promoted into a <item>
      - <list> with no type becomes a bullet list.
      - ...

   - Will correctly handle <code> sections (leave formatting _exactly_ as it was. Aside from:
      - Will replace usage of < or > in code sections with < or > (this should become an option in future).
   - Will handle non-xml-doc tags (should be an option in future to replace the < and > in unknown tags with < >)
   - Better automatic identifier metatagging - now only inserts the metatag if there's only one possible target and it's already referenced in the file.
   - existing crefs are collapsed to the most brief version possible.

- Greatly improved the "wrap in metatags" detection in general:
   - Now will insert the correct namespace lookup if required (ie namespace is not referenced in this file)
   - Scoping options improved to allow "Project & Usings" which will only search types defined in the project plus libraries referenced in the file.
   - Support for types defined within other types (eg if class A contains a definition for class B and B appears in a comment then the suggestion will be <see cref="A.B"/>).

- Support for negative contractions reinstated (eg: "can't" is not a spelling 
error anymore).

- Misc other fixes (which i cant remember).

Original comment by cds...@gmail.com on 9 Jan 2012 at 11:56

GoogleCodeExporter commented 8 years ago
@robert, this should bring the Reflow action back to what you wanted.

@mvonballmo, try out the "Project & Usings" scope - this should be a lot less 
zealous than the previous metatagging.

Also - anyone that installed beta 2 will need to fix their menus as per 
@nebria80's comment here: 
http://code.google.com/p/agentsmithplugin/issues/detail?id=178

Sorry for the hassle all - turns out the SmartPaste menu item broke visual 
studio :S I've disabled it in beta 3.

Original comment by cds...@gmail.com on 9 Jan 2012 at 12:00

GoogleCodeExporter commented 8 years ago
I see you have done work on validation of tags fixing mistakes :) this is 
great. 
I saw you explicitly improved handling of the <code> tag I had raised issue@ 
#174 http://code.google.com/p/agentsmithplugin/issues/detail?id=174 is this 
syntax going to cause a problem? Sorry for mixing issues :)

Kris

Original comment by kri...@gmail.com on 9 Jan 2012 at 12:04

GoogleCodeExporter commented 8 years ago
After installing beta 3 I am still seeing the private methods underlined red, 
with a red mark in the R# right hand document gutter, the red mark has an empty 
comment, and there are no relevant suggestions for right-click. 

Original comment by rexm...@gmail.com on 10 Jan 2012 at 8:49

GoogleCodeExporter commented 8 years ago
Hi All,

Another beta (v4 now)

Changes:

- Fixed bug that would cause multiple errors on properties without doco
- Fixed spell checking around <code> tags with no body
- Heaps more "Reflow & Retag" changes:
   - Fixed many places where odd things would happen to <see> tags
   - Fixed various whitespace issues
   - Options! You can now choose where newlines are inserted and indents occur
   - Indenting - the tool can optionally re-indent your xml
- Added code-cleanup steps for "Reflow" and "Reflow & Retag". The first is on 
by default in "Reformat Only" mode and the second is on by default in "Full 
Cleanup". Open to changing these defaults...
- Added "Reflow" and "Reflow & Retag" entries to the tool menu which will apply 
those actions to the current file.

- probably other things i cant remember

Cheers,
Chris

Original comment by cds...@gmail.com on 15 Jan 2012 at 12:36

GoogleCodeExporter commented 8 years ago
@rex

beta 4 should fix the issue you were having.

@kris

beta 4 should also deal with <code ... /> comments correctly.

Original comment by cds...@gmail.com on 15 Jan 2012 at 12:37

GoogleCodeExporter commented 8 years ago
@Chris, I installed Beta 4 and tried the new "Reflow and Retag" options.  (For 
fun) I set my summary to Never "Place tags on new lines" and then did the 
reflow/retag.  I ended up with one extremely long line.  I expected to get two 
lines with the begin tag and some text on the first line, and then, the end of 
the text and the end tag on second line; similar to when I do just the Reflow 
option.

Got:
<summary>My text that is too long to fit on one line.</summary>

Expected (as you get when you do just a reflow):
<summary>My text that is too long to
fit on one line.</summary>

Additionally, I noticed that the spacing after a period is always one space.  
My personal preference is two.  Could that be added a configuration option?

Oh, the options were a great idea!  Thanks for all of your hard work.

Original comment by robert.w...@gmail.com on 16 Jan 2012 at 5:57

GoogleCodeExporter commented 8 years ago
I second the thanking for all the hard work. Yesterday I was able to upgrade to 
resharper 6.1 because of your effort m8. Cheers! 

Original comment by plebm...@gmail.com on 16 Jan 2012 at 11:10

GoogleCodeExporter commented 8 years ago
Yes thank you for the work on this, I am a new developer and I just loved the 
previous one. Now at risk of sounding like an idiot and getting laughed out of 
here, I can't seem to get this to work. I download the .dll and dictionary 
folder. I placed the files in C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\Agent Smith, I have also tried the 
v6.0 route as well. Inside visual studio (2010) I open the 
ReSharper-->options-->plugins and I see agent smith checked and looking like 
its ready to go, but I see no options in miss spelled comments or anything 
showing it is working. Just to try every angle I have also put it in the 
C:\Users\myuser\AppData\Roaming\JetBrains\ReSharper\vAny\Plugins\AgentSmith 
folder. Here it also shows in the plugins menu of resharper but when I press 
"show developer information" I get a lot of red about the dic not being a valid 
.net assembly, where as the other one I do not. I know people who use blogs to 
just ask for help without making an effort are really annoying and I want to 
shoot them all, but I really have tried and still can't get it to work. If 
anyone has a minute and they can point me in the right direction please Let me 
know.

Original comment by scottla...@gmail.com on 17 Jan 2012 at 5:17

GoogleCodeExporter commented 8 years ago
@robert Yep - i'd like to do the style you were expecting as well. Perhaps that 
should be "Never" and a new option should be added for the current (intended 
but mis-named) behavior.

Double space after a period should be easy - i'll have a go.

Original comment by cds...@gmail.com on 17 Jan 2012 at 9:24

GoogleCodeExporter commented 8 years ago
@scott> Your issue may be that you have _too_ many installs. You need to only 
install in one location at a time otherwise resharper will not load the plugin 
correctly.

Also, when you say "i tried the 6.0 path also", does this mean that you have 
R#6.0 installed? You must have 6.1 (only) installed for the plugin to work.

To be clear, on a 32bit version of windows the file paths should be:

C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\AgentSmith.dll
C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\de-DE.dic
C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-AU.dic
C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-CA.dic
C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-GB.dic
C:\Program Files\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-US.dic

And on 64bit windows they should be:

C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\AgentSmith.dll
C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\de-DE.dic
C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-AU.dic
C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-CA.dic
C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-GB.dic
C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\dic\en-US.dic

You should not have any other AgentSmith.dll files anywhere else on your system.

It's ok to see errors re not being able to load the .dic files - basically 
resharper tries to load all the files in the plugin folder regardless of their 
extension but the .dic files are not .NET assemblies so it fails.

Sorry I haven't got an installer going yet - not sure why but the WIX installer 
build file doesn't seem to work for me. Possibly i dont have some component 
installed.

Original comment by cds...@gmail.com on 17 Jan 2012 at 9:36

GoogleCodeExporter commented 8 years ago
@cds> Thank you very much for your reply. I do have R# 6.1 installed. I have 
been playing around with trying to get this to work on my machine since the 
first beta release. 

Right now there is only 1 copy of AgentSmith on my machine located at:

C:\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\Agent Smith

and it has the dictionary and .dll in there.

R# sees it as a plugin after VS is restarted. I can't make it work though. I 
should expect to see an underline on a misspelled word in a comment, correct? 

Thank you for taking the time to give me a hand here, it is really appreciated.

Original comment by scottla...@gmail.com on 17 Jan 2012 at 10:27

GoogleCodeExporter commented 8 years ago
@scottla

Agent smith doesn't spell check comments (ie // miszed speilled or /* miszed 
spleilled */

If you'd like such behaviour you're doing to need to make a few changes. I've 
uploaded my version of the StringLiteralScanDaemonStageProcess.cs and also the 
fully compiled agent smith dll 

Would anyone like me to make this an configurable option and contribute a 
patch? Please note that spell checking comments is a bit hit and miss. Although 
I've always used it like this, and a few years on now, never really had a 
problem. (You can read more about it here 
http://code.google.com/p/agentsmithplugin/issues/detail?id=33)

Original comment by plebm...@gmail.com on 17 Jan 2012 at 11:10

Attachments:

GoogleCodeExporter commented 8 years ago
OK, my bad. I had thought that the spell check was one of the core components 
of the rebuild. I have always been very poor at spelling and having a check on 
comments and strings really helped me. Nothing more embarrassing then having a 
misspelled dialog box pop up to a client after the testing team misses it. I 
will take a look after work today and maybe be able to come up with something.

Thank you,

Original comment by scottla...@gmail.com on 18 Jan 2012 at 3:15

GoogleCodeExporter commented 8 years ago
AgentSmitth is working for documentation comments 
/**
 *
 */

I would like ot see it in comments // and /* */ to. Also the new reflow stuff 
is nice to automatically break long comments at 80 char :)

As for installation folder please keep in mind you can also put this stuff to 
%AppData% like I do. ;)

Original comment by nebri...@gmail.com on 18 Jan 2012 at 3:35

GoogleCodeExporter commented 8 years ago
@scottla

Agent smith does check strings. For example var blah = "miszed spelled";

Just not

(No) // Miszed spelled comment before my miszed spelled string 
(No) /* Miszed spelled comment before my miszed spelled string */
(Yes) var blah = "miszed spelled";

Original comment by plebm...@gmail.com on 18 Jan 2012 at 11:57

GoogleCodeExporter commented 8 years ago
Ok, I've checked in changes to add spell checking for regular comments. I've 
done it slightly differently from the file @plemail attached just to split 
things up a bit and give comments their own options etc. Also it uses a 
different parser so it doesn't look for escape characters.

I'll build a new download soon.

Re the install location - yep there are several different places you can put it 
however, in the interests of debugging, it's convenient if it's in a known 
location :)

Original comment by cds...@gmail.com on 19 Jan 2012 at 1:08

GoogleCodeExporter commented 8 years ago
I have noticed that AgentSmith is really slowing down the editor.  
Surprisingly, it slows down all typing, not just in comments.  Seriously, I can 
type several words and then I have to wait 3-5 seconds for the words to appear 
on the screen.  It is so bad that I had to turn off AgentSmith.  It is causing 
more harm than good.

Did the spell checker get more aggressive?  My number one feature is the 
ability to wrap comments; so, for my own self reasons, would it be possible to 
add an option to turn off the spell checker (perhaps for XML and regular 
comments as separate options)?

FYI, my test file has about 750 lines defining constants.  So I have something 
like:
/// <summary> 
/// These are my constants. 
/// </summary>
public class Constants
{
    /// <summary>
    /// Some comment
    /// </summary>
    public const string MyConst = "Something";

    ...repeat for about 200 entries...
}

Original comment by robert.w...@gmail.com on 24 Jan 2012 at 4:57

GoogleCodeExporter commented 8 years ago
I have noticed that spell checking fails when I have a <see cref=""/> in my 
comment.

I have got version 1.5.0.4 installed.

Example:

/// <summary>
///  This is my summarry <see cref="string"/> and the summmarry continues after.
/// </summary>

The first spelling mistake is identified and the second isn't.

If I change the comment to:

/// <summary>
///  This is my summarry <see cref="string"></see> and the summmarry continues 
after.
/// </summary>

Both spelling mistakes are identified.

Possibly a similar parsing error to the <code source=""/> problem.

Thanks

Kris

Original comment by kri...@gmail.com on 24 Jan 2012 at 5:29

GoogleCodeExporter commented 8 years ago
Ok, I've posted beta 5 which has these changes:

- Add spell checking within end-of-line and C style comments
- Options to disable as-you-type spell checking
- Hopefully address speed issues
- Fix issue with tags that dont have bodies in xml documentation comments.

Original comment by cds...@gmail.com on 24 Jan 2012 at 10:33

GoogleCodeExporter commented 8 years ago
@robert, see if this new beta improves your speed issues. I've put in some code 
to bail out of the various analysis tasks much sooner if the analysis is 
interrupted (ie the user continues typing).

@kris, this should also fix your issue - it was actually caused by the change i 
made for the <code ... /> issue :(

Cheers,
Chris

Original comment by cds...@gmail.com on 24 Jan 2012 at 10:37

GoogleCodeExporter commented 8 years ago
@robert, also you can try turning on and off the "Update spell checking as you 
type?" options under Strings and Inline Comments in the options and see if that 
helps.

Re turning off spell checking completely, you can do that by just removing the 
dictionary name from the relevant options page.

Original comment by cds...@gmail.com on 24 Jan 2012 at 11:07

GoogleCodeExporter commented 8 years ago
thanks I will try it out tomorrow (UK time :)

Original comment by kri...@gmail.com on 24 Jan 2012 at 11:11

GoogleCodeExporter commented 8 years ago
@Chris, the speed issues appear to be resolved (in version 1.5.0.5).  I have 
used it for several days now without noticing any slowdowns.  I haven't needed 
the options; but, I took a look at them today anyway.  I am not sure that 
either "Update spell checking as you type" options are working correctly.  For 
the function header, I can't tell a difference between the option being checked 
and not checked.  It always updates about 0.5 seconds after I stop typing.  For 
inline comments, I can't get it update hardly at all.  The only way I got the 
inline comments to spell check was to modify the function header.  

Additionally, perhaps the 'Strings' section in the options should be renamed to 
'Function Header' or similar because it is ambiguous (between function headers 
and inline comments)?

Original comment by robert.w...@gmail.com on 31 Jan 2012 at 7:35

GoogleCodeExporter commented 8 years ago
@scottla, I am having the same problem you describe.  Did you or anyone else 
figure out what the problem was?

I have one copy of AgentSmith on my machine at C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\Agent Smith.  The plugin shows up 
under R# Options->Environment->Plugins, but appears to do nothing. I see no new 
options showing up under the ReSharper options and no spell checking happening 
in strings or in comments.

I have version 1.5.0 Beta 5 with ReSharper 6.1 and running on Windows 7 64bit.  
If anyone could point me in the right direction, I would really appreciate it.

Thanks!

Original comment by BrianZel...@gmail.com on 2 Feb 2012 at 7:55

GoogleCodeExporter commented 8 years ago
Chris, this thread has been quiet for almost a month now.  Yay!  Perhaps it is 
time to make a non-beta release?  

I'd like to speak for everyone and give you a hardy thanks for all of your 
efforts.

Original comment by robert.w...@gmail.com on 27 Feb 2012 at 3:05

GoogleCodeExporter commented 8 years ago
I have the same problem as @scottla and @BrianZel I see the plugin in R# 
Options->Environment->Plugins but there are no settings for new plugin in 
resharper options and spell check isn't hapening.

I work on Windows 7 64 bit with Visual Studio 2010 SP1 Ultimate installed. 

JetBrains ReSharper 6.1 Full Edition
Build 6.1.37.86 on 2011-12-20T20:15:24

Original comment by r.zuc...@gmail.com on 23 Mar 2012 at 9:35

GoogleCodeExporter commented 8 years ago
Same issue for me. Agent Smith shows up in R# Options->Environment->Plugins and 
is activated but:
- I don't see Agent Smith's options under C#
- I don't see any spell check happening.
- I don't have the "Reflow" action for documentation comments (ex. method 
header).

In other words it looks like Agent Smith is not loaded... but I know it is 
loaded because I cannot delete its DLL while Visual Studio is running.

My setup:
- Agent Smith 1.5.0.5 in C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith (I made sure that there 
are no other AgentSmith.dll anywhere else on my system)
- ReSharper C# Edition 6.1.1000.82 (latest as of this post)
- Visual Studio 10.0.40219.1
- Windows 7 Professional 64-bit

Original comment by jeansebastienkovacs on 5 Jun 2012 at 6:33

GoogleCodeExporter commented 8 years ago
I actually did get this to work, eventually.  Try installing the plugin under 
“C:\Users\YOURLOGIN\AppData\Local\JetBrains\DotNet\vAny\Plugins”.

I tried both 
“C:\Users\YOURLOGIN\AppData\Local\JetBrains\ReSharper\vAny\Plugins” and 
“C:\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\plugins” and neither 
of these locations worked for me, but it did work correctly when I moved it to 
“C:\Users\YOURLOGIN\AppData\Local\JetBrains\DotNet\vAny\Plugins”.

Original comment by BrianZel...@gmail.com on 18 Jun 2012 at 8:14

GoogleCodeExporter commented 8 years ago
Just (re-)found AgentSmith and thought it maybe helpful for me/us. But we're 
already using R# 6.1 ...

Since ReShaper still offers no spell checker (see 
http://youtrack.jetbrains.com/issue/RSRP-39695) AgentSmith will be helpful for 
spell-checking .resx files, right?

Original comment by harald-r...@hotmail.com on 3 Jul 2012 at 11:34

GoogleCodeExporter commented 8 years ago
Just tried to install the plugin to a proper location (FYI: ReShaper | Options 
> Plugins > Show Developer information) will give you proper locations.

But after installing and re-staring VS:

 Untitled by Anonymous version 1.4.3.32120
No comment.
Error PluginLoader: The file “C:\Program Files 
(x86)\JetBrains\ReSharper\v6.1\Bin\Plugins\AgentSmith\AgentSmith.dll” 
references product version 5.1 which is incompatible with currently running 6.1

Original comment by harald-r...@hotmail.com on 3 Jul 2012 at 11:44

GoogleCodeExporter commented 8 years ago
You have downloaded the wrong version. Take a look into the download section 
and you will find AgentSmith 1.5.0 Beta 5 (R#6.1).zip which works fine with R# 
6.1.

If you place the files in 
%appdata%\JetBrains\ReSharper\v6.1\Plugins\AgentJohnson it should work.

Original comment by nebri...@gmail.com on 3 Jul 2012 at 12:27

GoogleCodeExporter commented 8 years ago
Well, I downloaded the latest version from http://www.agentsmithplugin.com ...

Thanks for your input, I'll download the latest version from Google Code site 
;-)

Original comment by harald-r...@hotmail.com on 3 Jul 2012 at 2:51