Skip to content

Conversation

@7h3kk1d
Copy link
Contributor

@7h3kk1d 7h3kk1d commented Oct 17, 2025

Uses a single InfoMessage representation that gets passed to ErrorPrint and CursorInspector.

A message is a list of InfoMessage.fragment which is a variant that has different stylings coupled with a is_error flag that determines whether or not an error is present.

In the future I think the InfoMessage format could be extended to any information that is displayed in some contextual menu like the sidebar.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 51.41%. Comparing base (09b27d1) to head (7aba403).

Files with missing lines Patch % Lines
src/util/ListUtil.re 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1991      +/-   ##
==========================================
- Coverage   51.44%   51.41%   -0.03%     
==========================================
  Files         209      209              
  Lines       21721    21722       +1     
==========================================
- Hits        11175    11169       -6     
- Misses      10546    10553       +7     
Files with missing lines Coverage Δ
src/util/ListUtil.re 54.09% <0.00%> (-0.25%) ⬇️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@7h3kk1d 7h3kk1d requested a review from Copilot October 17, 2025 17:44
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 error and status message generation by extracting message building logic from CursorInspector.re into a new shared ErrorMessage.re module. The refactoring enables both UI rendering (in CursorInspector.re) and string formatting (in ErrorPrint.re) to use the same underlying message generation logic.

Key Changes

  • Created a new ErrorMessage.re module with a fragment-based representation that abstracts message components (text, code, types, terms, labels)
  • Updated CursorInspector.re to use the new message building functions instead of local view generation
  • Modified ErrorPrint.re to use the shared message building logic for string output
  • Added join_map utility function to ListUtil.re

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/haz3lcore/ErrorMessage.re New module containing shared message building logic with fragment-based representation for all info types (exp, pat, typ, tpat)
src/web/app/inspector/CursorInspector.re Removed local message building functions and replaced with calls to shared ErrorMessage module, added render_ui to convert fragments to UI nodes
src/haz3lcore/TyDi/ErrorPrint.re Replaced individual error printing functions with shared message building and fragment rendering to strings
src/util/ListUtil.re Added join_map utility function for joining mapped lists with separators

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@7h3kk1d 7h3kk1d requested a review from Copilot October 20, 2025 14:51
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@7h3kk1d 7h3kk1d marked this pull request as ready for review October 20, 2025 15:05
@7h3kk1d 7h3kk1d self-assigned this Oct 20, 2025
@7h3kk1d 7h3kk1d requested a review from disconcision November 5, 2025 17:05
@disconcision
Copy link
Member

@7h3kk1d comments as requested regarding llms: I'm fine with this approach. in practice we might override some of this in an ad hoc way when iterating on llm behavior. this could in principle be generic in that mostly we just want better error messages, but the constraints are somewhat different, ie the size of the cursor inspector versus practically unbounded. there is definitely a principled way to handle this, eg short messages in the bar, longer ones in an expanded dialog, but i'm not highly motivated to solve this in a principled way atm.

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +396 to +400
Text("is a sum type constuctor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constuctor of type"),
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'constuctor' to 'constructor'.

Suggested change
Text("is a sum type constuctor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constuctor of type"),
Text("is a sum type constructor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constructor of type"),

Copilot uses AI. Check for mistakes.
Comment on lines +396 to +400
Text("is a sum type constuctor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constuctor of type"),
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'constuctor' to 'constructor'.

Suggested change
Text("is a sum type constuctor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constuctor of type"),
Text("is a sum type constructor of type"),
Type(sum_ty),
]
| VariantIncomplete(sum_ty) => [
Text("An incomplete sum type constructor of type"),

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants