Skip to content

Commit

Permalink
CSharpier server was starting on 127.0.0.1, if localhost resolved to …
Browse files Browse the repository at this point in the history
…::1 extensions could not format (#1244)

* Use 127.0.0.1 to avoid issue when localhost resolves to ::1

references #1242

* Use 127.0.0.1 for VS extension

* Use 127.0.0.1 for rider extension
  • Loading branch information
belav authored Apr 26, 2024
1 parent 488ddab commit 86f6690
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Src/CSharpier.Rider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# csharpier-rider Changelog

## [1.7.3]
- Fix issue with csharpier server not working when localhost resolved to IPv6 ::1

## [1.7.2]
- Better error message when csharpier server fails to start

Expand Down
2 changes: 1 addition & 1 deletion Src/CSharpier.Rider/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pluginGroup = com.intellij.csharpier
pluginName = csharpier
pluginVersion = 1.7.2
pluginVersion = 1.7.3

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public FormatFileResult formatFile(FormatFileParameter parameter) {
return null;
}

var url = "http://localhost:" + this.port + "/format";
var url = "http://127.0.0.1:" + this.port + "/format";


try {
Expand Down
3 changes: 3 additions & 0 deletions Src/CSharpier.VSCode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.7.2]
- Fix issue with csharpier server not working when localhost resolved to IPv6 ::1

## [1.7.1]
- Fix issue with csharpier server not supporting dotnet root

Expand Down
2 changes: 1 addition & 1 deletion Src/CSharpier.VSCode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "csharpier-vscode",
"displayName": "CSharpier - Code formatter",
"description": "Code formatter using csharpier",
"version": "1.7.1",
"version": "1.7.2",
"publisher": "csharpier",
"author": "CSharpier",
"homepage": "https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode",
Expand Down
2 changes: 1 addition & 1 deletion Src/CSharpier.VSCode/src/CSharpierProcessServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class CSharpierProcessServer implements ICSharpierProcess2 {
}

try {
const url = "http://localhost:" + this.port + "/format";
const url = "http://127.0.0.1:" + this.port + "/format";

const response = await fetch(url, {
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="83d6b6a0-9e25-4034-80f3-38445d8a8837" Version="1.7.0" Language="en-US" Publisher="CSharpier" />
<Identity Id="83d6b6a0-9e25-4034-80f3-38445d8a8837" Version="1.7.1" Language="en-US" Publisher="CSharpier" />
<DisplayName>CSharpier</DisplayName>
<Description xml:space="preserve">CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse your code and re-prints it using its own rules.</Description>
<MoreInfo>https://github.com/belav/csharpier</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="edd8b38c-baa1-46c6-b82e-1da7a0ba597b" Version="1.7.0" Language="en-US" Publisher="CSharpier" />
<Identity Id="edd8b38c-baa1-46c6-b82e-1da7a0ba597b" Version="1.7.1" Language="en-US" Publisher="CSharpier" />
<DisplayName>CSharpier 2019</DisplayName>
<Description xml:space="preserve">CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse your code and re-prints it using its own rules.</Description>
<MoreInfo>https://github.com/belav/csharpier</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public string FormatFile(string content, string filePath)
return null;
}

var url = "http://localhost:" + this.port + "/format";
var url = "http://127.0.0.1:" + this.port + "/format";

try
{
Expand Down
5 changes: 4 additions & 1 deletion Src/CSharpier.VisualStudio/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## [1.7.0]
## [1.7.1]
- Fix issue with csharpier server not working when localhost resolved to IPv6 ::1

## [1.7.0]
- Use CSharpier Server for 0.28.0+

## [1.5.2]
Expand Down

0 comments on commit 86f6690

Please sign in to comment.