Giter Site home page Giter Site logo

codecadwallader / codemaid Goto Github PK

View Code? Open in Web Editor NEW
1.9K 81.0 348.0 15.16 MB

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.

Home Page: http://www.codemaid.net

License: GNU Lesser General Public License v3.0

C# 100.00%
c-sharp clean-code vsix visual-studio dotnet

codemaid's People

Contributors

adontz avatar ahalassy avatar blythmeister avatar bonimy avatar chrish07 avatar codecadwallader avatar deffiss avatar derekmckinnon avatar flagbug avatar gammawolf avatar ikappas avatar iouri-s avatar jamiehumphries avatar jammer77 avatar jasonjtyler avatar jetpackduba avatar jlbeard84 avatar kyleruddbiz avatar lowjoel avatar maikebing avatar reima avatar roquedeicide avatar samcragg avatar smartis2812 avatar thehutman avatar w5l avatar willemduncan avatar willemengel avatar ygoe avatar zastrowm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codemaid's Issues

About dialog can become invisible and block Visual Studio

Steps to reproduce:

  1. Select "About" command from "CodeMaid" menu in Visual Studio 2010, CodeMaid 0.7.4
  2. Click on the website link so that the browser opens and completely covers the about dialog
    3a. Click on the Visual Studio window that is visible behind the browser; or
    3b. Click on the Visual Studio button in the Windows taskbar

Actual result:
Nothing happens.

Expected result:
Visual Studio and the modal CodeMaid about dialog come to the foreground.

Workaround:
Minimise the web browser (or other foreground windows) and hope that the About CodeMaid dialog appears again so you can click on it to close it and unblock Visual Studio.

Suggested fix:
Just stick with the platform standard window frame and things should work as usual...

VS freezes when CodeMaid reorganizes duplicate regions

VS freezes when CodeMaid is doing reorganizing & cleaning, I had to end VS process and tried several times but had the same issue. Then I noticed that my class accidentally had two regions of the same name (Properties) and as soon as I joined the props in one region reorganizing & cleaning worked as expected.

One more thing that I noticed is while VS was frozen it was constantly switching the reorganizing then cleaning then reorganizing then cleaning etc. in the bottom left corner of the VS.

Regards

Error on trying to open configuration

Visual studio 2013 (update 4) throws an error when trying to go to the configuration screen
(Codemaid version 0.7.4)

"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

Screenshot:
error

Reorganizing performance

Currently reorganizing a file with > 400 LOC is super slow, do you think you can tweak the performance of the reorganization logic a bit?

If not, maybe you can give me a quick guide how I can profile the reorganization logic so I can see if I can squeeze some performance out if it myself?

Cannot build CodeMaid solution

Hi Steve,

I'm trying to debug CodeMaid but I have some issues: the following references are not found on my system:
codemaid unfound references

I'm working on Windows 7, VS2013 (never installed VS2010) and I installed the VS2013 SDK as indicated on the Contribute page.

It seems that the references in the project target the version 10 of the dlls, while I could only find the version 12 of them on my system.

So I tried to replace all of those references by their corresponding v12, then update all the XAML code as needed. Basically, I replaced:

  • xmlns:platformUI="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.10.0"
  • by xmlns:platformUI="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.12.0"

...in AboutWindow.xaml, CleanupProgressWindow.xaml, OptionsWindow.xaml and YesNoPromptWindow.xaml.

But now I have the following error (in the CodeMaid project, no file - no line) at build that I don't know how to solve:

Cannot find the interop type that matches the embedded interop type 'Microsoft.VisualStudio.Shell.Interop.IVsWindowSearch'. Are you missing an assembly reference?

interop error

What do you think? Should I just install the VS2010 SDK?

Xml Doc comments with <code> blocks

Documentation comment below is not recognized by CodeMaid. When I use ContextMenu->CodeMaid->Format Comment I get the message in status bar: "CodeMaid did not find non-code comment in the selection(under the cursor) to reformat".

