Useful UE4 Visual Studio extensions.

Overview

UE4 Smarter Macro Indenting

This extension was designed to fix the unnecessary and annoying "smart" indenting that Visual Studio likes to do around various UE4 macros. It attempts to fix these indents when your current line proceeds any of the following UE4 macros:

  • UPROPERTY
  • UFUNCTION
  • GENERATED_BODY
  • GENERATED_UCLASS_BODY
  • GENERATED_USTRUCT_BODY
  • GENERATED_UINTERFACE_BODY
  • GENERATED_IINTERFACE_BODY

Demo

Before After
Example Example

Installation

  1. Download and install the Visual Commander extension for Visual Studio from here: https://vlasovstudio.com/visual-commander/
  2. Go to VCmd -> Import and import the ue4_smarter_macro_indenting*.vcmd that corresponds to your version of visual studio. For visual studio 2017/2019+, use ue4_smarter_macro_indenting_vs2017-2019.vcmd, for earlier versions use ue4_smarter_macro_indenting_vs2013-2015.vcmd.
  3. Go to VCmd -> Extensions to open the Extensions panel
  4. Check the "Enabled" checkbox for the "UE4 Fix Indent" extension.
  5. Make sure Indenting is set to "Smart" in Tools -> Options -> Text Editor -> C/C++ -> Tabs.

If "VCmd" doesn't appear on your Visual Studio toolbar after installing Visual Commander, you may need to restart Visual Studio.

Comments
  • copy-paste in place can still indent function decl

    copy-paste in place can still indent function decl

    Type this into the visdev editor:

    UFUNCTION( Category="foo", BlueprintCallable )
    void foobar();
    

    (the spaces separating the () and parameters to the macro are important)

    select it Ctrl-C to copy immediately Ctrl-V to paste it back in place.

    Result:

    UFUNCTION(Category="foo", BlueprintCallable)
        void foobar();
    

    the spaces in the parameters to the UFUNCTION are the problem - the macro is reformatted, and the function declaration is indented. If the spaces aren't there, the paste-in-place works as expected and no reformatting occurs.

    If you don't paste it in place, it also formats correctly - the spaces are removed but the function declaration is not indented.

    opened by gunderwood-inx 5
  • Copy-Paste still indents

    Copy-Paste still indents

    Fantastic extension - works great when typing new code.

    However, when copy-and-pasting a block of code, the Smart Indent still kicks in and it indents the line below those tags again. Any chance you could add a fix for that, too?

    Thanks again!

    opened by gunderw00d 4
  • In VS2017, having UFUNCTION() above a function prevents me from typing the trailing ;

    In VS2017, having UFUNCTION() above a function prevents me from typing the trailing ;

    As the title suggests, having something like this:

    UFUNCTION() void SomeFun()

    ...and typing ; in the end, nothing would happen. Disabling the extension it works as intended.

    Thanks again for extension, hopefully this isn't a huge issue to fix!

    opened by DamirHalilovic 3
  • copy-paste still indenting under certain circumstances

    copy-paste still indenting under certain circumstances

    With the following code:

    USTRUCT()
    struct FFoo
    {
        GENERATED_USTRUCT_BODY()
    
        UPROPERTY()
        int32 Bar;
    };
    

    Select it all and copy-paste it to a new location. Result:

    USTRUCT()
    struct FFoo
    {
        GENERATED_USTRUCT_BODY()
    
            UPROPERTY()
            int32 Bar;
    };
    
    opened by gunderwood-inx 2
  • copy-paste results in cursor moving to end of line.

    copy-paste results in cursor moving to end of line.

    Any copy-paste action, whether or not a UE tag is involved, results in the cursor moving to the end of the line. This is ok if the entire line is being copied, but if a selection is being pasted into the middle of a line, the normal behavior of VisDev (and Windows in general) is for the cursor to remain at the end of the selection after the paste operation.

    opened by gunderwood-inx 2
  • Error when importing vcmd file using VCmd into Visual Studio 2015

    Error when importing vcmd file using VCmd into Visual Studio 2015

    An error window pops up upon import of vcmd file.

    Window Title:

    [Visual Commander] Import

    Window message:

    "The is an error in XML document (0,0)."

    More information about my IDE:

    Visual Studio Professional 2015 Version 14.0.25431.01 Update 3

    Visual Commander Version 2.6.2 (released January 29, 2017)

    Thanks for the extension and help!

    opened by burtonposey 1
  • Paste always moves the cursor to end of line

    Paste always moves the cursor to end of line

    Paste is always moving the cursor to the end of the line, instead of preserving the cursor's place. This isn't the behavior you want when pasting in the middle of an existing line of text.

    opened by hackalyze 1
  • Ignore UE_LOG macro

    Ignore UE_LOG macro

    UE_LOG macros don't need special handling as there is a semicolon after them, and this was causing odd behavior with removing lines below UE_LOG.

    closes #19

    opened by hackalyze 0
  • Indent broken when paste includes one macro above another

    Indent broken when paste includes one macro above another

    Paste this:

        USTRUCT()
        struct FStruct
        {
            GENERATED_BODY()
    
            UPROPERTY()
            FString Variable;
        };
    

    Gets this:

        USTRUCT()
        struct FStruct
        {
            GENERATED_BODY()
    
                UPROPERTY()
                FString Variable;
        };
    
    opened by hackalyze 0
  • Code snippets

    Code snippets

    Hi Thanks for this extension. It will help me a lot.

    I just have one remark. It does not work yet on Code Snippets.

    I don't know if you know this functionnality, it's in Tools/Code Snippet Manager, it allows you to make Visual Studio know your most common code parts and automatically write them. I did this for several types of my UPROPERTY, but even with this extension, the tab will still be inserted after UPROPERTY. I think this would be a great improvement of this extension to enable this too.

    I looked a bit in your code, I guess the "insert snippet" command is a command event like Paste, but I didn't find it yet and I don't really understand where to look for that. Any clue ?

    Have a good one.

    opened by AlKoulounil 1
  • Select and un-indent is re-indented

    Select and un-indent is re-indented

    `USTRUCT() struct FFoo { GENERATED_USTRUCT_BODY()

        UPROPERTY()
        int32 Bar;
    

    };`

    Select the UPROPERTY() and Bar declaration, hit shift-Tab to un-indent, then click elsewhere. Both are re-indented.

    It only misbehaves if the selection spans an EOLN - selecting just the UPROPERTY() or just the Bar decl work fine.

    Hitting escape instead of clicking off the selection is a workaround.

    opened by gunderwood-inx 1
