Skip to content

Add Neon error codes #1110

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

dherman
Copy link
Collaborator

@dherman dherman commented Jul 14, 2025

Summary

  • introduce an ErrorCode enum for compile-time diagnostics
  • annotate compiler errors with short codes
  • document error codes in doc/error-codes.md
  • update UI test expectations and mention codes in README

Testing

  • cargo test -p neon-macros
  • cargo test -p ui-test
  • cargo check

https://chatgpt.com/s/cd_68752f536f3081919816d5573dd4a091

Copy link

🐰 Bencher Report

Branchcodex/implement-idea-from-issue-1079
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Lower Boundary
nanoseconds (ns)
(Limit %)
Upper Boundary
nanoseconds (ns)
(Limit %)
ThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
Upper Boundary
operations / second (ops/s)
(Limit %)
JsFunction::bind📈 view plot
🚷 view threshold
239.45 ns
(+15.66%)Baseline: 207.04 ns
186.34 ns
(77.82%)
414.08 ns
(57.83%)
📈 view plot
🚷 view threshold
4,175,390.81 ops/s
(-13.27%)Baseline: 4,814,102.94 ops/s
0.00 ops/s
(0.00%)
5,295,513.23 ops/s
(78.85%)
JsFunction::call📈 view plot
🚷 view threshold
223.20 ns
(+2.05%)Baseline: 218.71 ns
196.83 ns
(88.19%)
437.41 ns
(51.03%)
📈 view plot
🚷 view threshold
4,475,638.30 ops/s
(-1.71%)Baseline: 4,553,629.32 ops/s
0.00 ops/s
(0.00%)
5,008,992.25 ops/s
(89.35%)
JsFunction::call_with📈 view plot
🚷 view threshold
194.64 ns
(-5.69%)Baseline: 206.39 ns
185.75 ns
(95.43%)
412.78 ns
(47.15%)
📈 view plot
🚷 view threshold
5,138,415.88 ops/s
(+6.06%)Baseline: 4,844,654.49 ops/s
0.00 ops/s
(0.00%)
5,329,119.94 ops/s
(96.42%)
auto-exported-noop📈 view plot
🚷 view threshold
27.82 ns
(-9.18%)Baseline: 30.63 ns
27.57 ns
(99.09%)
61.26 ns
(45.41%)
📈 view plot
🚷 view threshold
35,956,714.32 ops/s
(+7.63%)Baseline: 33,406,874.69 ops/s
0.00 ops/s
(0.00%)
36,747,562.15 ops/s
(97.85%)
hello-world📈 view plot
🚷 view threshold
58.42 ns
(+1.77%)Baseline: 57.40 ns
51.66 ns
(88.43%)
114.81 ns
(50.89%)
📈 view plot
🚷 view threshold
16,804,194.93 ops/s
(-3.17%)Baseline: 17,353,808.12 ops/s
0.00 ops/s
(0.00%)
19,089,188.93 ops/s
(88.03%)
manually-exported-noop📈 view plot
🚷 view threshold
27.74 ns
(-2.30%)Baseline: 28.39 ns
25.55 ns
(92.12%)
56.78 ns
(48.85%)
📈 view plot
🚷 view threshold
36,003,416.97 ops/s
(+2.39%)Baseline: 35,163,272.22 ops/s
0.00 ops/s
(0.00%)
38,679,599.44 ops/s
(93.08%)
🐰 View full continuous benchmarking report in Bencher

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 95.58824% with 3 lines in your changes missing coverage. Please review.

Project coverage is 82.88%. Comparing base (da5b61d) to head (4117599).

Files with missing lines Patch % Lines
crates/neon-macros/src/error.rs 93.93% 2 Missing ⚠️
crates/neon-macros/src/export/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1110      +/-   ##
==========================================
- Coverage   84.34%   82.88%   -1.47%     
==========================================
  Files          74       75       +1     
  Lines        5578     4733     -845     
  Branches     5578     4733     -845     
==========================================
- Hits         4705     3923     -782     
+ Misses        767      717      -50     
+ Partials      106       93      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Collaborator Author

@dherman dherman left a comment

Choose a reason for hiding this comment

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

Let's move all use statements in this PR to the top of their file.

@@ -16,6 +16,8 @@ pub(super) enum Kind {
Task,
}

use crate::error::ErrorCode;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All use statements should be placed in the top of the file.

@@ -189,6 +189,8 @@ fn context_parse(
// * Context argument must be a `&mut` reference
// * First argument must not be `Channel`
// * Must not be a `self` receiver
use crate::error::{self, ErrorCode};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please place all use statements at the top of their files.

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.

1 participant