deno_graph icon indicating copy to clipboard operation
deno_graph copied to clipboard

Ability to discern between types directive and x-TypeScript-types

Open dsherret opened this issue 3 years ago • 2 comments

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.

dsherret avatar Feb 09 '22 20:02 dsherret

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.

kitsonk avatar Feb 09 '22 22:02 kitsonk

Sure. I updated the title.

dsherret avatar Feb 10 '22 00:02 dsherret