@@ -202,15 +202,13 @@ private Symbol delabel(label(_, Symbol s)) = delabel(s);
202202private Symbol delabel (conditional (Symbol s , _)) = delabel (s );
203203private default Symbol delabel (Symbol s ) = s ;
204204
205- int stubCounter = 1 ;
206-
207205@synopsis {Generates a string formatter that produces ((TextEdit))s for downstream processing.}
208206list [TextEdit ](str ) stringEdits (type [&G <: Tree ] grammar , Style style , FormattingOptions opts =fo ()) {
209207 &G (str , loc ) p = parser (grammar );
210- loc stub = |tmp:///| + "formatted<stubCounter > .txt" ;
211- stubCounter = stubCounter + 1 ;
212208
213209 return list [TextEdit ] (str input ) {
210+ loc stub = |tmp:///| + "formatted<md5Hash (input )> .txt" ;
211+
214212 &G tree = p (input , stub );
215213 try {
216214 return layoutDiff (tree , p (format (style (tree ), opts =opts [ci =asIs ()]), stub ), ci =opts .caseInsensitivity );
@@ -244,10 +242,10 @@ parameter (a substring). For example: `#Statement` and `if (true) false;`.
244242}
245243list [TextEdit ](type [Tree ], str ) subStringEdits (type [&G <: Tree ] grammar , Style style , FormattingOptions opts =fo ()) {
246244 Tree (type [Tree ], str , loc ) p = parsers (grammar );
247- loc stub = |tmp:///| + "formatted-<stubCounter > .txt" ;
248- stubCounter = stubCounter + 1 ;
249245
250246 return list [TextEdit ] (type [Tree ] nonterminal , str input ) {
247+ loc stub = |tmp:///| + "formatted<md5Hash (input )> .txt" ;
248+
251249 &G tree = p (nonterminal , input , stub );
252250 try {
253251 return layoutDiff (tree , p (nonterminal , format (style (tree ), opts =opts [ci =asIs ()]), stub ), ci =opts .caseInsensitivity );
0 commit comments