deno_graph
deno_graph copied to clipboard
Ability to discern between types directive and x-TypeScript-types
For deno vendor, it might be nice to have a way to represent /// <reference types="..." /> and x-TypeScript-types separately in the graph while still providing a common method for the maybe_types_dependency.
This would also help us remove Range from being necessary for x-typescript-types as the types directive could have a range, but the x-typescript-types doesn't need one:
https://github.com/denoland/deno_graph/blob/f8adbe45ab39a52ec2bbcb671a65593acf072226/src/graph.rs#L1331-L1340
Alternatively, I can just do a check for the start and end position all being zero, but that seems a little hacky.
I don't think they should specifically be seperate, as they represent the same functional concept, but should contain an optional range instead of a 0 range.
Sure. I updated the title.