GithubHelp home page GithubHelp logo

agrael1 / includetoolbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wumpf/includetoolbox

6.0 6.0 4.0 17.15 MB

Visual Studio extension to format, prune, and inspect include directives.

Home Page: https://marketplace.visualstudio.com/items?itemName=Wumpf.IncludeToolbox

License: MIT License

C# 100.00%

includetoolbox's People

Contributors

agrael1 avatar charlietangora avatar dako98 avatar dakotahawkins avatar wumpf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

includetoolbox's Issues

Sorting is done before "Remove Empty Lines"

This means we have to do selection + "Format Includes" twice, if we want to sort (and remove duplicates) across all groups of includes in the selection.

Currently, each group is individually sorted (and pruned from duplicates) since the sorting is done before removing the empty lines between groups. Doing the line removal before sorting would fix this issue and make the behavior more like what could be expected when the settings indicate "remove empty lines, sort and remove duplicates".

After running "Compile Header", temporary changes in project are reverted but not re-saved

After running the "Compile Header" command, some temporary changes have been saved in the .vcxproj and .vcxproj.filters files. Inside VS, these changes are already reverted but NOT saved. The command should end its work by re-saving these reverted project changes, otherwise they will show up as pending changes in source control etc (until the project is manually saved).

On a side note, it would be convenient if the "Compile Header" command was available in the context menu when right-clicking on a header file in the Solution Explorer (in addition to right-clicking inside the editor for a header file).

"Insert blank line between precedence regex match groups" option does not seem to work (VS2022)

I can see that my Precedence Regexes are taken into account when sorting, since the matching includes are ordered accordingly.

However, even though I set "Insert blank line between precedence regex match groups" to True, I don't get any new empty lines between the matching groups.

NOTE: This is somewhat related to my feature request in issue #16, since Precedence Regexes might be able to provide parts of my request (if inserting blank lines was working).

Includes-what-you-use not works in VS 2022

#include <iostream>
#include <vector>

int main()
{
	std::cout << "Hello World!\n";
}

Even for this simple file, Includes-what-you-use still cannot delete the vector header.

I use the default setting, right-click on the cpp file and click Run Include-What-You-Use.
The result is it only formats my code, the header is still there.

Feature request: Group includes by directory (insert empty lines)

In order to sort across all include-groups, we first need to remove the empty lines between the groups (see also issue #15).

To re-group includes after sorting (by inserting new empty lines), I'd suggest adding an option to "Group Includes by Directory". ReSharper C++ has a similar feature, see the following pages:

Grouping by "full path depth" (deepest directory level) would be a good place to start:

#include "core/misc/log/log.h
#include "core/misc/log/log_utils.h

#include "core/misc/threads/threads.h

#include "core/render/dx/render_dx.h

#include "core/render/gl/render_gl.h

#include "products/product_1/main.h
#include "products/product_1/product.h

#include "products/product_2/main.h
#include "products/product_2/product.h

Ideally though, I'd like to specify at which "path depth" (1 or larger) we want the grouping to happen - so that, for example, for a depth of 2 we would get the following groupings:

#include "core/misc/log/log.h
#include "core/misc/log/log_utils.h
#include "core/misc/threads/threads.h

#include "core/render/dx/render_dx.h
#include "core/render/gl/render_gl.h

#include "products/product_1/main.h
#include "products/product_1/product.h

#include "products/product_2/main.h
#include "products/product_2/product.h

NOTE: Specifying a depth of 0 (zero) could then mean "no grouping"...

Format Includes not works in VS 2022

I recieve this message when I try to do "Format Includes":

System.NullReferenceException: Object reference not set to an instance of an object.
at IncludeToolbox.VCUtil.d__8.MoveNext() in D:\a\IncludeToolbox\IncludeToolbox\IncludeToolboxShared\Util\VCUtil.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at IncludeToolbox.Commands.FormatIncludes.d__3.MoveNext() in D:\a\IncludeToolbox\IncludeToolbox\IncludeToolboxShared\Commands\FormatIncludes.cs:line 50
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Community.VisualStudio.Toolkit.BaseCommand.<>c__DisplayClass8_0.<b__0>d.MoveNext()

Open a header file from the graph

It would be quite handy to be able to open a particular header file directly from the 'Include Hierarchy' window

Maybe
right-click, 'Open'
or
ctrl-click

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.