[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:
oolokioo7 2026-03-08 18:04:37 -03:00 committed by GitHub
parent b3d6c06731
commit e15df63cac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 6 deletions

View File

@ -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]]]