Skip to content

fix: chat code block isInsertable language comparison#1082

Merged
datlechin merged 1 commit into
mainfrom
fix/chat-code-block-isinsertable
May 7, 2026
Merged

fix: chat code block isInsertable language comparison#1082
datlechin merged 1 commit into
mainfrom
fix/chat-code-block-isinsertable

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Hot-fix for compile error introduced by #1077.

AIChatCodeBlockView.isInsertable compared treeSitterLanguage.id != .default. Swift's type inference resolved .default to TaskPriority.default instead of TreeSitterLanguage, producing:

Cannot convert value of type 'TreeSitterLanguage' to expected argument type 'TaskPriority'

Fix: qualify the comparison with CodeLanguage.default.id so both sides are explicitly TreeSitterLanguage.

Test plan

  • Build the project. The error at AIChatCodeBlockView.swift:153 no longer fires.
  • Open a chat code block produced by the AI. The Insert button is enabled when the language is recognized (sql/javascript/bash) and disabled for plain text.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit 2db7ec6 into main May 7, 2026
2 checks passed
@datlechin datlechin deleted the fix/chat-code-block-isinsertable branch May 7, 2026 12:37
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.

1 participant