Skip to content

Conversation

@roblourens
Copy link
Member

Copilot AI review requested due to automatic review settings November 8, 2025 23:04
@roblourens roblourens enabled auto-merge (squash) November 8, 2025 23:04
@roblourens roblourens self-assigned this Nov 8, 2025
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/contrib/chat/browser/chatInputPart.ts
  • src/vs/workbench/contrib/chat/browser/chatWidget.ts

@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 8, 2025
Copy link
Contributor

Copilot AI left a 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

@roblourens roblourens merged commit 2fac2d4 into main Nov 9, 2025
33 of 34 checks passed
@roblourens roblourens deleted the roblou/disturbing-meadowlark branch November 9, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants