Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Start http server earlier #7084

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class WorkspaceLspService(
() => httpServer,
clientConfig,
languageClient,
clientConfig.isHttpEnabled(),
)

private val bspStatus = new BspStatus(
Expand Down Expand Up @@ -1263,8 +1264,8 @@ class WorkspaceLspService(
workDoneProgress.start(sh, 0, 1, ju.concurrent.TimeUnit.SECONDS)
for {
_ <- userConfigSync.initSyncUserConfiguration(folderServices)
_ <- Future.sequence(folderServices.map(_.initialized()))
_ <- Future(startHttpServer())
_ <- Future.sequence(folderServices.map(_.initialized()))
} yield ()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class HeadDoctor(
httpServer: () => Option[MetalsHttpServer],
clientConfig: ClientConfiguration,
languageClient: MetalsLanguageClient,
isHttpEnabled: Boolean,
) {
private val isVisible = new AtomicBoolean(false)

Expand Down Expand Up @@ -85,10 +86,14 @@ class HeadDoctor(
httpServer() match {
case Some(server) =>
onServer(server)
case None =>
case None if !isHttpEnabled =>
scribe.warn(
"Unable to run doctor. Make sure `isHttpEnabled` is set to `true`."
)
case None =>
scribe.info(
"Doctor was not yet started, check logs to make sure it's running"
)
}
}
}
Expand Down
Loading