-
Notifications
You must be signed in to change notification settings - Fork 36k
Reduce some 'in' #276321
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
Reduce some 'in' #276321
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
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.
Pull Request Overview
This PR refactors the chat codebase to replace manual type checking with proper type guard functions and existing helpers, improving type safety and code maintainability. The changes address ESLint violations related to the @typescript-eslint/no-unsafe-member-access rule.
Key Changes
- Introduces type guard functions (
isChatFollowup,isIChatViewViewContext,isIChatResourceViewContext) to replace manual property existence checks - Replaces manual type checks with existing type guard functions (
isLocation,isITextModel) - Simplifies conditional logic by removing unnecessary property existence checks
- Removes several files from the ESLint exception list after fixing violations
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/chatService.ts |
Adds isChatFollowup type guard function to check if an object is an IChatFollowup |
src/vs/workbench/contrib/chat/browser/chat.ts |
Adds isIChatViewViewContext and isIChatResourceViewContext type guard functions for chat widget view contexts |
src/vs/workbench/contrib/chat/browser/chatWidget.ts |
Refactors to use new type guards instead of manual 'property' in object checks |
src/vs/workbench/contrib/chat/browser/chatListRenderer.ts |
Uses isChatFollowup type guard and simplifies height access by removing unnecessary 'currentRenderedHeight' in element check |
src/vs/workbench/contrib/chat/browser/chatInputPart.ts |
Replaces manual type checking with isLocation helper and removes unused Range import |
src/vs/workbench/contrib/chat/browser/chatFollowups.ts |
Simplifies tooltip logic by removing unnecessary 'tooltip' in followup check |
src/vs/workbench/contrib/chat/browser/chatEditorInput.ts |
Changes from 'data' in this.options.target to this.options.target.data for checking target data |
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts |
Uses isITextModel type guard instead of manual 'uri' in model check |
eslint.config.js |
Removes 7 chat-related files from the unsafe member access exception list |
#276071