Skip to content

Commit

Permalink
Change idePath from FileUri to string
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaskos-sonar committed Oct 2, 2024
1 parent 5f63769 commit 3e4c375
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

using SonarLint.VisualStudio.IssueVisualization.FixSuggestion;
using SonarLint.VisualStudio.SLCore.Common.Models;
using SonarLint.VisualStudio.SLCore.Core;
using SonarLint.VisualStudio.SLCore.Listener.FixSuggestion;
using SonarLint.VisualStudio.SLCore.Listener.FixSuggestion.Models;
Expand Down Expand Up @@ -60,7 +59,7 @@ public void ShowFixSuggestion_CallsHandler()
{
new(new LineRangeDto(10, 10), "public void test()", "private void test()")
};
var fileEditDto = new FileEditDto(new FileUri(@"C:\Users\test\TestProject\AFile.cs"), listOfChanges);
var fileEditDto = new FileEditDto(@"C:\Users\test\TestProject\AFile.cs", listOfChanges);
var fixSuggestionDto = new FixSuggestionDto("SUGGESTION_ID", "AN EXPLANATION", fileEditDto);
var parameters = new ShowFixSuggestionParams("CONFIG_SCOPE_ID", "S1234", fixSuggestionDto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

using Newtonsoft.Json;
using SonarLint.VisualStudio.SLCore.Common.Models;
using SonarLint.VisualStudio.SLCore.Listener.FixSuggestion;
using SonarLint.VisualStudio.SLCore.Listener.FixSuggestion.Models;
using FileEditDto = SonarLint.VisualStudio.SLCore.Listener.FixSuggestion.Models.FileEditDto;
Expand All @@ -36,7 +35,7 @@ public void Serialize_AsExpected()
{
new(new LineRangeDto(10, 10), "public void test()", "private void test()")
};
var fileEditDto = new FileEditDto(new FileUri(@"C:\Users\test\TestProject\AFile.cs"), listOfChanges);
var fileEditDto = new FileEditDto(@"C:\Users\test\TestProject\AFile.cs", listOfChanges);
var fixSuggestionDto = new FixSuggestionDto("SUGGESTION_ID", "AN EXPLANATION", fileEditDto);
var testSubject = new ShowFixSuggestionParams("CONFIG_SCOPE_ID", "S1234", fixSuggestionDto);

Expand All @@ -48,7 +47,7 @@ public void Serialize_AsExpected()
"suggestionId": "SUGGESTION_ID",
"explanation": "AN EXPLANATION",
"fileEdit": {
"idePath": "file:///C:/Users/test/TestProject/AFile.cs",
"idePath": "C:\\Users\\test\\TestProject\\AFile.cs",
"changes": [
{
"beforeLineRange": {
Expand Down
4 changes: 1 addition & 3 deletions src/SLCore/Listener/FixSuggestion/Models/FileEditDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

using SonarLint.VisualStudio.SLCore.Common.Models;

namespace SonarLint.VisualStudio.SLCore.Listener.FixSuggestion.Models;

public record FileEditDto(FileUri idePath, List<ChangesDto> changes);
public record FileEditDto(string idePath, List<ChangesDto> changes);

0 comments on commit 3e4c375

Please sign in to comment.