mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
IDEA-337778 Added telemetry for regexp file lexing and parsing
GitOrigin-RevId: 36c68cc540a5a4185777a7c6d1fb039e0ba01db4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f396a66c51
commit
7d28c0e200
@@ -1,8 +1,9 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.intellij.lang.regexp;
|
||||
|
||||
import com.intellij.lang.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.ParsingDiagnostics;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
@@ -26,8 +27,11 @@ public class RegExpFileElementType extends IFileElementType {
|
||||
RegExpLexer lexer = definition.createLexer(project, capabilities);
|
||||
PsiParser parser = definition.createParser(project, capabilities);
|
||||
PsiBuilder builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, lexer, languageForParser, chameleon.getChars());
|
||||
var startTime = System.nanoTime();
|
||||
((LightPsiParser)parser).parseLight(this, builder);
|
||||
return builder.getTreeBuilt().getFirstChildNode();
|
||||
var result = builder.getTreeBuilt().getFirstChildNode();
|
||||
ParsingDiagnostics.registerParse(builder, getLanguage(), System.nanoTime() - startTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user