mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add isAsync method to PyWithStatement
This commit is contained in:
committed by
Semyon Proshev
parent
437d7ad5fc
commit
f54070028a
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,4 +20,6 @@ package com.jetbrains.python.psi;
|
||||
*/
|
||||
public interface PyWithStatement extends PyStatement, PyNamedElementContainer, PyStatementListContainer {
|
||||
PyWithItem[] getWithItems();
|
||||
|
||||
boolean isAsync();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import com.intellij.psi.PsiNamedElement;
|
||||
import com.intellij.psi.tree.TokenSet;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.jetbrains.python.PyElementTypes;
|
||||
import com.jetbrains.python.PyTokenTypes;
|
||||
import com.jetbrains.python.psi.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -75,4 +76,9 @@ public class PyWithStatementImpl extends PyElementImpl implements PyWithStatemen
|
||||
assert statementList != null : "Statement list missing for with statement " + getText();
|
||||
return statementList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAsync() {
|
||||
return getNode().findChildByType(PyTokenTypes.ASYNC_KEYWORD) != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user