EnterCommandLineMode sets the CLI mode flag to true and returns a restore function that reverts it to its previous value. Intended for use with defer: restore := etscore.EnterCommandLineMode() defer restore()
()
| 10 | // restore := etscore.EnterCommandLineMode() |
| 11 | // defer restore() |
| 12 | func EnterCommandLineMode() func() { |
| 13 | prev := commandLineMode.Swap(true) |
| 14 | return func() { |
| 15 | commandLineMode.Store(prev) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | // IsCommandLineMode reports whether the process is currently running in CLI |
| 20 | // (tsc) mode, as opposed to LSP or other flows. |
no outgoing calls