Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
14,900
boolean (@NotNull PsiElement element, @NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) { return processor.execute(element, state) && ResolveUtil.processChildren(element, processor, state, lastParent, place); }
processDeclarations
14,901
SearchScope () { Project project = getProject(); return new GlobalSearchScope() { @Override public boolean contains(@NotNull VirtualFile file) { return PsiManager.getInstance(project).findFile(file) instanceof ShFile; } @Override public boolean isSearchInModuleContent(@NotNull Module aModule) { return true; } @Override public boolean isSearchInLibraries() { return false; } }; }
getUseScope
14,902
boolean (@NotNull VirtualFile file) { return PsiManager.getInstance(project).findFile(file) instanceof ShFile; }
contains
14,903
boolean (@NotNull Module aModule) { return true; }
isSearchInModuleContent
14,904
boolean () { return false; }
isSearchInLibraries
14,905
ItemPresentation () { final String text = UsageViewUtil.createNodeText(this); return new ItemPresentation() { @NotNull @Override public String getPresentableText() { return text; } @NotNull @Override public String getLocationString() { return getContainingFile().getName(); } @Nullable @Override public Icon getIcon(boolean b) { return ShCompositeElementImpl.this.getIcon(0); } }; }
getPresentation
14,906
String () { return text; }
getPresentableText
14,907
String () { return getContainingFile().getName(); }
getLocationString
14,908
Icon (boolean b) { return ShCompositeElementImpl.this.getIcon(0); }
getIcon
14,909
boolean (@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) { return ResolveUtil.processChildren(this, processor, state, lastParent, place); }
processDeclarations
14,910
String () { return getNode().getElementType().toString(); }
toString
14,911
String () { PsiElement word = getWord(); if (word != null) return word.getText(); return null; }
getName
14,912
int () { PsiElement word = getWord(); return word != null ? word.getTextOffset() : super.getTextOffset(); }
getTextOffset
14,913
PsiElement () { return findNotNullChildByType(LEFT_CURLY); }
getLeftCurly
14,914
PsiElement () { return findChildByElementType(RIGHT_CURLY); }
getRightCurly
14,915
boolean (@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) { List<ShSimpleCommandElement> commandsList = getSimpleCommandElementList(); if (commandsList.size() <= 0) return true; ShSimpleCommandElement simpleCommandElement = commandsList.get(0); PsiFile includedPsiFile = getReferencingFile(simpleCommandElement); if (includedPsiFile == null) return true; VirtualFile sourceFile = place.getContainingFile().getVirtualFile(); if (includedPsiFile.getVirtualFile().equals(sourceFile)) return true; return includedPsiFile.processDeclarations(processor, state, this, place); }
processDeclarations
14,916
int () { return getLiteral().getNode().getStartOffset(); }
getTextOffset
14,917
String () { PsiElement nameIdentifier = getNameIdentifier(); return nameIdentifier == null ? null : nameIdentifier.getText(); }
getName
14,918
PsiElement (@NotNull String name) { ElementManipulator<ShAssignmentCommand> manipulator = ElementManipulators.getManipulator(this); if (manipulator == null) return this; return manipulator.handleContentChange(this, name); }
setName
14,919
PsiElement () { return getLiteral(); }
getNameIdentifier
14,920
RunConfiguration (@NotNull Project project) { ShRunConfiguration configuration = new ShRunConfiguration(project, this, ShLanguage.INSTANCE.getID()); String defaultShell = getDefaultShell(project); configuration.setInterpreterPath(defaultShell); String projectPath = project.getBasePath(); if (projectPath != null) { configuration.setScriptWorkingDirectory(projectPath); } return configuration; }
createTemplateConfiguration
14,921
ShConfigurationType () { return ConfigurationTypeUtil.findConfigurationType(ShConfigurationType.class); }
getInstance
14,922
boolean () { return true; }
isEditableInDumbMode
14,923
String (@NotNull Project project) { ShDefaultShellPathProvider shellPathProvider = project.getService(ShDefaultShellPathProvider.class); if (shellPathProvider != null) { return shellPathProvider.getDefaultShell(); } else { return trivialDefaultShellDetection(); } }
getDefaultShell
14,924
String () { String shell = System.getenv("SHELL"); if (shell != null && new File(shell).canExecute()) { return shell; } if (SystemInfo.isUnix) { String bashPath = "/bin/bash"; if (new File(bashPath).exists()) { return bashPath; } return "/bin/sh"; } return "powershell.exe"; }
trivialDefaultShellDetection
14,925
String () { return "shRunRunner"; }
getRunnerId
14,926
boolean (@NotNull String executorId, @NotNull RunProfile profile) { return (DefaultRunExecutor.EXECUTOR_ID.equals(executorId) || DefaultDebugExecutor.EXECUTOR_ID.equals(executorId)) && profile instanceof ShRunConfiguration; }
canRun
14,927
void (@NotNull ShRunConfiguration configuration) { if (configuration.isExecuteScriptFile()) { myScriptFileRadioButton.setSelected(true); } else { myScriptTextRadioButton.setSelected(true); } selectMode(); // Configure UI for script text execution myScript.setText(configuration.getScriptText()); myScriptWorkingDirectory.setText(configuration.getScriptWorkingDirectory()); myExecuteScriptInTerminal.setSelected(configuration.isExecuteInTerminal()); myScriptEnvComponent.setEnvData(configuration.getEnvData()); // Configure script by path execution myScriptSelector.setText(configuration.getScriptPath()); myScriptOptions.setText(configuration.getScriptOptions()); myScriptFileWorkingDirectory.setText(configuration.getScriptWorkingDirectory()); myInterpreterSelector.setText(configuration.getInterpreterPath()); myInterpreterOptions.setText(configuration.getInterpreterOptions()); myExecuteFileInTerminal.setSelected(configuration.isExecuteInTerminal()); myEnvComponent.setEnvData(configuration.getEnvData()); }
resetEditorFrom
14,928
void (@NotNull ShRunConfiguration configuration) { configuration.setScriptText(myScript.getText()); // If we execute script by path, fill one components or other components if execute script text if (myScriptFileRadioButton.isSelected()) { configuration.setScriptWorkingDirectory(myScriptFileWorkingDirectory.getText()); configuration.setExecuteInTerminal(myExecuteFileInTerminal.isSelected()); configuration.setEnvData(myEnvComponent.getEnvData()); configuration.setExecuteScriptFile(true); } else { configuration.setScriptWorkingDirectory(myScriptWorkingDirectory.getText()); configuration.setExecuteInTerminal(myExecuteScriptInTerminal.isSelected()); configuration.setEnvData(myScriptEnvComponent.getEnvData()); configuration.setExecuteScriptFile(false); } configuration.setScriptPath(myScriptSelector.getText()); configuration.setScriptOptions(myScriptOptions.getText()); configuration.setInterpreterPath(myInterpreterSelector.getText()); configuration.setInterpreterOptions(myInterpreterOptions.getText()); }
applyEditorTo
14,929
JComponent () { return myPanel; }
createEditor
14,930
void () { boolean scriptExecutionSelected = myScriptFileRadioButton.isSelected(); myScriptFileRadioButton.setSelected(scriptExecutionSelected); myScriptPathPanel.setVisible(scriptExecutionSelected); myScriptTextRadioButton.setSelected(!scriptExecutionSelected); myScriptTextPanel.setVisible(!scriptExecutionSelected); }
selectMode
14,931
void (@NotNull AnActionEvent e) { PsiFile file = e.getData(CommonDataKeys.PSI_FILE); if (file == null) return; VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null) return; Project project = file.getProject(); ConfigurationContext context = ConfigurationContext.getFromContext(e.getDataContext(), e.getPlace()); ShRunConfigurationProducer configProducer = RunConfigurationProducer.getInstance(ShRunConfigurationProducer.class); RunnerAndConfigurationSettings configurationSettings = configProducer.findExistingConfiguration(context); ShRunConfiguration runConfiguration; if (configurationSettings == null) { configurationSettings = RunManager.getInstance(project).createConfiguration(file.getName(), ShConfigurationType.class); runConfiguration = (ShRunConfiguration)configurationSettings.getConfiguration(); runConfiguration.setScriptPath(virtualFile.getPath()); runConfiguration.setExecuteScriptFile(true); runConfiguration.setScriptWorkingDirectory(virtualFile.getParent().getPath()); if (file instanceof ShFile) { @NlsSafe String defaultShell = ShConfigurationType.getDefaultShell(project); String shebang = ShShebangParserUtil.getShebangExecutable((ShFile)file); if (shebang != null) { Pair<String, String> result = parseInterpreterAndOptions(shebang); runConfiguration.setInterpreterPath(result.first); runConfiguration.setInterpreterOptions(result.second); } else { runConfiguration.setInterpreterPath(defaultShell); } } else { runConfiguration.setInterpreterPath(""); } } else { runConfiguration = (ShRunConfiguration)configurationSettings.getConfiguration(); } ExecutionEnvironmentBuilder builder = ExecutionEnvironmentBuilder.createOrNull(DefaultRunExecutor.getRunExecutorInstance(), runConfiguration); if (builder != null) { ExecutionManager.getInstance(project).restartRunProfile(builder.build()); } }
actionPerformed
14,932
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(isEnabled(e)); }
update
14,933
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
14,934
boolean (@NotNull AnActionEvent e) { if (e.getProject() != null) { PsiFile file = e.getData(CommonDataKeys.PSI_FILE); if (file != null) { var runningProhibited = ContainerUtil.exists(ShRunnerAdditionalCondition.EP.getExtensionsIfPointIsRegistered(), runningCondition -> { return runningCondition.isRunningProhibitedForFile(file); }); if (runningProhibited) return false; if (file instanceof ShFile) return true; PsiElement firstChild = file.findElementAt(0); return firstChild instanceof PsiComment && firstChild.getText().startsWith("#!"); } } return false; }
isEnabled
14,935
RunProfileState (@NotNull Executor executor, @NotNull ExecutionEnvironment environment) { return new ShRunConfigurationProfileState(environment.getProject(), this); }
getState
14,936
void (@NotNull Element element) { super.writeExternal(element); JDOMExternalizerUtil.writeField(element, SCRIPT_TEXT_TAG, myScriptText); writePathWithMetadata(element, myScriptPath, SCRIPT_PATH_TAG); JDOMExternalizerUtil.writeField(element, SCRIPT_OPTIONS_TAG, myScriptOptions); writePathWithMetadata(element, myScriptWorkingDirectory, SCRIPT_WORKING_DIRECTORY_TAG); writePathWithMetadata(element, myInterpreterPath, INTERPRETER_PATH_TAG); JDOMExternalizerUtil.writeField(element, INTERPRETER_OPTIONS_TAG, myInterpreterOptions); JDOMExternalizerUtil.writeField(element, EXECUTE_IN_TERMINAL_TAG, String.valueOf(myExecuteInTerminal)); JDOMExternalizerUtil.writeField(element, EXECUTE_SCRIPT_FILE_TAG, String.valueOf(myExecuteScriptFile)); myEnvData.writeExternal(element); }
writeExternal
14,937
RefactoringElementListener (PsiElement element) { if (StringUtil.isEmpty(myScriptPath) || !(element instanceof ShFile) || !myScriptPath.equals(getPathByElement(element))) return null; return new RefactoringElementAdapter() { @Override protected void elementRenamedOrMoved(@NotNull PsiElement newElement) { if (newElement instanceof ShFile) { setScriptPath(((ShFile)newElement).getVirtualFile().getPath()); } } @Override public void undoElementMovedOrRenamed(@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { elementRenamedOrMoved(newElement); } }; }
getRefactoringElementListener
14,938
void (@NotNull PsiElement newElement) { if (newElement instanceof ShFile) { setScriptPath(((ShFile)newElement).getVirtualFile().getPath()); } }
elementRenamedOrMoved
14,939
void (@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { elementRenamedOrMoved(newElement); }
undoElementMovedOrRenamed
14,940
String (@NotNull PsiElement element) { VirtualFile vfile = PsiUtilCore.getVirtualFile(element); if (vfile == null) return null; return vfile.getPath(); }
getPathByElement
14,941
void (@NotNull Element element, @NotNull String path, @NotNull String pathTag) { String systemIndependentPath = FileUtil.toSystemIndependentName(path); JDOMExternalizerUtil.writeField(element, TAG_PREFIX + pathTag, Boolean.toString(systemIndependentPath.equals(path))); JDOMExternalizerUtil.writeField(element, pathTag, systemIndependentPath); }
writePathWithMetadata
14,942
String (@NotNull Element element, @NotNull String pathTag) { return Boolean.parseBoolean(JDOMExternalizerUtil.readField(element, TAG_PREFIX + pathTag)) ? readStringTagValue(element, pathTag) : toSystemDependentName(readStringTagValue(element, pathTag)); }
readPathWithMetadata
14,943
String (@NotNull Element element, @NotNull String tagName) { return notNullize(JDOMExternalizerUtil.readField(element, tagName), ""); }
readStringTagValue
14,944
String () { return myScriptText; }
getScriptText
14,945
void (String scriptText) { myScriptText = scriptText; }
setScriptText
14,946
String () { return myScriptPath; }
getScriptPath
14,947
void (@NotNull String scriptPath) { myScriptPath = scriptPath.trim(); }
setScriptPath
14,948
String () { return myScriptOptions; }
getScriptOptions
14,949
void (@NotNull String scriptOptions) { myScriptOptions = scriptOptions.trim(); }
setScriptOptions
14,950
String () { return myScriptWorkingDirectory; }
getScriptWorkingDirectory
14,951
void (String scriptWorkingDirectory) { myScriptWorkingDirectory = scriptWorkingDirectory.trim(); }
setScriptWorkingDirectory
14,952
boolean () { return myExecuteInTerminal; }
isExecuteInTerminal
14,953
void (boolean executeInTerminal) { myExecuteInTerminal = executeInTerminal; }
setExecuteInTerminal
14,954
boolean () { return myExecuteScriptFile; }
isExecuteScriptFile
14,955
void (boolean executeScriptFile) { myExecuteScriptFile = executeScriptFile; }
setExecuteScriptFile
14,956
EnvironmentVariablesData () { return myEnvData; }
getEnvData
14,957
void (EnvironmentVariablesData envData) { myEnvData = envData; }
setEnvData
14,958
String () { return myInterpreterPath; }
getInterpreterPath
14,959
void (@NotNull String interpreterPath) { myInterpreterPath = interpreterPath.trim(); }
setInterpreterPath
14,960
String () { return myInterpreterOptions; }
getInterpreterOptions
14,961
void (@NotNull String interpreterOptions) { myInterpreterOptions = interpreterOptions.trim(); }
setInterpreterOptions
14,962
WSLDistribution (@Nullable String interpreterPath, @Nullable @NlsSafe String scriptPath) { if (!WSLUtil.isSystemCompatible()) return null; if (EnvironmentUtil.getValue("SHELL") != null) return null; if (scriptPath != null && (scriptPath.endsWith("cmd") || scriptPath.endsWith("bat"))) return null; WslPath wslPath = interpreterPath != null ? WslPath.parseWindowsUncPath(interpreterPath) : null; if (wslPath == null && scriptPath != null) { wslPath = WslPath.parseWindowsUncPath(scriptPath); } return wslPath != null ? wslPath.getDistribution() : null; }
getWSLDistributionIfNeeded
14,963
ConfigurationFactory () { return ShConfigurationType.getInstance(); }
getConfigurationFactory
14,964
boolean (@NotNull ShRunConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { PsiFile psiFile = sourceElement.get().getContainingFile(); if (!(psiFile instanceof ShFile)) return false; FileViewProvider viewProvider = psiFile.getViewProvider(); if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) return false; VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null || virtualFile instanceof LightVirtualFile) return false; String defaultShell = ShConfigurationType.getDefaultShell(psiFile.getProject()); String shebang = ShShebangParserUtil.getShebangExecutable((ShFile)psiFile); if (shebang != null) { Pair<String, String> result = parseInterpreterAndOptions(shebang); configuration.setInterpreterPath(result.first); configuration.setInterpreterOptions(result.second); } else { configuration.setInterpreterPath(defaultShell); } configuration.setScriptWorkingDirectory(virtualFile.getParent().getPath()); configuration.setName(virtualFile.getPresentableName()); configuration.setScriptPath(virtualFile.getPath()); return true; }
setupConfigurationFromContext
14,965
boolean (@NotNull ShRunConfiguration configuration, @NotNull ConfigurationContext context) { PsiElement psiLocation = context.getPsiLocation(); if (psiLocation == null) return false; PsiFile psiFile = psiLocation.getContainingFile(); if (!(psiFile instanceof ShFile)) return false; FileViewProvider viewProvider = psiFile.getViewProvider(); if (viewProvider instanceof MultiplePsiFilesPerDocumentFileViewProvider) return false; VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) return false; String scriptPath = configuration.getScriptPath(); String workingDirectory = configuration.getScriptWorkingDirectory(); return scriptPath != null && scriptPath.equals(virtualFile.getPath()) && workingDirectory != null && workingDirectory.equals(virtualFile.getParent().getPath()); }
isConfigurationFromContext
14,966
Info (@NotNull PsiElement element) { if (element instanceof OuterLanguageElementImpl || !(element instanceof LeafElement ) || element.getTextRange().getStartOffset() != 0) return null; var contributionProhibited = ContainerUtil.exists(ShRunnerAdditionalCondition.EP.getExtensionsIfPointIsRegistered(), additionalCondition -> { return additionalCondition.isRunningProhibitedForElement(element); }); if (contributionProhibited) return null; PsiFile psiFile = element.getContainingFile(); if (!(psiFile instanceof ShFile) && !element.getText().startsWith("#!")) return null; AnAction[] actions = {ActionManager.getInstance().getAction(ShRunFileAction.ID)}; return new Info(AllIcons.RunConfigurations.TestState.Run, actions, psiElement -> StringUtil.join(ContainerUtil.mapNotNull(actions, action -> ShBundle .message("line.marker.run.0", psiElement.getContainingFile().getName())), "\n")); }
getInfo
14,967
boolean () { RunnerAndConfigurationSettings settings = RunManager.getInstance(myProject).findSettings(myRunConfiguration); return settings == null || settings.isActivateToolWindowBeforeRun() || settings.isFocusToolWindowBeforeRun(); }
isActivateToolWindow
14,968
GeneralCommandLine () { PtyCommandLine commandLine = new PtyCommandLine(); commandLine.withConsoleMode(false); commandLine.withInitialColumns(120); commandLine.withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE); commandLine.setWorkDirectory(myRunConfiguration.getScriptWorkingDirectory()); commandLine.withExePath(ShConfigurationType.getDefaultShell(myProject)); commandLine.withParameters("-c"); commandLine.withParameters(myRunConfiguration.getScriptText()); return commandLine; }
createCommandLineForScript
14,969
boolean () { Key<Boolean> userDataKey = ShBeforeRunProviderDelegate.getRunBeforeUserDataKey(myRunConfiguration); Boolean userDataValue = myProject.getUserData(userDataKey); boolean isRunBeforeConfig = userDataValue != null && userDataValue.booleanValue(); myRunConfiguration.getProject().putUserData(userDataKey, false); return isRunBeforeConfig; }
isRunBeforeConfig
14,970
String () { if (myRunConfiguration.isExecuteScriptFile()) { final WSLDistribution wslDistribution = ShRunConfiguration.getWSLDistributionIfNeeded(myRunConfiguration.getInterpreterPath(), myRunConfiguration.getScriptPath()); final List<String> commandLine = new ArrayList<>(); addIfPresent(commandLine, myRunConfiguration.getEnvData().getEnvs()); addIfPresent(commandLine, adaptPathForExecution(myRunConfiguration.getInterpreterPath(), wslDistribution)); addIfPresent(commandLine, myRunConfiguration.getInterpreterOptions()); commandLine.add(adaptPathForExecution(myRunConfiguration.getScriptPath(), wslDistribution)); addIfPresent(commandLine, myRunConfiguration.getScriptOptions()); return String.join(" ", commandLine); } else { List<String> commandLine = new ArrayList<>(); addIfPresent(commandLine, myRunConfiguration.getEnvData().getEnvs(), true); addIfPresent(commandLine, myRunConfiguration.getScriptText()); return String.join(" ", commandLine); } }
buildCommand
14,971
void (@NotNull List<String> commandLine, @Nullable String options) { ContainerUtil.addIfNotNull(commandLine, StringUtil.nullize(options)); }
addIfPresent
14,972
void (@NotNull List<String> commandLine, @NotNull Map<String, String> envs) { addIfPresent(commandLine, envs, false); }
addIfPresent
14,973
void (@NotNull List<String> commandLine, @NotNull Map<String, String> envs, boolean endWithSemicolon) { int index = 0; for (Map.Entry<String, String> entry : envs.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); String quotedString; if (Platform.current() != Platform.WINDOWS) { quotedString = ShStringUtil.quote(value); } else { String escapedValue = StringUtil.escapeQuotes(value); quotedString = StringUtil.containsWhitespaces(value) ? StringUtil.QUOTER.apply(escapedValue) : escapedValue; } if (endWithSemicolon) { String semicolon = ""; if (index == envs.size() - 1) semicolon = ";"; commandLine.add("export " + key + "=" + quotedString + semicolon); } else { commandLine.add(key + "=" + quotedString); } index++; } }
addIfPresent
14,974
String (@NotNull String systemDependentPath, @Nullable WSLDistribution wslDistribution) { if (wslDistribution != null) { return wslDistribution.getWslPath(systemDependentPath); } else { if (Platform.current() != Platform.WINDOWS) return ShStringUtil.quote(systemDependentPath); String escapedPath = StringUtil.escapeQuotes(systemDependentPath); return StringUtil.containsWhitespaces(systemDependentPath) ? StringUtil.QUOTER.apply(escapedPath) : escapedPath; } }
adaptPathForExecution
14,975
String (@NotNull String path, @Nullable WSLDistribution wslDistribution) { if (path.isEmpty()) return path; if (wslDistribution != null) { return wslDistribution.getWslPath(path); } return path; }
convertToWslIfNeeded
14,976
void (@NotNull ExecutionEnvironment environment) { RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); if (settings == null) { return; } RunConfiguration configuration = settings.getConfiguration(); if (configuration instanceof ShRunConfiguration) { Key<Boolean> userDataKey = getRunBeforeUserDataKey(configuration); configuration.getProject().putUserData(userDataKey, true); } }
beforeRun
14,977
Key<Boolean> (@NotNull RunConfiguration runConfiguration) { return KEY_MAP.computeIfAbsent(runConfiguration.getName(), key -> Key.create(SH_BEFORE_KEY_PREFIX + "_" + key)); }
getRunBeforeUserDataKey
14,978
TextRange (@NotNull Editor editor) { Caret caret = editor.getCaretModel().getPrimaryCaret(); if (caret.hasSelection()) { TextRange textRange = TextRange.create(caret.getSelectionStart(), caret.getSelectionEnd()); CharSequence subSequence = textRange.subSequence(editor.getDocument().getCharsSequence()); return StringUtil.isEmptyOrSpaces(subSequence) || StringUtil.contains(subSequence, "\n") ? null : textRange; } return SelectWordUtil.getWordSelectionRange(editor.getDocument().getImmutableCharSequence(), caret.getOffset(), ShTextOccurrencesUtil::isWordPartCondition); }
findTextRangeOfIdentifierAtCaret
14,979
boolean (char ch) { return ch == '_' || Character.isLetterOrDigit(ch); }
isWordPartCondition
14,980
Collection<TextRange> (@NotNull CharSequence documentText, @NotNull CharSequence textToFind, boolean matchExactWordsOnly) { CollectConsumer<TextRange> consumer = new CollectConsumer<>(); consumeAllOccurrences(documentText, textToFind, matchExactWordsOnly, consumer); return consumer.getResult(); }
findAllOccurrences
14,981
void (@NotNull CharSequence documentText, @NotNull CharSequence textToFind, boolean matchExactWordsOnly, Consumer<? super TextRange> consumer) { String pattern = textToFind.toString(); int length = pattern.length(); StringSearcher searcher = new StringSearcher(pattern, true, true); searcher.processOccurrences(documentText, value -> { TextRange tr = TextRange.create(value, value + length); if (matchExactWordsOnly && isWordExpandableOutside(documentText, tr)) return true; consumer.consume(tr); return true; }); }
consumeAllOccurrences
14,982
boolean (@NotNull CharSequence documentText, @NotNull Segment textRange) { if (textRange.getStartOffset() > 0) { char ch = documentText.charAt(textRange.getStartOffset() - 1); if (isWordPartCondition(ch)) { return true; } } if (textRange.getEndOffset() < documentText.length()) { char ch = documentText.charAt(textRange.getEndOffset()); return isWordPartCondition(ch); } return false; }
isWordExpandableOutside
14,983
List<PsiElement> () { return Collections.singletonList(myFile); }
getTargets
14,984
void (@NotNull List<? extends PsiElement> targets, @NotNull Consumer<? super List<? extends PsiElement>> selectionConsumer) { selectionConsumer.consume(targets); }
selectTargets
14,985
void (@NotNull List<? extends PsiElement> targets) { TextRange textRange = ShTextOccurrencesUtil.findTextRangeOfIdentifierAtCaret(myEditor); if (textRange != null) { CharSequence documentText = StringUtil.newBombedCharSequence(myEditor.getDocument().getImmutableCharSequence(), 3000); boolean hasSelection = myEditor.getCaretModel().getPrimaryCaret().hasSelection(); ShTextOccurrencesUtil.consumeAllOccurrences( documentText, textRange.subSequence(documentText), !hasSelection, range -> myReadUsages.add(InjectedLanguageManager.getInstance(myFile.getProject()).injectedToHost(myFile, range))); } }
computeUsages
14,986
ASTNode () { return createNode(null); }
createCompositeNode
14,987
ASTNode (CharSequence text) { return new ShBlockImpl(this, text); }
createNode
14,988
boolean (@NotNull CharSequence buffer, @NotNull Language fileLanguage, @NotNull Project project) { return PsiBuilderUtil.hasProperBraceBalance(buffer, new ShLexer(), LEFT_CURLY, RIGHT_CURLY); }
isParsable
14,989
void (CharSequence buffer, int start, int end, int initialState) { onReset(); super.reset(buffer, start, end, initialState); }
reset
14,990
MergeFunction () { return FUNCTION; }
getMergeFunction
14,991
void (@NotNull Lexer lexer, @NotNull IElementType condition) { IElementType current = lexer.getTokenType(); while (current == condition) { lexer.advance(); current = lexer.getTokenType(); } }
advanceLexerWhile
14,992
ASTNode () { return createNode(null); }
createCompositeNode
14,993
ASTNode (CharSequence text) { return new ShDoBlockImpl(this, text); }
createNode
14,994
boolean (@NotNull CharSequence buffer, @NotNull Language fileLanguage, @NotNull Project project) { return PsiBuilderUtil.hasProperBraceBalance(buffer, new ShLexer(), DO, DONE); }
isParsable
14,995
CodeStyleConfigurable (@NotNull CodeStyleSettings settings, @NotNull CodeStyleSettings modelSettings) { return new CodeStyleAbstractConfigurable(settings, modelSettings, getLanguage().getID()) { @Override protected @NotNull CodeStyleAbstractPanel createPanel(final @NotNull CodeStyleSettings settings) { return new ShCodeStylePanel(settings, modelSettings); } }; }
createConfigurable
14,996
CodeStyleAbstractPanel (final @NotNull CodeStyleSettings settings) { return new ShCodeStylePanel(settings, modelSettings); }
createPanel
14,997
void (@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.INDENT_SETTINGS) { consumer.showStandardOptions("INDENT_SIZE", "USE_TAB_CHARACTER", "TAB_SIZE"); } }
customizeSettings
14,998
String (@NotNull SettingsType settingsType) { return ""; }
getCodeSample
14,999
Language () { return ShLanguage.INSTANCE; }
getLanguage