Giter Site home page Giter Site logo

dzimchuk / experimental-tools Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 5.0 685 KB

A bunch of quality refactorings and code fixes that are going to improve your C# development experience in Visual Studio and remove some common pain.

License: MIT License

C# 100.00%
visual-studio refactorings roslyn visual-studio-extension

experimental-tools's People

Contributors

dzimchuk avatar

Stargazers

 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

experimental-tools's Issues

RootNamespace not honored

Installed product versions

  • Visual Studio: 15.5.7
  • This extension: 1.1.95

Description

Have a project file that has RootNamespace set to something that differ from the project name.

Steps to recreate

Example <RootNamespace>Company</RootNamespace> in the Company.Abstractions.csproj-file. Create a file, in a subdirectory Demo the namespace for the file should now be using Company.Demo-namespace.

Current behavior

Warning about ET002 that namespace does not match the path.

Expected behavior

No warning about ET002 due to the RootNamespace-setting.

Namespace vs file path analyzer doesn't seem to work.

Installed product versions

  • Visual Studio: 2017 Professional - 15.2 (26430.14) Release
  • This extension: 0.8.80

Description

The "Namespace vs file path analyzer" functionality doesn't seem to work.

Steps to recreate

  1. Installed the extension and restarted Visual Studio.
  2. Modified the namespace on a file to not match the base namespace & file path.
  • Project Default Namespace: MyTestApp.Hello.API
  • Correct Class Namespace: MyTestApp.Hello.API
  • Namespaces I tried changing to:
    • MyTestApp.Hello.API.Test
    • MyTestApp.Hello.API2.Test
    • MyTestApp.Hello.API2.Test4
    • MyTestApp.Hello2.API

Current behavior

I tried building the project and also restarting VS with the changed namespaces and none of them caused the name to show any squiggly line errors and didn't show the light bulb on the left when selected.

Expected behavior

I assume the namespace text should at least show underlined as I see in the documentation page:
Docs
I have confirmed that the extension is enabled and the feature "Change namespace to match file path" was enabled (all features were enabled). I tried disabling the feature and then re-enabling the feature and that did not fix it. I also tried reinstalling the extension.
I did try the guid replace ("nguid" + tab) and that worked fine so I know the extension is installed and working.
Thanks!

System.IO.FileNotFoundException when loading the package

Installed product versions

  • Visual Studio: 2017 Enterprise v15.9.5
  • This extension: v1.3.0

Description

When Visual Studio loads a solution, a warning message appears saying there was an error with the extension

Steps to recreate

1.Install ExperimentalTools
2. Load a Solution
3. A warning message appears
image

Current behavior

A warning message appears on Visual Studio indicating there may be a problem with the exception

Expected behavior

The extension should'nt cause an exception on startup
Attached is the ActivityLog.xml generated by Visual Studio, changed the extension to txt so GitHub doesn't complain:

ActivityLog.txt

Keyboard shortcut for locating the files does not work.

Installed product versions

  • Visual Studio: [2019 Professional latest stable version 16.5.4]
  • This extension: [1.3.3]

Description

Locate file in the solution explorer does not work.

Steps to recreate

  1. Try to locate the file in the solution explorer pressing the usual key combination.

Current behavior

Nothing is happening(neither I see error in the solution explorer.

Expected behavior

It should open the solution explorer and highlight the file that is currently opened.

Side note:

The issue started happening since the latest update. Thanks

Upgrade Fails

Installed product versions

  • Visual Studio: [example 2015 Ultimate ]
  • This extension: [example 0.8.76]

Description

While updating from Version 0.7.69 to 0.8.76, I get "This extension is not supported on the current product."

Steps to recreate

  1. Tools --> Extensions & Updates
  2. Go to the Visual Studio Gallery section under Updates since it shows that there is one.
  3. Click the Update button.
  4. Update downloads &, EULA shown. Click Install.

Current behavior

It has had no issues till now.

Expected behavior

Upgrade to 0.8.76
exception

System.InvalidCastException : Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax'.

System.InvalidCastException : Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterConstraintClauseSyntax'.
   at System.Linq.Enumerable.<CastIterator>d__97`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index,IEnumerable`1 collection)
   at Microsoft.CodeAnalysis.SyntaxList`1.InsertRange(Int32 index,IEnumerable`1 nodes)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.VisitList[TNode](SyntaxList`1 list)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitClassDeclaration(ClassDeclarationSyntax node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax.Accept[TResult](CSharpSyntaxVisitor`1 visitor)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.BaseListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[TNode](TNode node)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[TNode](SyntaxList`1 list)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.VisitList[TNode](SyntaxList`1 list)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitNamespaceDeclaration(NamespaceDeclarationSyntax node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax.Accept[TResult](CSharpSyntaxVisitor`1 visitor)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.BaseListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitListElement[TNode](TNode node)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitList[TNode](SyntaxList`1 list)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.VisitList[TNode](SyntaxList`1 list)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitCompilationUnit(CompilationUnitSyntax node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax.Accept[TResult](CSharpSyntaxVisitor`1 visitor)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.BaseListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.NodeListEditor.Visit(SyntaxNode node)
   at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxReplacer.InsertNodeInList(SyntaxNode root,SyntaxNode nodeInList,IEnumerable`1 nodesToInsert,Boolean insertBefore)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.InsertNodesInListCore(SyntaxNode nodeInList,IEnumerable`1 nodesToInsert,Boolean insertBefore)
   at Microsoft.CodeAnalysis.SyntaxNodeExtensions.InsertNodesBefore[TRoot](TRoot root,SyntaxNode nodeInList,IEnumerable`1 newNodes)
   at async ExperimentalTools.Roslyn.Features.Constructor.AddInitializedFieldRefactoring.InitializeFieldAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)

Incorrect braces removing

Installed product versions

  • Visual Studio: 2017 Professional
  • This extension: 0.9.88

Description

Unsafe refactoring due to incorrect braces removing. Changes my code behaviour.

Steps to recreate

Here's an example
IncorrectBracesRemoving.zip

Current behavior

Remove braces makes else statement from an if statement go to another if statement.

Expected behavior

Remove braces shouldn't be proposed in this cases.

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.