diff --git a/python/src/com/jetbrains/python/codeInsight/userSkeletons/PyUserSkeletonsUtil.java b/python/src/com/jetbrains/python/codeInsight/userSkeletons/PyUserSkeletonsUtil.java index da0ad54784d0..2d0fd8d42868 100644 --- a/python/src/com/jetbrains/python/codeInsight/userSkeletons/PyUserSkeletonsUtil.java +++ b/python/src/com/jetbrains/python/codeInsight/userSkeletons/PyUserSkeletonsUtil.java @@ -17,6 +17,7 @@ package com.jetbrains.python.codeInsight.userSkeletons; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; @@ -53,7 +54,10 @@ import java.util.List; */ public class PyUserSkeletonsUtil { public static final String USER_SKELETONS_DIR = "python-skeletons"; + private static final Logger LOG = Logger.getInstance("#com.jetbrains.python.codeInsight.userSkeletons.PyUserSkeletonsUtil"); + @Nullable private static VirtualFile ourUserSkeletonsDirectory; + private static boolean ourNoSkeletonsErrorReported = false; @NotNull private static List getPossibleUserSkeletonsPaths() { @@ -75,6 +79,10 @@ public class PyUserSkeletonsUtil { } } } + if (!ourNoSkeletonsErrorReported && ourUserSkeletonsDirectory == null) { + ourNoSkeletonsErrorReported = true; + LOG.error("python-skeletons directory not found in paths: " + getPossibleUserSkeletonsPaths()); + } return ourUserSkeletonsDirectory; } diff --git a/python/src/com/jetbrains/python/lexer/PyStringLiteralLexer.java b/python/src/com/jetbrains/python/lexer/PyStringLiteralLexer.java index 10c8c9be41cb..4ed6435982c7 100644 --- a/python/src/com/jetbrains/python/lexer/PyStringLiteralLexer.java +++ b/python/src/com/jetbrains/python/lexer/PyStringLiteralLexer.java @@ -57,7 +57,6 @@ public class PyStringLiteralLexer extends LexerBase { */ public PyStringLiteralLexer(final IElementType originalLiteralToken) { myOriginalLiteralToken = originalLiteralToken; - myIsTriple = PyTokenTypes.TRIPLE_NODES.contains(myOriginalLiteralToken); } public void start(@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) { @@ -85,6 +84,8 @@ public class PyStringLiteralLexer extends LexerBase { assert (c == '"') || (c == '\'') : "String must be quoted by single or double quote. Found '" + c + "' in string " + buffer; myQuoteChar = c; + myIsTriple = (buffer.length() > i + 2) && (buffer.charAt(i + 1) == c) && (buffer.charAt(i + 2) == c); + // calculate myEnd at last myEnd = locateToken(myStart); } diff --git a/python/src/com/jetbrains/python/psi/impl/PyBuiltinCache.java b/python/src/com/jetbrains/python/psi/impl/PyBuiltinCache.java index 64382fa698dd..b545290c13c6 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyBuiltinCache.java +++ b/python/src/com/jetbrains/python/psi/impl/PyBuiltinCache.java @@ -172,7 +172,7 @@ public class PyBuiltinCache { } public boolean isValid() { - return myBuiltinsFile == null || myBuiltinsFile.isValid(); + return myBuiltinsFile != null && myBuiltinsFile.isValid(); } /**