Repository navigation
refactor: calculator.ts を分ける(範囲の読み取り・シートの前処理・型) - #189
Merged
Merged
Conversation
…the shared types rangeReading.ts builds a sheet's range reads from what they need (resolving a reference, the sheet as written, evaluating a call); sheetPreparation.ts holds the date preprocessing and the date source for display; openSheetTypes.ts the types the two share with calculator.ts. Code moved as it was, except that countFilledCells calls sourceSheetOf, whose body it had repeated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
CODEX VERDICT: LGTM
FINDINGS COMPLETE: I read every hunk of the diff and this is every finding I have. |
| @@ -0,0 +1,142 @@ | |||
| /** | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits
calculator.ts, which scoria flags asgod-file(over 500 lines). Behaviour does not change.src/engine/rangeReading.ts: the range reads offered to a formula —getRangeValues,getRangeValuesRaw,getRangeValuesKeepingBlanks,countFilledCells,getRangeGrid— and the helpers they use.openSheet. NowrangeReaders({ resolveSheetData, sourceSheetOf, evaluateValue })builds them from what they need.evaluateValueis defined later insideopenSheet, so it is passed as a function that calls it.src/engine/sheetPreparation.ts:preprocessDates, which turns dates written as text into serial numbers, andsheetsDateSource, where a date's display format is read from.src/engine/openSheetTypes.ts: the typescalculator.tsandrangeReading.tsshare (CellPosition,OpenSheet,ResolvedSheetRefand others).normalizeDatastays incalculator.ts. It is public, and tests import it from there. Its doc comment had become separated from it and now sits on it again.Items to Confirm
countFilledCellshad repeatedsourceSheetOf's body (which sheet's cells as written to read) inline; it now callssourceSheetOf. The two are the same expression.origin/main) and new were run side by side and compared:corpusdiff.mts);="", text, errors, numbers and a SEQUENCE that spills.errors.src/engine/index.ts,src/index.tsandsrc/core/index.tsare the same onorigin/mainand here.yarn lint,yarn typecheck,yarn build,yarn test,yarn test:engine,run-all-fixtures.ts,test:calculatorandtest:scriptspass. oxlint reports nothing.User Prompt
🤖 Generated with Claude Code
work in GUIChatPluginSpreadsheet