JuliaLang / JuliaSyntax.jl

The Julia compiler frontend
Other
266 stars 32 forks source link

Don't define `Base.range(::SyntaxNode)` #417

Open LilithHafner opened 4 months ago

LilithHafner commented 4 months ago

The JuliaSyntax method range(::SyntaxNode) provides very useful functionality, but I personally don't think it is semantically aligned with the generic Base.range function enough to be a method of that function. Opening this issue to solicit other folks' opinions.

I would prefer a parent_indices or indices function.

LilithHafner commented 4 months ago

Base.parentindices is probably the right name for this (thanks to @aplavin for pointing that out in a different context)

c42f commented 3 months ago

Totally fair... Base.range() was not a good choice :-)

To be quite honest I want to rewrite the SyntaxNode API completely, I don't think it hits a good point in the design space for syntax trees.

I have a bunch of ideas, just haven't had time/mental space to articulate them somewhere outside my brain yet :sweat_smile: