Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Story 1565289: [MIEngine Natvis] Support multiple natvis files in visualizerFile launch configuration #1381

Merged
merged 22 commits into from
Feb 3, 2023

Conversation

gc46
Copy link
Contributor

@gc46 gc46 commented Jan 24, 2023

No description provided.

@gc46 gc46 requested a review from WardenGnaw January 24, 2023 22:22
Copy link
Member

@WardenGnaw WardenGnaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/CppTests/OpenDebug/CrossPlatCpp/LaunchCommand.cs Outdated Show resolved Hide resolved
test/CppTests/OpenDebug/CrossPlatCpp/LaunchCommand.cs Outdated Show resolved Hide resolved
test/CppTests/CppTests.csproj Outdated Show resolved Hide resolved
@gregg-miskelly
Copy link
Member

        }

I think you want to remove the set and backing field and just have:

        /// <summary>
        /// Collection of natvis files to use when evaluating
        /// </summary>
        public List<string> VisualizerFile { get; } = new List<string>();

Refers to: src/MICore/LaunchOptions.cs:974 in 50400ad. [](commit_id = 50400ad, deletion_comment = False)

@gc46
Copy link
Contributor Author

gc46 commented Jan 26, 2023

        }

I think you want to remove the set and backing field and just have:

        /// <summary>
        /// Collection of natvis files to use when evaluating
        /// </summary>
        public List<string> VisualizerFile { get; } = new List<string>();

Refers to: src/MICore/LaunchOptions.cs:974 in 50400ad. [](commit_id = 50400ad, deletion_comment = False)

Why do we not want the set()?

@gregg-miskelly
Copy link
Member

Why do we not want the set()?

Generally, properties with a collection type shouldn't have a set method. Instead, they get assigned in the constructor and items are added to them.

@gregg-miskelly
Copy link
Member

        }

This is still active.

If it makes your life easier, you can allow a set method, but in this case I would make these other changes:

  • Still initialize the backing field to an empty collection so you don't need those null checks.
  • Only allow set if the backing field is still an empty collection

In reply to: 1404353242


Refers to: src/MICore/LaunchOptions.cs:974 in 50400ad. [](commit_id = 50400ad, deletion_comment = False)

@gregg-miskelly
Copy link
Member

    /// Don't change this test without checking with C++ team.

We are changing this test.


Refers to: src/MICoreUnitTests/BasicLaunchOptionsTests.cs:255 in 3cb7931. [](commit_id = 3cb7931, deletion_comment = False)

@gc46
Copy link
Contributor Author

gc46 commented Feb 1, 2023

        }

This is still active.

If it makes your life easier, you can allow a set method, but in this case I would make these other changes:

  • Still initialize the backing field to an empty collection so you don't need those null checks.
  • Only allow set if the backing field is still an empty collection

In reply to: 1404353242

Refers to: src/MICore/LaunchOptions.cs:974 in 50400ad. [](commit_id = 50400ad, deletion_comment = False)

The reason I allowed for set is due to the VisualizerFiles assignment in other places throughout the codebase such as the one shown below:
image

We can disallow the ability to set VisualizerFiles though if you deem it fine.

@WardenGnaw
Copy link
Member

        }

This is still active.
If it makes your life easier, you can allow a set method, but in this case I would make these other changes:

  • Still initialize the backing field to an empty collection so you don't need those null checks.
  • Only allow set if the backing field is still an empty collection

In reply to: 1404353242
Refers to: src/MICore/LaunchOptions.cs:974 in 50400ad. [](commit_id = 50400ad, deletion_comment = False)

The reason I allowed for set is due to the VisualizerFiles assignment in other places throughout the codebase such as the one shown below: image

We can disallow the ability to set VisualizerFiles though if you deem it fine.

You can let LaunchOptions.VisualizerFiles be created during the constructor and it will be empty.
When we need to assign/pass the Users strings you can use this.VisualizerFiles.AddRange(option.VisualizerFiles).

@gc46 gc46 merged commit 153a9e5 into main Feb 3, 2023
@gc46 gc46 deleted the dev/gabchen/user-story-1565289 branch February 3, 2023 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants