Skip to content

Commit

Permalink
editor: fi "redundant character escape" warning #243
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsh committed Nov 10, 2020
1 parent dac35a9 commit 8d1b8ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/META-INF/plugin-java.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<extensions defaultExtensionNs="com.intellij">
<projectService serviceInterface="org.intellij.grammar.java.JavaHelper" serviceImplementation="org.intellij.grammar.java.JavaHelper$PsiHelper"/>
<referencesSearch implementation="org.intellij.jflex.psi.impl.JFlexStateUsageSearcher"/>
<regExpLanguageHost forClass="org.intellij.grammar.psi.impl.BnfStringImpl" implementationClass="com.intellij.psi.impl.JavaRegExpHost"/>
<regExpLanguageHost forClass="org.intellij.grammar.psi.impl.BnfStringImpl" implementationClass="org.intellij.grammar.psi.impl.BnfStringRegexHost"/>
</extensions>
<actions>
<action id="grammar.Generate.ParserUtil" class="org.intellij.grammar.actions.BnfGenerateParserUtilAction" text="Generate Parser Util">
Expand Down
17 changes: 17 additions & 0 deletions src/org/intellij/grammar/psi/impl/BnfStringRegexHost.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2011-2020 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.
*/

package org.intellij.grammar.psi.impl;

import com.intellij.psi.impl.JavaRegExpHost;

/**
* @author gregsh
*/
public class BnfStringRegexHost extends JavaRegExpHost {
@Override
public boolean characterNeedsEscaping(char c) {
return c == '\"' || super.characterNeedsEscaping(c);
}
}

0 comments on commit 8d1b8ab

Please sign in to comment.