/// <summary>
/// Subtracts right solid from left one.
/// </summary>
/// <remarks>
/// <code>
/// +-------+            +-------+
/// |       |            |       |
/// |   A   |            |       |
/// |    +--+----+   =   |    +--+
/// +----+--+    |       +----+
///      |   B   |
///      |       |
///      +-------+
/// </code>
/// <para>Implementation of this operation comes from set theory: subtraction is negation of union of negated first object with second one.</para>
/// </remarks>
/// <example>
/// <code>
/// // Create a tube.
/// const float tubeOuterRadius = 2;
/// const float tubeShellThickness = 0.1f;
/// const float tubeLength = 100;
///
/// Vector3 leftCapPoint = new Vector3();
/// Vector3 rightCapPoint = new Vector3(tubeLength, 0, 0);
///
/// Solid outerCylinder = Solid.Cylinder(leftCapPoint, rightCapPoint, tubeOuterRadius);
/// Solid innerCylinder = Solid.Cylinder(leftCapPoint, rightCapPoint,
///                                      tubeOuterRadius - tubeShellThickness);
///
/// Solid tube = CSG.Subtract(outerCylinder, innerCylinder);
/// // Create a frame.
/// const float frameSize = 10;
/// const float frameThickness = 0.5f;
///
/// const float innerCuboidThickness = frameSize - frameThickness * 2;
///
/// Solid outerCube = Solid.Cuboid(null, new Vector3(frameSize));
/// Solid firstInnerCuboid = Solid.Cuboid
/// (
///     null,
///     new Vector3
///     (
///         frameSize + 2,
///         innerCuboidThickness,
///         innerCuboidThickness
///     )
/// );
/// Solid secondInnerCuboid = Solid.Cuboid
/// (
///     null,
///     new Vector3
///     (
///         innerCuboidThickness,
///         frameSize + 2,
///         innerCuboidThickness
///     )
/// );
/// Solid thirdInnerCuboid = Solid.Cuboid
/// (
///     null,
///     new Vector3
///     (
///         innerCuboidThickness,
///         innerCuboidThickness,
///         frameSize + 2
///     )
/// );
///
/// Solid cubeFrame =
///     ConstructiveSolidGeometry.Subtract
///     (
///         outerCube,
///         ConstructiveSolidGeometry.Union
///         (
///             firstInnerCuboid,
///             ConstructiveSolidGeometry.Union
///             (
///                 secondInnerCuboid,
///                 thirdInnerCuboid
///             )
///         )
///     );
/// </code>
/// </example>
/// <param name="a"> First solid. </param>
/// <param name="b"> Second solid. </param>
/// <returns> Result of subtraction. </returns>
public static Solid Subtract(Solid a, Solid b)

Comments without code blocks are usually recognized properly.

Above comment is processed by Sandcastle properly.

CodeMaid 0.7.4 no longer works on plain VS 2010 on plain Windows 7.

CodeMaid 0.7.4 apparently switched to .NET 4.5. This means that it will no longer work on a plain Windows 7 system with VS 2010, as such a system does not by default have .NET 4.5.

There are good reasons for not wanting .NET 4.5: it is an in-place update to .NET 4.0, thereby hiding the bugs in .NET 4.0. This in turns makes it impossible to truly develop targeting .NET 4.0 once you have installed .NET 4.5. One of these bugs hidden in .NET 4.5 that we have run into on .NET 4.0 is the "'DeferRefresh' is not allowed during AddNew or EditItem transaction" bug, see e.g. http://stackoverflow.com/questions/15025865/wpf-datagrid-not-exiting-edit-mode .

VS2012 can hang on build with auto-cleanup and unsaved changes

Transfer from Kevin Butler's BitBucket 280

Visual Studio hangs when building(F6) if there are unsaved files. I have several pretty small files open in VS. I make changes to 1 or more files and hit F6 to build. More often than not, VS will freeze and I have to kill it from Task Manager. My save works so I don't lose work but it's annoying to have to keep restarting VS. I can see the spade window show "refreshing..." in the frozen VS screen. I'm running 0.7.0.2 beta in VS2012.

Code cleanup messes namespaces, when file header exists

I reproduced this issue on VS 2010, 2012 and 2013 when cleaning up C# code.
When in file I have usings for multiple namespaces and file header in format:
"//
// Copyright (c) COMPANY_NAME 2014. All rights reserved.
//
// DEVELOPER NAME
// E-MAIL
// DATE
//

