-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add context check for debug mode #4275
base: main
Are you sure you want to change the base?
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. 变更概述演练在 变更
对链接问题的评估
可能相关的 PR
建议标签
建议评审人
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/debug/src/browser/view/console/debug-console.service.ts (1)
156-163
: 考虑用单行逻辑替代 if/else 判断,以简化代码可读性在第 158-162 行中,
inDebugMode
的取值直接决定了调用contextInDebugMode.set(true)
或contextInDebugMode.set(false)
,可将这两步合并为一行,进一步提升代码简洁度:- if (inDebugMode) { - this.debugContextKey.contextInDebugMode.set(true); - } else { - this.debugContextKey.contextInDebugMode.set(false); - } + this.debugContextKey.contextInDebugMode.set(!!inDebugMode);
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4275 +/- ##
==========================================
- Coverage 54.27% 54.26% -0.02%
==========================================
Files 1633 1633
Lines 99712 99730 +18
Branches 21636 21635 -1
==========================================
- Hits 54123 54121 -2
- Misses 37880 37894 +14
- Partials 7709 7715 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -153,6 +153,14 @@ export class DebugConsoleService implements IHistoryNavigationWidget { | |||
|
|||
this.debugContextKey = this.injector.get(DebugContextKey, [this.inputEditor.monacoEditor.contextKeyService]); | |||
|
|||
const inDebugMode = this.contextKeyService.match(CONTEXT_IN_DEBUG_MODE_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逻辑总感觉稍微有点点不合理,不能在更早的时候设置监听嘛
Types
Background or solution
fix #4252
Changelog
修复 Debug Console Input 无法准确执行命令问题
Summary by CodeRabbit