visit question token in parameter#14642
Conversation
|
Can you weigh in on this, @rbuckton ? |
|
@aozgaa We generally don't visit token nodes, as there is no context between a |
|
For @vladima's textChanges PR, we need to track the positions of all the nodes we will print. I was running into crashes if we didn't visit all the children and update them, including the tokens. Should we track/update this information in some other way? The relevant usage of |
|
@aozgaa Visiting token nodes would add overhead to the transforms, though I'm not at the moment certain how significant that impact would be. You could add a special case to Also, I'm curious why https://github.com/Microsoft/TypeScript/blob/c687add579382a0910e985a36f88434312097dcc/src/services/textChanges.ts#L539 uses a prototype assignment. Why not use |
|
Because I forgot about |
|
It is not very convenient (though possible) to specifically recognize nodes that can contain tokens and then process tokens, I'd rather prefer to avoid special cases. What about adding optional |
|
@vladima That seems feasible. |
Fixes an issue in my work to create synthetic type nodes / signatures.