FILE_SUMMARY.

"
and perform a cleanup on this file, some of usings will jump above header, and some above. Usually my namespace will land above header and System namespaces below, so I have something like:
"using Company.Application.Namespace.For.Business.Objects;
using Company.Application.Namespace.For.Logic;
//
// Copyright (c) COMPANY_NAME 2014. All rights reserved.
//
// DEVELOPER NAME
// E-MAIL
// DATE
//

FILE_SUMMARY.

using System.Web.Http;
using System.Web.Security;".
This behavior occurs every time I cleanup the file.

Strange sorting bug

Try paste the following code, select the code and crtl+m + f9
Now the sorted result looks strange ;)

        public string A1 { get; set; }
        public string A3
        {
            get
            {
                if (1 != 1)
                {
                    return "Strange";
                }
                else
                {
                    return "Okay";
                }
            }
        }
        public string A2 { get; set; }

Issue with projectItem.Collection throwing Exceptions

First off, great plugin.

I have downloaded the source code and have started implementing PHP support using the PHP Tools plugin from DEVSENSE. I've managed to get codecleanup working but have a problem with projectItem.Collection throwing exceptions in:
DocumentExtentions.IsExternal and CodeCleaunpAvailabilityLogic.IsParentCodeGeneratorExcludedByOptions.

