Skip to content

Conversation

@yavanosta
Copy link
Contributor

Seems that tm variable is redundant, because textModel is already read above. I don't see anything that can change it before it is reloaded, am I missing something?

If not, I think it worth it to remove redeclaration to simplify code.

Copilot AI review requested due to automatic review settings December 5, 2025 12:04
Copilot finished reviewing on behalf of yavanosta December 5, 2025 12:05
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 removes redundant code by eliminating an unnecessary re-read and null-check of the text model. The textModel variable is already declared and validated at the beginning of the _uiState derived callback (line 309-310), and nothing between that check and its later usage could invalidate it. The removed code (re-reading this._editorObs.model.read(reader) as tm) was functionally identical but added unnecessary complexity.

  • Removes redundant re-declaration and null-check of textModel variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants