File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
modules/cli/src/main/scala/scala/cli/commands/bsp Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ object Bsp extends ScalaCommand[BspOptions] {
21
21
override def hidden = true
22
22
override def scalaSpecificationLevel = SpecificationLevel .IMPLEMENTATION
23
23
private def latestSharedOptions (options : BspOptions ): SharedOptions =
24
- options.jsonOptions.map { optionsPath =>
25
- val content = os.read.bytes(os.Path (optionsPath, os.pwd))
26
- readFromArray(content)(SharedOptions .jsonCodec)
27
- }.getOrElse(options.shared)
24
+ options.jsonOptions
25
+ .map(path => os.Path (path, os.pwd))
26
+ .filter(path => os.exists(path) && os.isFile(path))
27
+ .map { optionsPath =>
28
+ val content = os.read.bytes(os.Path (optionsPath, os.pwd))
29
+ readFromArray(content)(SharedOptions .jsonCodec)
30
+ }.getOrElse(options.shared)
28
31
override def sharedOptions (options : BspOptions ): Option [SharedOptions ] =
29
32
Option (latestSharedOptions(options))
30
33
You can’t perform that action at this time.
0 commit comments