mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
parser-based completion 1 (single item)
This commit is contained in:
@@ -29,6 +29,7 @@ import com.intellij.psi.PsiErrorElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.TokenType;
|
||||
import com.intellij.psi.impl.source.CharTableImpl;
|
||||
import com.intellij.psi.impl.source.resolve.FileContextUtil;
|
||||
import com.intellij.psi.impl.source.text.BlockSupportImpl;
|
||||
import com.intellij.psi.impl.source.text.DiffLog;
|
||||
import com.intellij.psi.impl.source.tree.*;
|
||||
@@ -1504,6 +1505,7 @@ public class PsiBuilderImpl extends UserDataHolderBase implements PsiBuilder {
|
||||
|
||||
@Override
|
||||
public <T> T getUserDataUnprotected(@NotNull final Key<T> key) {
|
||||
if (key == FileContextUtil.CONTAINING_FILE_KEY) return (T)myFile;
|
||||
//noinspection unchecked
|
||||
return myUserData != null ? (T)myUserData.get(key) : null;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class FileContextUtil {
|
||||
public static final Key<SmartPsiElementPointer> INJECTED_IN_ELEMENT = Key.create("injectedIn");
|
||||
public static final Key<PsiFile> CONTAINING_FILE_KEY = Key.create("CONTAINING_FILE_KEY");
|
||||
|
||||
private FileContextUtil() { }
|
||||
|
||||
|
||||
@@ -614,7 +614,8 @@ public class StringUtil {
|
||||
|
||||
@NotNull
|
||||
public static String unquoteString(@NotNull String s) {
|
||||
if (s.length() <= 1 || s.charAt(0) != '"' || s.charAt(s.length() - 1) != '"') {
|
||||
char c;
|
||||
if (s.length() <= 1 || (c = s.charAt(0)) != '"' && c != '\'' || s.charAt(s.length() - 1) != c) {
|
||||
return s;
|
||||
}
|
||||
return s.substring(1, s.length() - 1);
|
||||
|
||||
Reference in New Issue
Block a user