-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement: adds details to github issue
- Loading branch information
1 parent
6952110
commit 6e5d120
Showing
3 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
metals/src/main/scala/scala/meta/internal/metals/GithubNewIssue.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package scala.meta.internal.metals | ||
|
||
import java.net.URLEncoder | ||
|
||
import scala.util.Properties | ||
|
||
import org.eclipse.lsp4j.ClientInfo | ||
|
||
object GithubNewIssue { | ||
def buildUrl(clientInfo: ClientInfo): String = { | ||
val clientVersion = | ||
if (clientInfo.getVersion() == null) "" | ||
else s" ${clientInfo.getVersion()}" | ||
val body = | ||
s"""|<!-- | ||
| Describe the bug ... | ||
| | ||
| Reproduction steps | ||
| 1. Go to ... | ||
| 2. Click on ... | ||
| 3. Scroll down to ... | ||
| 4. See error | ||
|--> | ||
| | ||
|### Expected behaviour: | ||
| | ||
|<!-- A clear and concise description of what you expected to happen. --> | ||
| | ||
|**Operating system:** | ||
|${Properties.osName} | ||
| | ||
|**Java version:** | ||
|${Properties.javaVersion} | ||
| | ||
|**Editor/extension:** | ||
|${clientInfo.getName()}$clientVersion | ||
| | ||
|**Metals version:** | ||
|${BuildInfo.metalsVersion} | ||
| | ||
|### Extra context or search terms: | ||
|<!-- | ||
| - Any other context about the problem | ||
| - Search terms to help others discover this | ||
|--> | ||
|""".stripMargin | ||
val encodedBody = URLEncoder.encode(body) | ||
s"https://github.com/scalameta/metals/issues/new?body=$encodedBody" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters