mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
Binary file not shown.
@@ -53,13 +53,7 @@ static DWORD _ConnectIfNeededPipe(DWORD nParentPid, DWORD nDescriptor, FILE* str
|
||||
if (!SetHandleInformation(hPipe, HANDLE_FLAG_INHERIT, TRUE))
|
||||
{
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
// Fix CRT
|
||||
if (_dup2(_open_osfhandle((intptr_t)hPipe, _O_WTEXT | _O_TEXT), _fileno(stream)) != 0)
|
||||
{
|
||||
return errno;
|
||||
}
|
||||
}
|
||||
|
||||
// Fix Win32API
|
||||
DWORD hStdHandleToChange = ELEV_DESCR_GET_HANDLE(nDescriptor);
|
||||
|
||||
@@ -30,7 +30,9 @@ import com.intellij.psi.search.PsiElementProcessor.FindElement;
|
||||
import com.intellij.psi.stubs.StubBase;
|
||||
import com.intellij.psi.stubs.StubElement;
|
||||
import com.intellij.psi.templateLanguages.OuterLanguageElement;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.PairProcessor;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -661,6 +663,32 @@ public class PsiTreeUtil {
|
||||
return (T)element;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PsiElement findSiblingForward(@NotNull final PsiElement element,
|
||||
@NotNull final IElementType elementType,
|
||||
@Nullable final Consumer<PsiElement> consumer) {
|
||||
for (PsiElement e = element.getNextSibling(); e != null; e = e.getNextSibling()) {
|
||||
if (elementType.equals(e.getNode().getElementType())) {
|
||||
return e;
|
||||
}
|
||||
if (consumer != null) consumer.consume(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PsiElement findSiblingBackward(@NotNull final PsiElement element,
|
||||
@NotNull final IElementType elementType,
|
||||
@Nullable final Consumer<PsiElement> consumer) {
|
||||
for (PsiElement e = element.getPrevSibling(); e != null; e = e.getPrevSibling()) {
|
||||
if (elementType.equals(e.getNode().getElementType())) {
|
||||
return e;
|
||||
}
|
||||
if (consumer != null) consumer.consume(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null, _ -> null")
|
||||
public static PsiElement skipSiblingsForward(@Nullable PsiElement element, @NotNull Class... elementClasses) {
|
||||
|
||||
Reference in New Issue
Block a user