/*
 * Copyright 2000-2013 JetBrains s.r.o.
 * Copyright 2014-2014 AS3Boyan
 * Copyright 2014-2014 Elias Ku
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.plugins.haxe.lang.parser;

import com.intellij.lang.ASTFactory;
import com.intellij.psi.impl.source.tree.CompositeElement;
import com.intellij.psi.impl.source.tree.LazyParseableElement;
import com.intellij.psi.impl.source.tree.LeafElement;
import com.intellij.psi.impl.source.tree.java.PsiJavaTokenImpl;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.ILazyParseableElementType;
import org.jetbrains.annotations.Nullable;

/**
 * Created by ebishton on 10/24/14.
 */
public class HaxeAstFactory extends ASTFactory {

  // Default implementations of the base class return null, which
  // forces the DefaultFactoryHolder.DEFAULT factory to be used.
  // (Meaning things get created anyway.)  Since that's the normal
  // functionality, it's fine for most things.

  public HaxeAstFactory() {
    super();
  }

  @Nullable
  @Override
  public LazyParseableElement createLazy(ILazyParseableElementType type, CharSequence text) {
    return super.createLazy(type, text);
  }

  @Nullable
  @Override
  public CompositeElement createComposite(IElementType type) {
    return super.createComposite(type);
  }

  @Nullable
  @Override
  public LeafElement createLeaf(IElementType type, CharSequence text) {
    // We're making our default token type be a PsiJavaToken so that our
    // PSI tree is more compatible with the Java one, thus, we can use
    // more of the Java code without doing so much work.

    return new PsiJavaTokenImpl(type, text);
  }
}

@@ -743,16 +743,79 @@
 actory;%0A
+import com.intellij.plugins.haxe.lang.lexer.HaxeTokenTypeSets;%0A
 import c
@@ -974,32 +974,89 @@
 ee.LeafElement;%0A
+import com.intellij.psi.impl.source.tree.PsiCommentImpl;%0A
 import com.intel
@@ -2226,16 +2226,121 @@
  work.%0A%0A
+    if (HaxeTokenTypeSets.COMMENTS.contains(type)) %7B%0A      return new PsiCommentImpl(type, text);%0A    %7D%0A%0A
     retu

Fix uncomment multiple lines of code feature by changing token type to PsiCommentImpl from PsiJavaToken https://github.com/TiVo/intellij-haxe/issues/209