Owner
Chris Pawlukowsky
Chris Pawlukowsky
A D++ Discord Bot template for Visual Studio 2019 (x64 and x86)

D++ Windows Bot Template A D++ Discord Bot template for Visual Studio 2019 (x64 and x86, release and debug). The result of this tutorial. This templat

brainbox.cc 28 Dec 24, 2022
A Visual Studio template used to create Cobalt Strike BOFs

Introduction Cobalt Strike beacon object files (BOFs) is a feature that added to the beacon in order to allow rapid beacon extendibility in a more OPS

Securify 163 Dec 28, 2022
Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.

Sharpmake Introduction Sharpmake is a generator for Visual Studio projects and solutions. It is similar to CMake and Premake, but it is designed for s

Ubisoft 779 Dec 23, 2022
Visual Studio Extension that installs additional color themes

Using this Extension Download and install the extension Restart Visual Studio Navigate to Tools > Options > Environment > General and select your colo

Microsoft 328 Dec 19, 2022
Visual Studio Test Adapter for Catch2

Test Adapter for Catch2 Within Visual Studio, the Test Explorer is a convenient way to run and debug unit tests. This test adapter adds support for th

null 95 Dec 25, 2022
A Visual Studio extension containing a collection of tools to help contributing code to the Chromium project.

VsChromium VsChromium is a Visual Studio Extension containing a collection of tools useful for editing, navigating and debugging code. VsChromium was

The Chromium Project 258 Dec 30, 2022
Visual Studio native debugger extension to help debug native applications using Mono.

Unity Mixed Callstack UnityMixedCallstack is a Visual Studio 2017/2019 extension to help debug native applications embedding Mono, like Unity. If you

Unity Technologies 83 Nov 28, 2022
Visual Studio extension for assembly syntax highlighting and code completion in assembly files and the disassembly window

Asm-Dude Assembly syntax highlighting and code assistance for assembly source files and the disassembly window for Visual Studio 2015, 2017 and 2019.

Henk-Jan Lebbink 4k Jan 6, 2023
A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files

HLSL Tools for Visual Studio This extension is for Visual Studio 2017 / 2019. Go here for the Visual Studio Code extension. HLSL Tools is a Visual Stu

Tim Jones 433 Dec 27, 2022
Half-Life Singleplayer SDK 2.3, updated to compile with Visual Studio 2019. Provided as-is with no further support. See the README for more information.

Half Life 1 SDK LICENSE Half Life 1 SDK Copyright© Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE

Sam Vanheer 6 Oct 10, 2022
RRxIO - Robust Radar Visual/Thermal Inertial Odometry: Robust and accurate state estimation even in challenging visual conditions.

RRxIO - Robust Radar Visual/Thermal Inertial Odometry RRxIO offers robust and accurate state estimation even in challenging visual conditions. RRxIO c

Christopher Doer 63 Dec 20, 2022
Visual Leak Detector for Visual C++ 2008-2015

Visual Leak Detector Introduction Visual C++ provides built-in memory leak detection, but its capabilities are minimal at best. This memory leak detec

Arkady Shapkin 908 Jan 8, 2023
Helper to create a SkeletalMeshComponent in UE4 at runtime.

Runtime Skeletal Mesh Generator for UE4 Helper to create a SkeletalMeshComponent in UE4 at runtime. This is a header only library that simplify the pr

Andrea Catania 34 Dec 29, 2022
UE4 SDF Importers / Generators for SVG and Bitmaps

RTMSDF UE4 SDF Importers / Generators for SVG and Bitmaps NOTE: This module is very much work in progress / preview and likely to change Uses MSDFGen

Richard Meredith 9 Sep 30, 2022
First-up chord-send and tap-and-hold chord repeat extensions to QMK.

Quantum Mechanical Keyboard Firmware This is a keyboard firmware based on the tmk_keyboard firmware with some useful features for Atmel AVR and ARM co

Joshua Grams 8 Dec 14, 2022
C Extensions i made for DragonRuby!

drext C Extensions i made for DragonRuby NOTE: DragonRuby Pro required for C Extensions. List Name Description Platforms drbat Battery information lib

Rabia Alhaffar 5 Dec 5, 2022
Some extensions for windows explorer, tested on windows 10+

WindowsExplorerExtension Extensions for windows explorer, tested on windows 10 & windows 11. New Folder Extension What's This A Gnome nautilus inspire

anpho 4 Jan 13, 2022
Examples of C extensions in Ruby gems

Ruby C Extensions, Explained Background How To Use This Repository Strategies Strategy 0, "isolated" Strategy 1, "system" Strategy 2a, "packaged_sourc

Mike Dalessio 62 Dec 30, 2022
C++17 & C++ 20 error-handling and utility extensions.

C++ 17 & C++ 20 error-handling and utility extensions. Overview STX is a collection of libraries and utilities designed to make working with C++ easie

Basit Ayantunde 469 Dec 31, 2022