This happens because the ProjectItem is of type OAFileItem (http://msdn.microsoft.com/en-US/library/microsoft.visualstudio.package.automation.oafileitem_members(v=vs.80).aspx) whose Collection property is not guaranteed to be implemented.

I've wrapped these accessors in try cacth blocks and can handle the errors but the php file is recognised as an external file to the solution, even though it is not. I was wondering if there is another way to determine if the Document is part of a solution.

Your thoughts would be greatly appreciated.

PS: I also found a bug while checking projectItem.Kind equality against Constants.vsProjectItemKindPhysicalFile. projectItem.Kind needs to be uppercased invariantly to properly compare equality.

Solution Settings

Not sure if this is the right place to leave a feature request, but could you add the ability to save the CodeMaid options to the solution so that there can be consistency across all developers working on the solution (as opposed to some having different settings set)? Web essentials has this and it's really nice. Basically, if the solution settings exist, use those, otherwise use the settings saved with Visual Studio.

CodeMaid not working with Shared Project type in Universal Apps

Visual Studio 2013 Update 2 added support for universal apps and CodeMaid doesn't work with the code in the Shared project part of the a universal app.

Doesn't work means that neither cleanup nor reorganise do anything. Spade is also blank.

This only impacts code (C#) and not XAML. XAML cleanup in the shared project works fine. The code & XAML in the non-shared project work do get cleaned and other projects types (e.g. console) work fine.

I have tried 0.7.0, 0.7.2 & 0.7.3 all the issue remains.

Solution not collapsed at VS startup

It seems that the option to collapse solutions when they are opened do not work anymore.

When I open a solution, it is collapsed at first, but when the Solution Explorer finishes to load the solution, it takes back its expanded state as it was when I did exit VS.

I'm using VS 2013 and the option "☑Collapse solutions when they are opened" is correctly checked.

Not Sorting Properties and Methods alphabetically

I am using Visual Studio 2013 & c#. When I clean files, they are not getting sorted alphabetically, but the extra blank lines are being removed. This is happening with all files in c#. This always worked until I ran the most recent updates of both CodeMaid and of Visual Studio.( Update 3 ).

Thanks

clean .designer files

I m try to clean all solution but my hidden .designer.cs files doest effected.
is there a problem ?

Auto comment formatting during cleanup with StyleCop copyright header skips comments with NullException

if file contains comment on the top of the file, like i.e.

// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) 2012 - 2013 . All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------

[CodeMaid Handled Exception 05:02:23 PM] Stopped cleaning 'file.cs': System.NullReferenceException: Object reference not set to an instance of an object.
at SteveCadwallader.CodeMaid.Model.Comments.CodeCommentMatch..ctor(Match match)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter.b__4(Match x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter.Parse(ICommentLine line, Int32 indentLevel, Int32 xmlTagLength)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter..ctor(ICommentLine line, String commentPrefix, CodeCommentOptions options, Regex regex)
at SteveCadwallader.CodeMaid.Model.Comments.CodeComment.Format(CodeCommentOptions options)
at SteveCadwallader.CodeMaid.Logic.Formatting.CommentFormatLogic.FormatComments(TextDocument textDocument, EditPoint start, EditPoint end)
at SteveCadwallader.CodeMaid.Logic.Formatting.CommentFormatLogic.FormatComments(TextDocument textDocument)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.RunCodeCleanupCSharp(Document document, Boolean isAutoSave)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.<>c__DisplayClass3.b__1()
at SteveCadwallader.CodeMaid.Helpers.UndoTransactionHelper.Run(Func1 undoConditions, Action tryAction, Action1 catchAction)

Find in solution explorer fails in Spanish

Hi guys,

When I call - Find in solution explorer - error HRESULT E_FAIL a call appears in a COM component.
I have reinstalled (first I uninstalled) and the same thing keeps happening.
I use VS 2013 Ultimate Update 3 in Spanish
Can you help?

Thanks.

Version after 0.7.3 not working in my system

After installing codemaid 0.7.4, i cannot see codemaid in menu bar or in the context menu when i right click any class files or project etc. This is the case even for 0.7.3.2-beta as well as 0.7.4.1-beta. The last build that works in my system is 0.7.3. I run windows 7 Enterprise edition 32-bit, Visual Studio 2010 premium, dot net version 4.0.30319

Cleanup does not remove unused imports in VB.NET

Hi,

First, thanx for all the hard work on this project.

I think i found an issue using VB.NET:
It looks like the cleanup functionality does not take care of unused imports. I have checked the relevant checkboxes in Configuration > Cleaning > Visual Studio.
The builtin Visual Studio context menu Organize Imports > 'Remove and sort Imports' works fine where Codemaid does not remove any.

Any thoughts?

Environment:
VB.NET 4.5 Web Application (WebForms)
Visual Studio 2012
CodeMaid v0.7.4
Windows 8.1 Enterprise

Error when there is a WiX project in solution

Hello. The problem happens when I have a WiX project in my solution. I get this error when I click "Cleanup All Code..." from the CodeMaid menu and clicking Yes in the confirmation box:

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

I don't get this error when I remove my WiX project from Solution Explorer.

Here's output when I enable Diagnostics Mode:

[CodeMaid Diagnostic 08:51:07 ] CleanupAllCodeCommand.OnExecute invoked
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:08 ] CodeCleanupAvailabilityLogic.IsProjectItemLanguageIncludedByOptions picked up an unrecognized language service guid ''
[CodeMaid Diagnostic 08:51:14 ] WindowEventListener.OnWindowChange raised for '(null)'

My CodeMaid version is 0.7.5

VS 2013 crash when renaming class in a new empty project/solution

Operating System: Windows 8.1 x64 Pro
IDE: Visual Studio 2013 Ultimate
IDE plugins: AnkhSVN, Productivity Power Tools 2013
Other relevant info: I've previously had Resharper installed

Steps to reproduce:

  • Launch Visual Studio
  • Create a new solution, with a C# class library project
  • In solution explorer, rename Class1.cs to something different
  • Visual Studio crashes

It's possible the problem isn't directly caused by CodeMaid, but the problem is resolved by disabling CodeMaid.

Configuration - Formatting - disabled

I have Codemaid 0.7.5 and the Formatting configuration page is disabled. All the settings are grayed.

I'm running VS2010 SP1

I have tried running VS as admin but it's still grayed.

Edit: I just tried on VS2013 and there the Formatting configuration is working, i.e. not grayed.

Format Comment doesn't always respect settings

I configured CodeMaid with my preferences for XML Doc Comments. However, upon configuring CodeMaid, when saving a file with XML Doc Comments, the comments are not formatted according to my settings. I'm using v0.7.4. The file is a C# file.

UPDATE
I determined the cause of this apparent "bug". I had a malformed doc comment. So, not entirely CodeMaid's fault; but hopefully, CodeMaid can be made to be a bit smarter in the presence of malformed XML Doc Comments.

The offending XML Doc Comment had the following structure:

/// <summary>
///     Some summary information about my <see cref=T:"SomeNamespace.WithMy.Type" />.
/// </summary>

The correct comment should be:

/// <summary>
///   Some summary information about my <see cref="T:SomeNamespace.WithMy.Type" />.
/// </summary>

The cref qualifier T: was in the wrong place.

CodeMaid not more accessible from VS2010 UI

Hello,

I love your product for all its functionalities. But after the last update, the plugin is no more accessible from the UI, no menu, no shortcut, no build progressbar, nothing.

Can you do something ?

I try :

  • remove plugin and install it again
  • read VS log (CodeMaid modul loaded and no exception found)

Reorganization is not respecting #endregion user preference

When regions are automatically generated during reorganization, the user preference to specify the region name as a postfix on the #endregion tag (e.g. #endregion Methods) is not being respected. Currently the region name is always appended.

CodeMaid does not work as expected with conditional compiler directives

CodeMaid appears to ignore conditional compiler directives outside of methods and could move methods out of or into a conditional compiler directive. This could cause code to break.
Not sure if there is a good fix for this (there are loads of edge cases), but maybe a warning if CM finds this and informs the user that it may break and lets them choose to continue with that refactoring.

Example, in the image below the Debug method is moved outside of the conditional compiler directives when CM cleans it up.

clipboard01

Sample code from image above:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
#if DEBUG
            Debug();
#endif
            Always();
        }

#if DEBUG
        private static void Debug()
        {
            Console.WriteLine("BUGS");
        }
#endif

        public static void Always()
        {
            Console.WriteLine("Defect free code");
        }


    }
}

