Search in sources :

Example 61 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class YAMLElementGenerator method createColon.

@NotNull
public PsiElement createColon() {
    final YAMLFile file = createDummyYamlWithText("? foo : bar");
    final PsiElement at = file.findElementAt("? foo ".length());
    assert at != null && at.getNode().getElementType() == YAMLTokenTypes.COLON;
    return at;
}
Also used : YAMLFile(org.jetbrains.yaml.psi.YAMLFile) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Example 62 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class YAMLElementGenerator method createSpace.

@NotNull
public PsiElement createSpace() {
    final YAMLKeyValue keyValue = createYamlKeyValue("foo", "bar");
    final ASTNode whitespaceNode = keyValue.getNode().findChildByType(TokenType.WHITE_SPACE);
    assert whitespaceNode != null;
    return whitespaceNode.getPsi();
}
Also used : YAMLKeyValue(org.jetbrains.yaml.psi.YAMLKeyValue) ASTNode(com.intellij.lang.ASTNode) NotNull(org.jetbrains.annotations.NotNull)

Example 63 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class PyConsoleSpecificOptionsPanel method createDocument.

@NotNull
public static Document createDocument(@NotNull final Project project, @NotNull String text) {
    text = text.trim();
    final PyExpressionCodeFragmentImpl fragment = new PyExpressionCodeFragmentImpl(project, "start_script.py", text, true);
    return PsiDocumentManager.getInstance(project).getDocument(fragment);
}
Also used : PyExpressionCodeFragmentImpl(com.jetbrains.python.psi.impl.PyExpressionCodeFragmentImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 64 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class PyConsoleUtil method getOrCreateIPythonData.

@NotNull
public static PythonConsoleData getOrCreateIPythonData(@NotNull VirtualFile file) {
    PythonConsoleData consoleData = file.getUserData(PYTHON_CONSOLE_DATA);
    if (consoleData == null) {
        consoleData = new PythonConsoleData();
        file.putUserData(PYTHON_CONSOLE_DATA, consoleData);
    }
    return consoleData;
}
Also used : PythonConsoleData(com.jetbrains.python.console.parsing.PythonConsoleData) NotNull(org.jetbrains.annotations.NotNull)

Example 65 with NotNull

use of org.jetbrains.annotations.NotNull in project intellij-community by JetBrains.

the class PydevConsoleRunnerImpl method doCreateConsoleCmdLine.

@NotNull
protected GeneralCommandLine doCreateConsoleCmdLine(Sdk sdk, Map<String, String> environmentVariables, String workingDir, int[] ports, PythonHelper helper) {
    GeneralCommandLine cmd = PythonCommandLineState.createPythonCommandLine(myProject, new PythonConsoleRunParams(myConsoleSettings, workingDir, sdk, environmentVariables), false, PtyCommandLine.isEnabled() && !SystemInfo.isWindows);
    cmd.withWorkDirectory(myWorkingDir);
    ParamsGroup group = cmd.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_SCRIPT);
    helper.addToGroup(group, cmd);
    for (int port : ports) {
        group.addParameter(String.valueOf(port));
    }
    return cmd;
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)8141 VirtualFile (com.intellij.openapi.vfs.VirtualFile)888 ArrayList (java.util.ArrayList)809 PsiElement (com.intellij.psi.PsiElement)764 Project (com.intellij.openapi.project.Project)647 File (java.io.File)627 Nullable (org.jetbrains.annotations.Nullable)518 List (java.util.List)400 PsiFile (com.intellij.psi.PsiFile)358 Module (com.intellij.openapi.module.Module)336 IOException (java.io.IOException)325 TextRange (com.intellij.openapi.util.TextRange)260 Document (com.intellij.openapi.editor.Document)173 ContainerUtil (com.intellij.util.containers.ContainerUtil)173 BasePhpElementVisitor (com.kalessil.phpStorm.phpInspectionsEA.openApi.BasePhpElementVisitor)169 ASTNode (com.intellij.lang.ASTNode)167 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)167 Map (java.util.Map)156 java.util (java.util)154 IElementType (com.intellij.psi.tree.IElementType)146