jeffdapaz / VisualChatGPTStudio

Add chatGPT functionalities directly on Visual Studio
https://marketplace.visualstudio.com/items?itemName=jefferson-pires.VisualChatGPTStudio
MIT License
186 stars 48 forks source link

Putting unnecessary texts in the answer #68

Closed Arman-Espiar closed 4 months ago

Arman-Espiar commented 4 months ago

Hello, the reply that comes from chat gpt contains unnecessary texts.

For example, when I want to write a test for the following method: public static string FixLengthNumeric(string fieldName, dynamic lenghtNumber) => string.Format(Validations.FixLengthNumeric, fieldName, lenghtNumber.ToString());

He writes as follows:

```csharp
using Xunit;

public class ValidationTests
{
    [Fact]
    public void FixLengthNumeric_WithFieldNameAndLengthNumber_ShouldReturnFormattedString()
    {
        // Arrange
        string fieldName = "Field1";
        dynamic lengthNumber = 10;

        // Act
        string result = YourClassName.FixLengthNumeric(fieldName, lengthNumber);

        // Assert
        Assert.Equal("ExpectedFormattedString", result); // Update ExpectedFormattedString with the expected result
    }
}
 ` ``` `
In the test method `FixLengthNumeric_WithFieldNameAndLengthNumber_ShouldReturnFormattedString`, you can replace `YourClassName` with the actual class name where the `FixLengthNumeric` method is located. Update the `Assert.Equal` statement with the expected formatted string that should be returned by the `FixLengthNumeric` method.

The beginning of the return code is ```csharp and the end is ``` . and description text without // characters This is true for the rest of the commands as well.

jeffdapaz commented 4 months ago

Hi @Arman-Espiar,

about the tags, I will implement a way to remove this from the OpenAI response.

But comments that don't start with comment characters are a bit tricky to do because it's difficult to identify what is code and what isn't. But I'll see what I can do.

I'll post the status of my progress here.

jeffdapaz commented 4 months ago

Hi @Arman-Espiar ,

I published a new version with the fix 🙂