Spade issue with C++ macro when compiler doesn't recognize a nested statement

The following code seems to break Codemaid Spade

define WBTry try

define WBCatch catch(_com_error& e) { UNUSED_ALWAYS(e); ASSERT(0); } \

            catch(CException *pe) {  TCHAR sz[255]; pe->GetErrorMessage(sz,254); TRACE(sz); TRACE(_T("\n")); pe->Delete(); } \
            catch(...) { ASSERT(0); }

void test(void)
{
WBTry
{
int i = 1;
}
WBCatch

int j = 10;

}

In Spade, I see j listed as a function. The WBCatch is confusing it. Double clicking also only highlights up the WBCatch.

CodeMaid loading error ...

Using VS 2013 update 3, I reset my environment via devenv.exe /resetuserdata

Now, every time I start VS I get the following:

codemaid

Here are the entries from the activity log:

49 2014/11/11 15:35:39.377 Information VisualStudio Begin package load [SteveCadwallader.CodeMaid.CodeMaidPackage, SteveCadwallader.CodeMaid, Version=0.7.4.0, Culture=neutral, PublicKeyToken=5e10ffd6b4d2c330] {4C82E17D-927E-42D2-8460-B473AC7DF316} 50 2014/11/11 15:35:39.377 Error VisualStudio CreateInstance failed for package [SteveCadwallader.CodeMaid.CodeMaidPackage, SteveCadwallader.CodeMaid, Version=0.7.4.0, Culture=neutral, PublicKeyToken=5e10ffd6b4d2c330] {4C82E17D-927E-42D2-8460-B473AC7DF316}
80070002 Could not load file or assembly 'file:///C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\qfywjfja.zy5\SteveCadwallader.CodeMaid.dll' or one of its dependencies. The system cannot find the file specified. 51 2014/11/11 15:35:39.377 Error VisualStudio End package load [SteveCadwallader.CodeMaid.CodeMaidPackage, SteveCadwallader.CodeMaid, Version=0.7.4.0, Culture=neutral, PublicKeyToken=5e10ffd6b4d2c330] {4C82E17D-927E-42D2-8460-B473AC7DF316}
80004005 - E_FAIL Could not load file or assembly 'file:///C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\qfywjfja.zy5\SteveCadwallader.CodeMaid.dll' or one of its dependencies. The system cannot find the file specified.

How do I get rid of this message ???

private accessors

is there any configuration for "do not insert private keyword" ?

example:
class A
{
string _a;
}

after clean

class A
{
private string _a;
}

how can I disable inserting private keyword ?

Codemaid modifies real 'unescaped' string when cleanup

Hi,

cleanup modifies incorrectly any 'unescaped' string (with @) which is multi line string in any *.cs file.
Example:
There are some space characters after the text 'abc' in the same row by default: (so it looks: 'abc__')

string something =
@"abc_some spaces here_
defghijk";

After the cleanup all spaces are removed, so the length of the string is different form the original:

string something =
@"abc
defghijk";

Cleanup compatibility issue with ReSharper 9

Reported by refrom under #31 and moved to a new issue.

Hi,
I'm affected by this error in every C# file in my solutions.
I got:

[CodeMaid Diagnostic 03:20:51 ] WindowEventListener.OnWindowChange raised for 'C:\Data\ex\ex.cs'
[CodeMaid Diagnostic 03:20:52 ] CleanupActiveCodeCommand.OnExecute invoked
[CodeMaid Diagnostic 03:20:52 ] CodeCleanupManager.Cleanup started for 'C:\Data\ex\ex.cs'
[CodeMaid Diagnostic 03:20:52 ] TextEditorEventListener.OnLineChanged raised for 'C:\Data\ex\ex.cs'
[CodeMaid Handled Exception 03:20:52 ] Stopped cleaning 'ex.cs': System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at EnvDTE80.DTE2.ExecuteCommand(String CommandName, String CommandArgs)
at SteveCadwallader.CodeMaid.Logic.Cleaning.UsingStatementCleanupLogic.RemoveUnusedUsingStatements(TextDocument textDocument, Boolean isAutoSave)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.RunCodeCleanupCSharp(Document document, Boolean isAutoSave)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.<>c__DisplayClass3.b__1()
at SteveCadwallader.CodeMaid.Helpers.UndoTransactionHelper.Run(Func1 undoConditions, Action tryAction, Action1 catchAction)
[CodeMaid Diagnostic 03:20:52 ] TextEditorEventListener.OnLineChanged raised for 'C:\Data\ex\ex.cs'
[CodeMaid Diagnostic 03:21:19 ] ConfigurationCommand.OnExecute invoked

When I use "clean file": Ctrl+Space, M combination.
I use Visual Studio 2013, problem started after installing R#.
I also figured out that the problem starts only after running R# cleaning on file, because if I clean using CodeMaid just after opening file it works, but if I use R# on that file then it got an error from CodeMaid.
I works with default setting of CodeMaid and R#.
Cleaning all open file and all solution still works.
CodeMaid version 0.7.4
R# version 8 and 9.

Thanks for help.

top-level closed xml tags get expanded [v0.7.4]

Closed xml tags within documentation work fine, but at the top level they get expanded into empty open/close tags.

For example, this:

/// <inheritdoc/>
/// <summary>Tags in <see cref="doc"/> stay closed.</summary>

After formatting becomes this:

/// <inheritdoc></inheritdoc>
/// <summary>Tags in <see cref="doc"/> stay closed.</summary>

"Insert explicit access modifiers on" option can pollute your code with modifiers in "random" places

"Insert explicit access modifiers on" option can pollute your code with modifiers in "random" places, see the example below.
I'm using VS2012 with CodeMaid 0.7.4.
With option "Insert explicit access modifiers on" enabled for all possible items (CODEMAID menu-> Configuration menu item -> Cleaning -> Insert) if you enter the code below

using System.Configuration;

namespace MyNamespace
{
    internal class Class2
    {
    };

        private void Main()
        {
            if (bool.Parse(ConfigurationManager.AppSettings["MySetting"]))
            {
                //...
            }
        }
    }
}

and save the file you will end up with

using System.Configuration;

namespace MyNamespace
{
    internal class Class2
    {
    };

        private void Main()
        {
            if (bool.Parse(ConfigurationManager.AppSettings[internal "MySetting"]))

            {
                //...
            }
        }
    }
}

The problem is the "internal" being inserted in "random" places.
This is a contrived example but here's a short version of what I was actually doing when I discovered the issue:

using System.Collections.Generic;
using System.Configuration;

namespace MyNamespace
{
    internal class Class1
    {
        private Dictionary<string, Dictionary<string, string>> dict = new Dictionary<string, Dictionary<string, string>>
        {
            {"string", new Dictionary<string, string> {{"a", "b"}}}
        };
        };

