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;
}
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();
}
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);
}
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;
}
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;
}
Aggregations