Skip to content

Improve extra events support through scripts etc.#7

Merged
3F merged 7 commits intomasterfrom
dev/extra-events
Feb 17, 2022
Merged

Improve extra events support through scripts etc.#7
3F merged 7 commits intomasterfrom
dev/extra-events

Conversation

@3F
Copy link
Owner

@3F 3F commented Feb 13, 2022

Improves #5 feature and related direction

At a minimum, this adds the ability to disable the CustomIn/Out check in UI

What does this actually mean?

Now we can compare or manipulate everything through scripts because before it was comparing all received data "as is".

For example,

#[OWP item("res").writeLine(true):
    #[DTE events.LastCommand.CustomOut]
]

{4, "{8E7B96A8-E33D-11D0-A6D5-00C04FB67F6A}", "CSharp", "StackTest.cs", "D:\tmp\2022\StackFramesApp1\StackFramesApp1", false, true, 4, "Text"}

Actually the result above for something like

EnvDTE.Document doc
...
Value.Pack(new object[]
{            
    doc.IndentSize,
    doc.Kind,
    doc.Language,
    doc.Name,
    doc.Path,
    doc.ReadOnly,
    doc.Saved,
    doc.TabSize,
    doc.Type,
});

but it is still in progress to have final view

IFilter

\+ IgnoreCustomIn
\+ IgnoreCustomOut

\+ related controls in UI
@3F 3F added this to the 1.4 milestone Feb 13, 2022
@3F
Copy link
Owner Author

3F commented Feb 13, 2022

AfterExecute
(
    E_DOC, E_DOC_ID_CLOSING, 
    Value.From(doc.FullName), 
    ParamPacker.Pack
    (
        "Language", doc.Language,
        "Saved", doc.Saved,
        "Kind", doc.Kind,
        "Type", doc.Type,
        "ReadOnly", doc.ReadOnly,
        "IndentSize", doc.IndentSize,
        "TabSize", doc.TabSize,
        "Name", doc.Name,
        "Path", doc.Path
    )
);

Result ~

{"Language":"CSharp"},{"Saved":true},{"Kind":"{8E7B96A8-E33D-11D0-A6D5-00C04FB67F6A}"},{"Type":"Text"},{"ReadOnly":false},{"IndentSize":4},{"TabSize":4},{"Name":"StackTest.cs"},{"Path":"D:\tmp\2022\StackFramesApp1\StackFramesApp1"}

Which can be processed in user script like

#[var v = #[DTE events.LastCommand.CustomOut]]
...
$(v.Split(",")[0].Trim("{}"))
== "Language":"CSharp"

$(v.Split(",")[0].Trim("{}").Split(":")[1])
== "CSharp"

etc.

@3F
Copy link
Owner Author

3F commented Feb 17, 2022

New extra events since 3404816

internal const string E_SLN = "{AD4AD581-801F-4399-B986-27FE2D308BDD}";
internal const int E_SLN_OPEN           = 0x100;
internal const int E_SLN_RENAME         = 0x101;
internal const int E_SLN_CLOSE_BEFORE   = 0x200;
internal const int E_SLN_CLOSE_AFTER    = 0x201;
internal const int E_SLN_CLOSE_QUERY    = 0x202;
internal const int E_SLN_PRJ_ADD        = 0x300;
internal const int E_SLN_PRJ_DEL        = 0x301;
internal const int E_SLN_PRJ_REN        = 0x302;

internal const string E_OW = "{600FCA14-172C-42F3-AC91-1BC5F32CF896}";
internal const int E_OW_ADD     = 0x100;
internal const int E_OW_UPD     = 0x101;
internal const int E_OW_CLEAR   = 0x102;

internal const string E_WND = "{69F5F698-996B-4293-9FE7-4202564FE6E5}";
internal const int E_WND_CREATE = 0x100;
internal const int E_WND_CLOSE  = 0x101;

internal const string E_DBG = "{4885535D-A7F9-46AB-A285-8E4D76F4C5B0}";
internal const int E_DBG_RUN    = 0x100;
internal const int E_DBG_BREAK  = 0x101;
internal const int E_DBG_DESIGN = 0x102;

@3F 3F changed the title WIP. Improve extra events support through scripts etc. Improve extra events support through scripts etc. Feb 17, 2022
@3F 3F merged commit 6d1a7b4 into master Feb 17, 2022
@3F 3F deleted the dev/extra-events branch February 17, 2022 13:15
3F added a commit that referenced this pull request Feb 18, 2022
* NEW: Visual Studio 2022 support. SDK17.
       Related PR 3F/vsSolutionBuildEvent#75

* NEW: Extends events when a file is open from the solution explorer.
       Issue #5

* NEW: Added the ability to disable the CustomIn/CustomOut check.
       You can control parameters through script, for example:
       ```
        #[var v = #[DTE events.LastCommand.CustomOut]]
        ...
        $(v.Split(",")[0].Trim("{}"))
        == "Language":"CSharp"

        $(v.Split(",")[0].Trim("{}").Split(":")[1])
        == "CSharp"
       ```
       Details #7

* NEW: Extra events:
       Scope `@Document`     <- {2555243A-2A69-4335-BAD6-DDE9DFFE90F2}
       Scope `@OutputWindow` <- {600FCA14-172C-42F3-AC91-1BC5F32CF896}
       Scope `@Solution`     <- {AD4AD581-801F-4399-B986-27FE2D308BDD}
       Scope `@Window`       <- {69F5F698-996B-4293-9FE7-4202564FE6E5}
       Scope `@Debugger`     <- {4885535D-A7F9-46AB-A285-8E4D76F4C5B0}

* FIXED: Restored accidentally removed `raise` method in v1.3. Issue #6

* FIXED: MSBuild Properties not changing according to solution configuration.
         Related Issue 3F/vsSolutionBuildEvent#71

* FIXED: Fixed unexpected plugin deactivation in Visual Studio 2010.

* CHANGED: Updated the follwoing references:

    * MSBuild 17.0.0 for SDK15 and SDK17 only
      https://www.nuget.org/packages/Microsoft.Build/17.0.0

    * MvsSln 2.6.1
      https://github.com/3F/MvsSln/releases/tag/2.6.1

    * 7z.Libs 21.7.0
      https://github.com/3F/7z.Libs/releases/tag/21.7.0

    * Microsoft.VisualStudio.Interop 17.0.32112.339
      https://www.nuget.org/packages/Microsoft.VisualStudio.Interop/17.0.32112.339

    * NLog 4.7.13
      https://github.com/NLog/NLog/releases/tag/v4.7.13

    * AvalonEdit 6.1.3.50
      https://github.com/icsharpcode/AvalonEdit/releases/tag/v6.1.3

    * System.Runtime.CompilerServices.Unsafe 5.0.0
      https://go.microsoft.com/fwlink/?LinkID=799421

    * Newtonsoft.Json 13.0.1
      https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.1

    * LSender 1.16
      https://github.com/3F/LSender/releases/tag/1.16

* KNOWN: 7z: relative paths like ..\Dir for input files lead to wrong filename in zip file.
         Please follow the temporary solution described here:
         3F/vsSolutionBuildEvent#70

* NOTE: Choose the package that suits your needs:
        https://github.com/3F/vsSolutionBuildEvent/releases/tag/1.4

        * SDK17: Visual Studio 2022+
        * SDK15: Visual Studio 2019, 2017
        * SDK10: Visual Studio 2017, 2015, 2013, 2012, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant