package org.jetbrains.plugins.ipnb.psi;

import com.intellij.lang.PsiParser;
import com.intellij.lexer.Lexer;
import com.intellij.openapi.project.Project;
import com.intellij.psi.tree.IFileElementType;
import com.jetbrains.python.PythonParserDefinition;
import com.jetbrains.python.lexer.PythonIndentingLexer;
import org.jetbrains.annotations.NotNull;

public class IpnbPyParserDefinition extends PythonParserDefinition {
  public static final IFileElementType IPNB_PYTHON_FILE = new IpnbPyFileElementType(IpnbPyLanguageDialect.getInstance());

  @NotNull
  public Lexer createLexer(Project project) {
    return new PythonIndentingLexer();
  }

  @NotNull
  @Override
  public PsiParser createParser(Project project) {
    return new IpnbPyParser();
  }

  @Override
  public IFileElementType getFileNodeType() {
    return IPNB_PYTHON_FILE;
  }
}

@@ -279,29 +279,37 @@
 hon.
-lexer.PythonIndenting
+console.parsing.PythonConsole
 Lexe
@@ -628,17 +628,15 @@
 thon
-Indenting
+Console
 Lexe

fix PY-14139 IPython Notebook: bad character: false positive for command line tools execution from code cell