Removing diffs, having original and new code should be enough.
authorJan Lahoda <jlahoda@netbeans.org>
Sun, 08 Jan 2017 22:32:39 +0100
changeset 1040f7b6892fd754
parent 1039 2d3a933b12e4
child 1041 b03a880d538e
child 1043 57843026e60b
Removing diffs, having original and new code should be enough.
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/ColoringAttributes.diff
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/SemanticHighlighter.diff
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/TokenList.diff
     1.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/ColoringAttributes.diff	Sun Jan 08 20:12:09 2017 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,4 +0,0 @@
     1.4 -44c44
     1.5 -< package org.netbeans.modules.java.editor.semantic;
     1.6 ----
     1.7 -> package org.netbeans.modules.jackpot30.backend.ui.highlighting;
     2.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/SemanticHighlighter.diff	Sun Jan 08 20:12:09 2017 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,354 +0,0 @@
     2.4 -44c44
     2.5 -< package org.netbeans.modules.java.editor.semantic;
     2.6 ----
     2.7 -> package org.netbeans.modules.jackpot30.backend.ui.highlighting;
     2.8 -84c84,86
     2.9 -< import java.io.IOException;
    2.10 ----
    2.11 -> import com.sun.source.util.TreePathScanner;
    2.12 -> import com.sun.tools.javac.tree.JCTree;
    2.13 -> import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
    2.14 -94,96d95
    2.15 -< import java.util.concurrent.atomic.AtomicBoolean;
    2.16 -< import java.util.logging.Level;
    2.17 -< import java.util.logging.Logger;
    2.18 -102,109d100
    2.19 -< import javax.swing.SwingUtilities;
    2.20 -< import javax.swing.text.Document;
    2.21 -< import org.netbeans.api.java.source.CompilationInfo;
    2.22 -< import org.netbeans.api.java.source.JavaParserResultTask;
    2.23 -< import org.netbeans.api.java.source.JavaSource.Phase;
    2.24 -< import org.netbeans.api.java.source.TreePathHandle;
    2.25 -< import org.netbeans.api.java.source.TreeUtilities;
    2.26 -< import org.netbeans.api.java.source.support.CancellableTreePathScanner;
    2.27 -111,123c102,103
    2.28 -< import org.netbeans.api.lexer.TokenHierarchy;
    2.29 -< import org.netbeans.modules.editor.NbEditorUtilities;
    2.30 -< import org.netbeans.modules.java.editor.imports.UnusedImports;
    2.31 -< import org.netbeans.modules.java.editor.semantic.ColoringAttributes.Coloring;
    2.32 -< import org.netbeans.modules.parsing.spi.Parser.Result;
    2.33 -< import org.netbeans.modules.parsing.spi.Scheduler;
    2.34 -< import org.netbeans.modules.parsing.spi.SchedulerEvent;
    2.35 -< import org.netbeans.modules.parsing.spi.TaskIndexingMode;
    2.36 -< import org.netbeans.spi.editor.highlighting.support.OffsetsBag;
    2.37 -< import org.netbeans.spi.editor.hints.ErrorDescription;
    2.38 -< import org.openide.filesystems.FileObject;
    2.39 -< import org.openide.filesystems.FileUtil;
    2.40 -< import org.openide.loaders.DataObject;
    2.41 ----
    2.42 -> import org.netbeans.modules.jackpot30.backend.ui.highlighting.ColoringAttributes.Coloring;
    2.43 -> import org.netbeans.modules.jackpot30.resolve.api.CompilationInfo;
    2.44 -130,214c110
    2.45 -< public class SemanticHighlighter extends JavaParserResultTask {
    2.46 -<     
    2.47 -<     public static List<TreePathHandle> computeUnusedImports(CompilationInfo info) throws IOException {
    2.48 -<         final List<TreePathHandle> result = new ArrayList<TreePathHandle>();
    2.49 -<         
    2.50 -<         for (TreePath unused : UnusedImports.process(info, new AtomicBoolean())) {
    2.51 -<             result.add(TreePathHandle.create(unused, info));
    2.52 -<         }
    2.53 -<         
    2.54 -<         return result;
    2.55 -<     }
    2.56 -<     
    2.57 -<     private FileObject file;
    2.58 -<     //XXX: correct rescheduling when troubles traversing token list!
    2.59 -< //    private SemanticHighlighterFactory fact;
    2.60 -<     private AtomicBoolean cancel = new AtomicBoolean();
    2.61 -<     
    2.62 -< //    SemanticHighlighter(FileObject file) {
    2.63 -< //        this(file, null);
    2.64 -< //    }
    2.65 -< //    
    2.66 -<     SemanticHighlighter(FileObject file/*, SemanticHighlighterFactory fact*/) {
    2.67 -<         super(Phase.RESOLVED, TaskIndexingMode.ALLOWED_DURING_SCAN);
    2.68 -<         this.file = file;
    2.69 -< //        this.fact = fact;
    2.70 -<     }
    2.71 -< 
    2.72 -<     @Override
    2.73 -<     public void run(Result result, SchedulerEvent event) {
    2.74 -<         CompilationInfo info = CompilationInfo.get(result);
    2.75 -<         
    2.76 -<         if (info == null) {
    2.77 -<             return ;
    2.78 -<         }
    2.79 -<         
    2.80 -<         cancel.set(false);
    2.81 -<         
    2.82 -<         final Document doc = result.getSnapshot().getSource().getDocument(false);
    2.83 -<         
    2.84 -<         if (!verifyDocument(doc)) return;
    2.85 -< 
    2.86 -<         if (process(info, doc)/* && fact != null*/) {
    2.87 -< //            fact.rescheduleImpl(file);
    2.88 -<         }
    2.89 -<     }
    2.90 -< 
    2.91 -<     private static boolean verifyDocument(final Document doc) {
    2.92 -<         if (doc == null) {
    2.93 -<             Logger.getLogger(SemanticHighlighter.class.getName()).log(Level.FINE, "SemanticHighlighter: Cannot get document!");
    2.94 -<             return false;
    2.95 -<         }
    2.96 -< 
    2.97 -<         final boolean[] tokenSequenceNull =  new boolean[1];
    2.98 -<         doc.render(new Runnable() {
    2.99 -<             public void run() {
   2.100 -<                 tokenSequenceNull[0] = (TokenHierarchy.get(doc).tokenSequence() == null);
   2.101 -<             }
   2.102 -<         });
   2.103 -<         if (tokenSequenceNull[0]) {
   2.104 -<             return false;
   2.105 -<         }
   2.106 -<         
   2.107 -<         return true;
   2.108 -<     }
   2.109 -<     
   2.110 -<     public void cancel() {
   2.111 -<         cancel.set(true);
   2.112 -<     }
   2.113 -<     
   2.114 -< 
   2.115 -<     @Override
   2.116 -<     public int getPriority() {
   2.117 -<         return 100;
   2.118 -<     }
   2.119 -< 
   2.120 -<     @Override
   2.121 -<     public Class<? extends Scheduler> getSchedulerClass() {
   2.122 -<         return Scheduler.EDITOR_SENSITIVE_TASK_SCHEDULER;
   2.123 -<     }
   2.124 -<     
   2.125 -< 
   2.126 -<     
   2.127 -<     boolean process(CompilationInfo info, final Document doc) {
   2.128 -<         return process(info, doc, ERROR_DESCRIPTION_SETTER);
   2.129 -<     }
   2.130 ----
   2.131 -> public class SemanticHighlighter {
   2.132 -218c114
   2.133 -<         
   2.134 ----
   2.135 -> 
   2.136 -222c118
   2.137 -<         
   2.138 ----
   2.139 -> 
   2.140 -225,227c121,123
   2.141 -<     
   2.142 -<     boolean process(CompilationInfo info, final Document doc, ErrorDescriptionSetter setter) {
   2.143 -<         DetectorVisitor v = new DetectorVisitor(info, doc, cancel);
   2.144 ----
   2.145 -> 
   2.146 ->     public static Map<Token, Coloring> computeHighlights(CompilationInfo info, TokenList tl) {
   2.147 ->         DetectorVisitor v = new DetectorVisitor(info, tl);
   2.148 -232d127
   2.149 -<         List<ErrorDescription> errors = new ArrayList<ErrorDescription>();
   2.150 -238,269c133
   2.151 -<         if (cancel.get())
   2.152 -<             return true;
   2.153 -<         
   2.154 -<         boolean computeUnusedImports = "text/x-java".equals(FileUtil.getMIMEType(info.getFileObject()));
   2.155 -<         
   2.156 -<         final List<TreePathHandle> allUnusedImports = computeUnusedImports ? new ArrayList<TreePathHandle>() : null;
   2.157 -<         OffsetsBag imports = computeUnusedImports ? new OffsetsBag(doc) : null;
   2.158 -< 
   2.159 -<         if (computeUnusedImports) {
   2.160 -<             Coloring unused = ColoringAttributes.add(ColoringAttributes.empty(), ColoringAttributes.UNUSED);
   2.161 -<             Collection<TreePath> unusedImports = UnusedImports.process(info, cancel);
   2.162 -< 
   2.163 -<             if (unusedImports == null) return true;
   2.164 -<             
   2.165 -<             for (TreePath tree : unusedImports) {
   2.166 -<                 if (cancel.get()) {
   2.167 -<                     return true;
   2.168 -<                 }
   2.169 -< 
   2.170 -<                 //XXX: finish
   2.171 -<                 final int startPos = (int) info.getTrees().getSourcePositions().getStartPosition(cu, tree.getLeaf());
   2.172 -<                 final int endPos = (int) info.getTrees().getSourcePositions().getEndPosition(cu, tree.getLeaf());
   2.173 -< 
   2.174 -<                 imports.addHighlight(startPos, endPos, ColoringManager.getColoringImpl(unused));
   2.175 -< 
   2.176 -<                 TreePathHandle handle = TreePathHandle.create(tree, info);
   2.177 -< 
   2.178 -<                 allUnusedImports.add(handle);
   2.179 -<             }
   2.180 -<         }
   2.181 -<         
   2.182 -<         Map<Token, Coloring> oldColors = LexerBasedHighlightLayer.getLayer(SemanticHighlighter.class, doc).getColorings();
   2.183 ----
   2.184 ->         Map<Token, Coloring> oldColors = new HashMap<Token, Coloring>();
   2.185 -274,276d137
   2.186 -<             if (cancel.get())
   2.187 -<                 return true;
   2.188 -<             
   2.189 -283c144
   2.190 -<                 if (u.type.contains(UseTypes.DECLARATION) && org.netbeans.modules.java.editor.semantic.Utilities.isPrivateElement(decl)) {
   2.191 ----
   2.192 ->                 if (u.type.contains(UseTypes.DECLARATION) && isPrivateElement(decl)) {
   2.193 -319,332c180
   2.194 -<         if (cancel.get())
   2.195 -<             return true;
   2.196 -<         
   2.197 -<         if (computeUnusedImports) {
   2.198 -<             setter.setErrors(doc, errors, allUnusedImports);
   2.199 -<             setter.setHighlights(doc, imports);
   2.200 -<         }
   2.201 -< 
   2.202 -<         setter.setColorings(doc, newColoring, addedTokens, removedTokens.keySet());
   2.203 -< 
   2.204 -<         Logger.getLogger("TIMER").log(Level.FINE, "Semantic",
   2.205 -<             new Object[] {NbEditorUtilities.getFileObject(doc), System.currentTimeMillis() - start});
   2.206 -<         
   2.207 -<         return false;
   2.208 ----
   2.209 ->         return newColoring;
   2.210 -336c184
   2.211 -<     private boolean hasAllTypes(List<Use> uses, Collection<UseTypes> types) {
   2.212 ----
   2.213 ->     private static boolean hasAllTypes(List<Use> uses, Collection<UseTypes> types) {
   2.214 -389c237
   2.215 -<     private static class DetectorVisitor extends CancellableTreePathScanner<Void, EnumSet<UseTypes>> {
   2.216 ----
   2.217 ->     private static class DetectorVisitor extends TreePathScanner<Void, EnumSet<UseTypes>> {
   2.218 -391,392c239
   2.219 -<         private org.netbeans.api.java.source.CompilationInfo info;
   2.220 -<         private Document doc;
   2.221 ----
   2.222 ->         private CompilationInfo info;
   2.223 -402,404c249
   2.224 -<         private DetectorVisitor(org.netbeans.api.java.source.CompilationInfo info, final Document doc, AtomicBoolean cancel) {
   2.225 -<             super(cancel);
   2.226 -<             
   2.227 ----
   2.228 ->         private DetectorVisitor(CompilationInfo info, TokenList tl) {
   2.229 -406d250
   2.230 -<             this.doc  = doc;
   2.231 -411c255
   2.232 -<             tl = new TokenList(info, doc, cancel);
   2.233 ----
   2.234 ->             this.tl = tl;
   2.235 -601c445
   2.236 -<             if (Utilities.isKeyword(expr.getLeaf())) {
   2.237 ----
   2.238 ->             if (isKeyword(expr.getLeaf())) {
   2.239 -806c650
   2.240 -<             if (info.getTreeUtilities().isSynthetic(getCurrentPath()))
   2.241 ----
   2.242 ->             if (isSynthetic(getCurrentPath()))
   2.243 -834c678
   2.244 -<             if (info.getTreeUtilities().isSynthetic(getCurrentPath())) {
   2.245 ----
   2.246 ->             if (isSynthetic(getCurrentPath())) {
   2.247 -886c730
   2.248 -<                 while (tp != null && !TreeUtilities.CLASS_TREE_KINDS.contains(tp.getLeaf().getKind())) {
   2.249 ----
   2.250 ->                 while (tp != null && !CLASS_TREE_KINDS.contains(tp.getLeaf().getKind())) {
   2.251 -890c734
   2.252 -<                 if (tp != null && TreeUtilities.CLASS_TREE_KINDS.contains(tp.getLeaf().getKind())) {
   2.253 ----
   2.254 ->                 if (tp != null && CLASS_TREE_KINDS.contains(tp.getLeaf().getKind())) {
   2.255 -1003c847
   2.256 -<             int[] span = info.getTreeUtilities().findNameSpan(tree);
   2.257 ----
   2.258 ->             int[] span = new int[] {((JCVariableDecl) tree).pos, ((JCVariableDecl) tree).pos + tree.getName().length()};//info.getTreeUtilities().findNameSpan(tree);
   2.259 -1313,1317c1157,1160
   2.260 -<     public static interface ErrorDescriptionSetter {
   2.261 -<         
   2.262 -<         public void setErrors(Document doc, List<ErrorDescription> errors, List<TreePathHandle> allUnusedImports);
   2.263 -<         public void setHighlights(Document doc, OffsetsBag highlights);
   2.264 -<         public void setColorings(Document doc, Map<Token, Coloring> colorings, Set<Token> addedTokens, Set<Token> removedTokens);
   2.265 ----
   2.266 -> 
   2.267 ->     //not fully correct, but should suffice now:
   2.268 ->     private static boolean isSynthetic(TreePath path) {
   2.269 ->         return ((JCTree) path.getLeaf()).pos == (-1);
   2.270 -1319,1329c1162,1185
   2.271 -<     
   2.272 -<     static ErrorDescriptionSetter ERROR_DESCRIPTION_SETTER = new ErrorDescriptionSetter() {
   2.273 -<         
   2.274 -<         public void setErrors(Document doc, List<ErrorDescription> errors, List<TreePathHandle> allUnusedImports) {}
   2.275 -<         
   2.276 -<         public void setHighlights(final Document doc, final OffsetsBag highlights) {
   2.277 -<             SwingUtilities.invokeLater(new Runnable() {
   2.278 -<                 public void run() {
   2.279 -<                     getImportHighlightsBag(doc).setHighlights(highlights);
   2.280 -<                 }
   2.281 -<             });
   2.282 ----
   2.283 -> 
   2.284 ->     //from semantic.Utilities:
   2.285 ->     private static final Set<String> keywords;
   2.286 ->     private static final Set<String> nonCtorKeywords;
   2.287 -> 
   2.288 ->     static {
   2.289 ->         keywords = new HashSet<String>();
   2.290 -> 
   2.291 ->         keywords.add("true");
   2.292 ->         keywords.add("false");
   2.293 ->         keywords.add("null");
   2.294 ->         keywords.add("this");
   2.295 ->         keywords.add("super");
   2.296 ->         keywords.add("class");
   2.297 -> 
   2.298 ->         nonCtorKeywords = new HashSet<String>(keywords);
   2.299 ->         nonCtorKeywords.remove("this");
   2.300 ->         nonCtorKeywords.remove("super");
   2.301 -> 
   2.302 ->     }
   2.303 -> 
   2.304 ->     public static boolean isKeyword(Tree tree) {
   2.305 ->         if (tree.getKind() == Kind.IDENTIFIER) {
   2.306 ->             return keywords.contains(((IdentifierTree) tree).getName().toString());
   2.307 -1331,1337c1187,1188
   2.308 -<     
   2.309 -<         public void setColorings(final Document doc, final Map<Token, Coloring> colorings, final Set<Token> addedTokens, final Set<Token> removedTokens) {
   2.310 -<             SwingUtilities.invokeLater(new Runnable () {
   2.311 -<                 public void run() {
   2.312 -<                     LexerBasedHighlightLayer.getLayer(SemanticHighlighter.class, doc).setColorings(colorings, addedTokens, removedTokens);
   2.313 -<                 }                
   2.314 -<             });            
   2.315 ----
   2.316 ->         if (tree.getKind() == Kind.MEMBER_SELECT) {
   2.317 ->             return keywords.contains(((MemberSelectTree) tree).getIdentifier().toString());
   2.318 -1339d1189
   2.319 -<     };
   2.320 -1341,1352c1191,1196
   2.321 -<     private static final Object KEY_UNUSED_IMPORTS = new Object();
   2.322 -<     static OffsetsBag getImportHighlightsBag(Document doc) {
   2.323 -<         OffsetsBag bag = (OffsetsBag) doc.getProperty(KEY_UNUSED_IMPORTS);
   2.324 -<         
   2.325 -<         if (bag == null) {
   2.326 -<             doc.putProperty(KEY_UNUSED_IMPORTS, bag = new OffsetsBag(doc));
   2.327 -<             
   2.328 -<             Object stream = doc.getProperty(Document.StreamDescriptionProperty);
   2.329 -<             
   2.330 -<             if (stream instanceof DataObject) {
   2.331 -< //                TimesCollector.getDefault().reportReference(((DataObject) stream).getPrimaryFile(), "ImportsHighlightsBag", "[M] Imports Highlights Bag", bag);
   2.332 -<             }
   2.333 ----
   2.334 ->         return false;
   2.335 ->     }
   2.336 -> 
   2.337 ->     public static boolean isNonCtorKeyword(Tree tree) {
   2.338 ->         if (tree.getKind() == Kind.IDENTIFIER) {
   2.339 ->             return nonCtorKeywords.contains(((IdentifierTree) tree).getName().toString());
   2.340 -1354,1355c1198,1208
   2.341 -<         
   2.342 -<         return bag;
   2.343 ----
   2.344 ->         if (tree.getKind() == Kind.MEMBER_SELECT) {
   2.345 ->             return nonCtorKeywords.contains(((MemberSelectTree) tree).getIdentifier().toString());
   2.346 ->         }
   2.347 -> 
   2.348 ->         return false;
   2.349 ->     }
   2.350 -> 
   2.351 ->     private static final Set<ElementKind> LOCAL_ELEMENT_KINDS = EnumSet.of(ElementKind.PARAMETER, ElementKind.LOCAL_VARIABLE, ElementKind.EXCEPTION_PARAMETER, ElementKind.RESOURCE_VARIABLE);
   2.352 -> 
   2.353 ->     public static boolean isPrivateElement(Element el) {
   2.354 ->         return LOCAL_ELEMENT_KINDS.contains(el.getKind()) || el.getModifiers().contains(Modifier.PRIVATE);
   2.355 -1357a1211,1212
   2.356 ->     //from TreeUtilities:
   2.357 ->     public static final Set<Kind> CLASS_TREE_KINDS = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE);
     3.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/highlighting/TokenList.diff	Sun Jan 08 20:12:09 2017 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,145 +0,0 @@
     3.4 -31c31
     3.5 -< package org.netbeans.modules.java.editor.semantic;
     3.6 ----
     3.7 -> package org.netbeans.modules.jackpot30.backend.ui.highlighting;
     3.8 -39d38
     3.9 -< import java.util.ArrayList;
    3.10 -41,42d39
    3.11 -< import java.util.Collections;
    3.12 -< import java.util.Iterator;
    3.13 -46d42
    3.14 -< import javax.swing.text.Document;
    3.15 -48d43
    3.16 -< import org.netbeans.api.java.source.CompilationInfo;
    3.17 -50,51d44
    3.18 -< import org.netbeans.api.lexer.TokenHierarchy;
    3.19 -< import org.netbeans.api.lexer.TokenId;
    3.20 -52a46
    3.21 -> import org.netbeans.modules.jackpot30.resolve.api.CompilationInfo;
    3.22 -62d55
    3.23 -<     private Document doc;
    3.24 -65,66d57
    3.25 -<     private boolean topLevelIsJava;
    3.26 -<     private TokenSequence topLevel;
    3.27 -69c60
    3.28 -<     public TokenList(CompilationInfo info, final Document doc, AtomicBoolean cancel) {
    3.29 ----
    3.30 ->     public TokenList(CompilationInfo info, TokenSequence<?> topLevel, AtomicBoolean cancel) {
    3.31 -71d61
    3.32 -<         this.doc = doc;
    3.33 -76,77d65
    3.34 -<         doc.render(new Runnable() {
    3.35 -<             public void run() {
    3.36 -81c69
    3.37 -<                 topLevel = TokenHierarchy.get(doc).tokenSequence();
    3.38 ----
    3.39 ->                 assert topLevel.language() == JavaTokenId.language();
    3.40 -83,85d70
    3.41 -<                 topLevelIsJava = topLevel.language() == JavaTokenId.language();
    3.42 -<                 
    3.43 -<                 if (topLevelIsJava) {
    3.44 -89,91d73
    3.45 -<                 }
    3.46 -<             }
    3.47 -<         });
    3.48 -95c77
    3.49 -<         final int offset = info.getSnapshot().getOriginalOffset((int) inputOffset);
    3.50 ----
    3.51 ->         final int offset = (int) inputOffset;
    3.52 -99,100d80
    3.53 -<         doc.render(new Runnable() {
    3.54 -<             public void run() {
    3.55 -108,109c88
    3.56 -<                 
    3.57 -<                 if (topLevelIsJava) {
    3.58 ----
    3.59 -> 
    3.60 -114,148d92
    3.61 -<                 } else {
    3.62 -<                     Iterator<? extends TokenSequence> embeddedSeqs = null;
    3.63 -<                     if (ts == null) {
    3.64 -<                         List<? extends TokenSequence> seqs = new ArrayList<TokenSequence>(embeddedTokenSequences(TokenHierarchy.get(doc), offset));
    3.65 -<                         Collections.reverse(seqs);
    3.66 -<                         embeddedSeqs = seqs.iterator();
    3.67 -<                         while (embeddedSeqs.hasNext()) {
    3.68 -<                             TokenSequence tseq = embeddedSeqs.next();
    3.69 -<                             if (tseq.language() == JavaTokenId.language()) {
    3.70 -<                                 ts = tseq;
    3.71 -<                                 break;
    3.72 -<                             }
    3.73 -<                         }
    3.74 -<                     }
    3.75 -< 
    3.76 -<                     while (ts != null && ts.offset() < offset) {
    3.77 -<                         if (!ts.moveNext()) {
    3.78 -<                             ts = null;
    3.79 -<                             if (embeddedSeqs == null) {
    3.80 -<                                 List<? extends TokenSequence> seqs = new ArrayList<TokenSequence>(embeddedTokenSequences(TokenHierarchy.get(doc), offset));
    3.81 -<                                 Collections.reverse(seqs);
    3.82 -<                                 embeddedSeqs = seqs.iterator();
    3.83 -<                             }
    3.84 -<                             while (embeddedSeqs.hasNext()) {
    3.85 -<                                 TokenSequence tseq = embeddedSeqs.next();
    3.86 -<                                 if (tseq.language() == JavaTokenId.language()) {
    3.87 -<                                     ts = tseq;
    3.88 -<                                     break;
    3.89 -<                                 }
    3.90 -<                             }
    3.91 -<                         }
    3.92 -<                     }
    3.93 -<                 }
    3.94 -<             }
    3.95 -<         });
    3.96 -177,178d120
    3.97 -<         doc.render(new Runnable() {
    3.98 -<             public void run() {
    3.99 -196c138
   3.100 -<                     if (name.equals(info.getTreeUtilities().decodeIdentifier(ts.token().text()).toString())) {
   3.101 ----
   3.102 ->                     if (name.equals(ts.token().text().toString())) {
   3.103 -202,203d143
   3.104 -<             }
   3.105 -<         });
   3.106 -207,208d146
   3.107 -<         doc.render(new Runnable() {
   3.108 -<             public void run() {
   3.109 -222c160
   3.110 -<                 if (t.id() == JavaTokenId.IDENTIFIER && tree.getName().toString().equals(info.getTreeUtilities().decodeIdentifier(t.text()).toString())) {
   3.111 ----
   3.112 ->                 if (t.id() == JavaTokenId.IDENTIFIER && tree.getName().toString().equals(t.text().toString())) {
   3.113 -228,229d165
   3.114 -<             }
   3.115 -<         });
   3.116 -233,234d168
   3.117 -<         doc.render(new Runnable() {
   3.118 -<             public void run() {
   3.119 -249,250d182
   3.120 -<                     offset = info.getSnapshot().getOriginalOffset(offset);
   3.121 -<                     
   3.122 -260,261d191
   3.123 -<             }
   3.124 -<         });
   3.125 -265,266d194
   3.126 -<         doc.render(new Runnable() {
   3.127 -<             public void run() {
   3.128 -279,298d206
   3.129 -<             }
   3.130 -<         });
   3.131 -<     }
   3.132 -<     
   3.133 -<     private static List<TokenSequence<?>> embeddedTokenSequences(TokenHierarchy<Document> th, int offset) {
   3.134 -<         TokenSequence<?> embedded = th.tokenSequence();
   3.135 -<         List<TokenSequence<?>> sequences = new ArrayList<TokenSequence<?>>();
   3.136 -< 
   3.137 -<         do {
   3.138 -<             TokenSequence<?> seq = embedded;
   3.139 -<             embedded = null;
   3.140 -< 
   3.141 -<             seq.move(offset);
   3.142 -<             if (seq.moveNext()) {
   3.143 -<                 sequences.add(seq);
   3.144 -<                 embedded = seq.embedded();
   3.145 -<             }
   3.146 -<         } while (embedded != null);
   3.147 -<         
   3.148 -<         return sequences;