avoid spellchecker messages duplication in js documentation comments (which are due...
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 2 Dec 2009 15:23:45 +0000 (18:23 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 2 Dec 2009 15:23:45 +0000 (18:23 +0300)
plugins/spellchecker/src/com/intellij/spellchecker/tokenizer/CommentTokenizer.java
plugins/spellchecker/testData/inspection/js/test.js

index 5dd93586102df469622f0fad7ca7bb4c0bd77f1b..a9b47f0964bfdab28462c1fe88b79f377be8c1c3 100644 (file)
@@ -29,6 +29,8 @@ public class CommentTokenizer extends Tokenizer<PsiComment> {
   @Nullable
   @Override
   public Token[] tokenize(@NotNull PsiComment element) {
+    // doccomment chameleon expands as PsiComment inside PsiComment, avoid duplication
+    if (element.getParent() instanceof PsiComment) return null;
     return new Token[]{new Token<PsiComment>(element, element.getText(),false)};
   }
 
index 5c0f3b3d8c919247b2b6ecf87b70d359636118ae..5fc21c9c9e70f0bd89c4f9c08416ecbf6a891012 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 /*some <TYPO descr="Typo: In word 'commments'">commments</TYPO> */
+/**some <TYPO descr="Typo: In word 'commments'">commments</TYPO> */
 function  test<TYPO descr="Typo: In word 'Fuunction'">Fuunction</TYPO>(){
   var <TYPO descr="Typo: In word 'upddate'">upddate</TYPO> = "test variable";
 }