Community
Participate
Working Groups
3.1 M3 I fixed a typo (added 'i') in the Javadoc of AdditionalInfoController2.fStartSignal (rev. 1.5). Comparing (CVS and local history) does not select the word but the full Javadoc (from /** to */).
Same is true for strings inside Java code: both strings are selected instead of just the change inside the string.
will anything be happening here for 3.2?
I'll try to fix this for 3.2.
*** Bug 152977 has been marked as a duplicate of this bug. ***
This is caused by the JavaTokenComparator provided by JDT/UI, which provides the entire body of the comment as a single token. The JavaTokenComparator uses a scanner that is created using JDT core API. It would be helpful is someone from JDT/UI could take a look at this and offer advice on how to proceed ;-)
The scanner does not go into comments i.e. each comment is just one token. If a comment is detected the JavaTokenComparator should go into the comment and return tokens as TokenComparator does.
And how would I know it is a comment? It doesn't appear that the IScanner API provides any hint as to what the token represents.
See IScanner.getNextToken() and ITerminalSymbols. TokenNameCOMMENT_LINE TokenNameCOMMENT_BLOCK TokenNameCOMMENT_JAVADOC
Created attachment 64308 [details] Patch to parse text in a one line comment This patch fixes the one line comment case and also adds token highlighting for portions of the text that couldn't be scanned.
Moving to JDT/UI to consider patch.
Let me take this ;-)
I slightly modified the patch and committed it to HEAD.
Michael, using again the Java tokenizer to tokenize the comment could lead to strange results (e.g. if the comment is just code). Markus will change this to use the text tokenizer and also add code to go into strings.
I was going to use the text tokenizer but it isn't API. You could either use the internal class or refactor the code so you can get it from the JavaMergeViewer superclass. Sorry but I forgot about the string case but it should be the same as the others.
(In reply to comment #13) Released to HEAD and filed bug 183224 to make TokenComparator API. Falling back to JavaTokenComparator in cases where no TextMergeViewer is available.
Verified in I20070503-1400.