refactor(linter/plugins): import getNodeLoc instead of injecting it#21026
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 3, 2026
Conversation
This was referenced Apr 3, 2026
Merged
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the raw-transfer deserializer generation to stop injecting a getLoc callback into the linter deserializer entrypoint, and instead have the generated linter deserializer use a static getNodeLoc implementation.
Changes:
- Generate linter deserializer code that imports and uses
getNodeLocdirectly, removing thegetLoc/GetLocinjection plumbing. - Update oxlint’s
initAst()to calldeserializeProgramOnlywithout passinggetNodeLoc. - Regenerate napi/parser deserializers to drop the now-unused
getLocInputparameter path indeserializeWith.
Reviewed changes
Copilot reviewed 2 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/raw_transfer.rs | Updates the deserializer generator template to import getNodeLoc and removes the injected getLoc parameter/type. |
| napi/parser/src-js/generated/deserialize/ts.js | Regenerated parser deserializer to remove unused getLocInput from deserializeWith. |
| napi/parser/src-js/generated/deserialize/ts_range.js | Same regeneration change (range variant). |
| napi/parser/src-js/generated/deserialize/ts_range_parent.js | Same regeneration change (range+parent variant). |
| napi/parser/src-js/generated/deserialize/ts_parent.js | Same regeneration change (parent variant). |
| napi/parser/src-js/generated/deserialize/js.js | Same regeneration change (JS variant). |
| napi/parser/src-js/generated/deserialize/js_range.js | Same regeneration change (JS range variant). |
| napi/parser/src-js/generated/deserialize/js_range_parent.js | Same regeneration change (JS range+parent variant). |
| napi/parser/src-js/generated/deserialize/js_parent.js | Same regeneration change (JS parent variant). |
| apps/oxlint/src-js/plugins/source_code.ts | Removes passing getNodeLoc into deserializeProgramOnly. |
| apps/oxlint/src-js/generated/deserialize.js | Generated linter deserializer now imports getNodeLoc and removes getLoc injection state. |
| apps/oxlint/src-js/generated/deserialize.d.ts | Updates the public typings for deserializeProgramOnly to remove the getLoc parameter. |
aeab5d1 to
7111ad4
Compare
2f73eb9 to
3a33c7d
Compare
7111ad4 to
31c6baf
Compare
Contributor
Merge activity
|
…#21026) Refacfor. In a strange pattern, we were injecting `getNodeLoc` into `deserialize.js` module on every call to `deserializeProgramOnly`. It's a static function, so just import it.
3a33c7d to
fb52383
Compare
31c6baf to
a4ac3ce
Compare
Base automatically changed from
om/04-03-perf_napi_parser_linter_plugins_clear_buffers_and_source_texts_earlier
to
main
April 3, 2026 22:19
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.

Refacfor. In a strange pattern, we were injecting
getNodeLocintodeserialize.jsmodule on every call todeserializeProgramOnly. It's a static function, so just import it.