Skip to content

Commit

Permalink
Improvement: adds details to github issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Feb 10, 2023
1 parent 4cf33c3 commit 27b638c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,14 @@ class MetalsLspService(
else Future.successful(())
}
} yield ()).asJavaObject
case ServerCommands.OpenIssue() =>
Future
.successful(
Urls.openBrowser(
GithubNewIssue.buildUrl(initializeParams.getClientInfo())
)
)
.asJavaObject
case OpenBrowserCommand(url) =>
Future.successful(Urls.openBrowser(url)).asJavaObject
case ServerCommands.CascadeCompile() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ object ServerCommands {
"Open the Metals logs to troubleshoot issues.",
)

val OpenIssue = new OpenBrowserCommand(
"https://github.com/scalameta/metals/issues/new/choose",
val OpenIssue = new Command(
"open-new-github-issue",
"Open issue on GitHub",
"Open the Metals repository on GitHub to ask a question, report a bug or request a new feature.",
"Open the Metals repository on GitHub to ask a question or report a bug.",
)

val MetalsGithub = new OpenBrowserCommand(
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/src/test/scala/tests/BuildGithubIssue.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package tests

import scala.meta.internal.metals.GithubNewIssue

import org.eclipse.lsp4j.ClientInfo

class BuildGithubIssue extends BaseSuite {
test("build-url") {
pprint.log(GithubNewIssue.buildUrl(new ClientInfo("vscode", "1.1")))
}
}

0 comments on commit 27b638c

Please sign in to comment.