mirror of https://github.com/sbt/sbt.git
[2.x] fix: sbt-with-loglevel-error (#8883)
**Fix** Wrap BuiltinCommands.setParser with Act.requireSession(...). This makes the parser fail gracefully when no session is available, matching the behavior of other session-dependent parsers.
This commit is contained in:
parent
b3d6c06731
commit
e15df63cac
|
|
@ -704,12 +704,15 @@ object BuiltinCommands {
|
|||
(ext.structure, Select(ext.currentRef), ext.showKey)
|
||||
}
|
||||
|
||||
def setParser = (s: State) => {
|
||||
val extracted = Project.extract(s)
|
||||
import extracted.*
|
||||
token(Space ~> flag("every" ~ Space)) ~
|
||||
SettingCompletions.settingParser(structure.data, structure.index.keyMap, currentProject)
|
||||
}
|
||||
def setParser = (s: State) =>
|
||||
Act.requireSession(
|
||||
s, {
|
||||
val extracted = Project.extract(s)
|
||||
import extracted.*
|
||||
token(Space ~> flag("every" ~ Space)) ~
|
||||
SettingCompletions.settingParser(structure.data, structure.index.keyMap, currentProject)
|
||||
}
|
||||
)
|
||||
|
||||
import Def.ScopedKey
|
||||
// type PolyStateKeysParser = [a] => State => Parser[Seq[ScopedKey[a]]]
|
||||
|
|
|
|||
Loading…
Reference in New Issue