        private void Main()
        {
            if (bool.Parse(ConfigurationManager.AppSettings[internal "MySetting"]))

            {
            }
        }
    }
}

I know that code is syntactically incorrect while saving but in such case CodeMaid should not do any cleanups at all until code is syntactically correct.
Now the big problem is that I had a several hundred lines of code file that got broken by the cleanup and I had to manually go through it and remove the randomly injected "internal" keyword.
I've had other issues with cleanup like inserting empty lines (in similar scenario) but this gets fixed automatically on save when code becomes syntactically correct so it's not a a problem however in this case CodeMaid leaves me with extra work after cleanup.

I suppose the problem stems from the fact that CodeMaid does not understand C# syntax and it is using tricks like regex and etc. to cheat :)
I guess it's time to think how to get CodeMaid to the next level and give it some more smarts and some basic syntax understanding otherwise it will never work well IMHO and crash miserably on "edge" cases.

Sorting affects one line too much

When selecting several lines and starting the Sort Lines command, the selected lines plus the following line are sorted. I assume that it's because when selecting entire lines, the cursor is at the start of the following line, which is not meant to be selected.

Using CodeMaid 0.7.4 in Visual Studio 2010 SP1

Text formatting / shifting on save.

When editing a line of code and then saving, sometimes the text gets shifted over, creating a malformed code syntax. For example:

image

After editing "Merge" to "MergeByAddress" and saving (ctrl+s):

image

As you can see, the @location.OrderLocationId parameter has lost a few characters. If it helps with debugging, I noticed that when this happens, it takes 3 undo actions to reverse the strange formatting, without reversing my changes.

Thanks for your work.

ObjectRef

There is Error on clean up c# class:
if you need class I can send

[CodeMaid Handled Exception 10:20:50 ] Stopped cleaning 'WsdlFixBehavior.cs': System.NullReferenceException: Object reference not set to an instance of an object.
at SteveCadwallader.CodeMaid.Model.Comments.CodeCommentMatch..ctor(Match match)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter.b__4(Match x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter.Parse(ICommentLine line, Int32 indentLevel, Int32 xmlTagLength)
at SteveCadwallader.CodeMaid.Model.Comments.CommentFormatter..ctor(ICommentLine line, String commentPrefix, CodeCommentOptions options, Regex regex)
at SteveCadwallader.CodeMaid.Model.Comments.CodeComment.Format(CodeCommentOptions options)
at SteveCadwallader.CodeMaid.Logic.Formatting.CommentFormatLogic.FormatComments(TextDocument textDocument, EditPoint start, EditPoint end)
at SteveCadwallader.CodeMaid.Logic.Formatting.CommentFormatLogic.FormatComments(TextDocument textDocument)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.RunCodeCleanupCSharp(Document document, Boolean isAutoSave)
at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.<>c__DisplayClass3.b__1()
at SteveCadwallader.CodeMaid.Helpers.UndoTransactionHelper.Run(Func1 undoConditions, Action tryAction, Action1 catchAction)

Automatically clean file on save.

Hi, I'm trying to have the file automatically cleaned on save, and for some reason, it doesn't seem to be working. I have it working on another machine, and I exported/imported those settings locally, but still no dice.

Anything you can suggest I try? Thanks!

Leading whitespaces are removed for multiline comments during cleanup

Consider doxygen section like this

/**
 * @brief some description
 *
 * @param data
 */

After cleanup, it becomes

/**
* @brief some description
*
* @param data
*/

I'm developing C++ code using VS2012 11.0.61030.00 (update 4) with Codemaid 0.7.5 (seen also for 0.7.4).
To reproduce, create new header file with comments as above and perform cleaning. No need to add any code.
I suppose native VS C++ formatting settings may cause some interactions, so attaching screen shots
vsoptn1
vsoptn2

Update:
I've just realized, that there is a Codemaid option under Cleaning->Visual Studio->Run format document, which is enabled by default. After disabling it, the problem does not reproduce. It seems that if enabled, the Codemain will follow VS rules of formatting, which may remove the whitespaces due to its settings. Is it working as expected then?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.