File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
runner/bsp/worker/src/mill/bsp/worker Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -126,18 +126,8 @@ object ScriptModuleInit
126126 discoverScriptFiles(workspaceRoot, os.Path (mill.constants.OutFiles .out, workspaceRoot))
127127 .filter(p => ! nonScriptSourceFolders.exists(p.startsWith(_)))
128128 .flatMap { scriptPath =>
129- try {
130- resolveScriptModule(scriptPath.toString, eval.resolveScriptModuleDep).map { result =>
131- (scriptPath.toNIO, result)
132- }
133- } catch {
134- case e : Exception =>
135- // If resolving a script module fails, just log it and ignore
136- // it rather than blowing up the whole BSP import process
137- println(" Failed to instantiate script during BSP import and discovery: " + scriptPath)
138- println(e)
139- e.printStackTrace()
140- None
129+ resolveScriptModule(scriptPath.toString, eval.resolveScriptModuleDep).map { result =>
130+ (scriptPath.toNIO, result)
141131 }
142132 }
143133 }
Original file line number Diff line number Diff line change @@ -86,9 +86,12 @@ private[mill] class BspEvaluators(
8686 .invoke(null , nonScriptSources, eval)
8787 .asInstanceOf [Seq [(java.nio.file.Path , mill.api.Result [BspModuleApi ])]]
8888
89- result.map {
89+ result.flatMap {
9090 case (scriptPath : java.nio.file.Path , mill.api.Result .Success (module : BspModuleApi )) =>
91- (new BuildTargetIdentifier (Utils .sanitizeUri(scriptPath)), (module, eval))
91+ Some ((new BuildTargetIdentifier (Utils .sanitizeUri(scriptPath)), (module, eval)))
92+ case (scriptPath : java.nio.file.Path , mill.api.Result .Failure (msg : String )) =>
93+ println(s " Failed to instantiate script module for BSP: $scriptPath failed with $msg" )
94+ None
9295 }
9396 }
9497 lazy val bspModulesById : Map [BuildTargetIdentifier , (BspModuleApi , EvaluatorApi )] = {
You can’t perform that action at this time.
0 commit comments