Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
27,700
int () { return Objects.hash(start, end); }
hashCode
27,701
String () { return "TextMateRange[" + start + ", " + end + ']'; }
toString
27,702
boolean () { if (currentPosition < 0) { return false; } final int searchResult = myMatcher.search(currentPosition, myStringBytes.length, Option.CAPTURE_GROUP); if (searchResult > -1) { setCurrentPosition(myMatcher.getEagerRegion().getEnd(0)); } else { setCurrentPosition(searchResult); } return currentPosition > -1; }
search
27,703
void (int currentPosition) { this.currentPosition = currentPosition; currentCharPosition = currentPosition > 0 ? RegexUtil.codePointOffsetByByteOffset(myStringBytes, currentPosition) : currentPosition; }
setCurrentPosition
27,704
int () { return currentCharPosition; }
getCurrentCharPosition
27,705
MatchData () { return MatchData.fromRegion(myMatcher.getEagerRegion()); }
getCurrentMatchData
27,706
void (String[] args) { ilServer server = null; BasicConfigurator.configure(); logger.setLevel(Level.INFO); Logger root = Logger.getLogger("org"); root.setLevel(Level.OFF); server = new ilServer(args); server.handleRequest(); }
main
27,707
boolean () { if(arguments.length < 1) { logger.error(getUsage()); return false; } if(arguments.length == 1) { command = arguments[0]; if(command.compareTo("version") == 0) { System.out.println("ILIAS java server version \"" + version + "\""); return true; } } command = arguments[1]; if(command.compareTo("start") == 0) { if(arguments.length != 2) { logger.error("Usage: java -jar ilServer.jar PATH_TO_SERVER_INI start"); return false; } return startServer(); } else if(command.compareTo("stop") == 0) { if(arguments.length != 2) { logger.error("Usage: java -jar ilServer.jar PATH_TO_SERVER_INI stop"); return false; } return stopServer(); } else if(command.compareTo("createIndex") == 0) { if(arguments.length != 3) { logger.error("Usage java -jar ilServer.jar PATH_TO_SERVER_INI createIndex CLIENT_KEY"); return false; } return createIndexer(); } else if(command.compareTo("updateIndex") == 0) { if(arguments.length < 3) { logger.error("Usage java -jar ilServer.jar PATH_TO_SERVER_INI updateIndex CLIENT_KEY"); return false; } return updateIndexer(); } else if(command.compareTo("search") == 0) { if(arguments.length != 4) { logger.error("Usage java -jar ilServer.jar PATH_TO_SERVER_INI CLIENT_KEY search QUERY_STRING"); return false; } return startSearch(); } else if(command.compareTo("status") == 0) { if(arguments.length != 2) { logger.error("Usage java -jar ilServer.jar PATH_TO_SERVER_INI status"); return false; } return getStatus(); } else { logger.error(getUsage()); return false; } }
handleRequest
27,708
boolean () { XmlRpcClient client; IniFileParser parser; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],true); if(!ClientSettings.exists(arguments[2])) { throw new ConfigurationException("Unknown client given: " + arguments[2]); } client = initRpcClient(); Vector params = new Vector(); params.add(arguments[2]); params.add(false); client.execute("RPCIndexHandler.index",params); return true; } catch (Exception e) { System.err.println(e); logger.fatal(e.getMessage()); System.exit(1); } return false; }
createIndexer
27,709
boolean () { XmlRpcClient client; IniFileParser parser; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],true); if(!ClientSettings.exists(arguments[2])) { throw new ConfigurationException("Unknown client given: " + arguments[2]); } client = initRpcClient(); Vector params = new Vector(); params.add(arguments[2]); params.add(true); client.execute("RPCIndexHandler.index",params); return true; } catch (Exception e) { System.err.println(e); logger.fatal(e.getMessage()); System.exit(1); } return false; }
updateIndexer
27,710
boolean () { XmlRpcClient client; IniFileParser parser; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],true); if(!ClientSettings.exists(arguments[2])) { throw new ConfigurationException("Unknown client given: " + arguments[2]); } client = initRpcClient(); Vector params = new Vector(); params.add(arguments[2]); params.add(arguments[3]); params.add(1); String response = (String) client.execute("RPCSearchHandler.search",params); System.out.println(response); return true; } catch (Exception e) { System.err.println(e); logger.fatal(e.getMessage()); System.exit(1); } return false; }
startSearch
27,711
boolean () { ServerSettings settings; RPCServer rpc; XmlRpcClient client; IniFileParser parser; String status; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],true); client = initRpcClient(); // Check if server is already running try { status = (String) client.execute("RPCAdministration.status",new Vector()); System.err.println("Server already started. Aborting"); System.exit(1); } catch(XmlRpcException e) { logger.info("No server running. Starting new instance..."); } settings = ServerSettings.getInstance(); logger.info("New rpc server"); rpc = RPCServer.getInstance(settings.getHost(),settings.getPort()); logger.info("Server start"); rpc.start(); client = initRpcClient(); client.execute("RPCAdministration.start",new Vector()); // Check if webserver is alive // otherwise stop execution while(true) { Thread.sleep(3000); if(!rpc.isAlive()) { rpc.shutdown(); break; } } logger.info("WebServer shutdown. Aborting..."); return true; } catch (ConfigurationException e) { //logger.error(e); System.exit(1); return false; } catch (InterruptedException e) { logger.error("VM did not allow to sleep. Aborting!"); } catch (XmlRpcException e) { System.out.println("Error starting server: " + e); System.exit(1); } catch (IOException e) { logger.error("IOException " + e.getMessage()); } catch (Exception e) { logger.error("IOException " + e.getMessage()); } catch(Throwable e) { logger.error("IOException " + e.getMessage()); } return false; }
startServer
27,712
boolean () { XmlRpcClient client; IniFileParser parser; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],false); client = initRpcClient(); client.execute("RPCAdministration.stop",new Vector()); return true; } catch (ConfigurationException e) { logger.error("Configuration " + e.getMessage()); } catch (XmlRpcException e) { logger.error("XMLRPC " + e.getMessage()); } catch (IOException e) { logger.error("IOException " + e.getMessage()); } return false; }
stopServer
27,713
boolean () { XmlRpcClient client; IniFileParser parser; ServerSettings settings; String status; try { parser = new IniFileParser(); parser.parseServerSettings(arguments[0],false); settings = ServerSettings.getInstance(); client = initRpcClient(); status = (String) client.execute("RPCAdministration.status",new Vector()); System.out.println(status); return true; } catch (ConfigurationException e) { logger.error("Configuration " + e.getMessage()); } catch (XmlRpcException e) { System.out.println(ilServerStatus.STOPPED); System.exit(1); } catch (IOException e) { System.out.println(ilServerStatus.STOPPED); System.exit(1); } return false; }
getStatus
27,714
String () { return "Usage: java -jar ilServer.jar PATH_TO_SERVER_INI start|stop|createIndex|updateIndex|search PARAMS"; }
getUsage
27,715
String () { return ""; }
getTestPath
27,716
String () { return "/plugins/textmate/tests/org/jetbrains/plugins/textmate" + getTestPath(); }
getBasePath
27,717
boolean () { return true; }
isCommunity
27,718
String () { return TestUtil.HTML_VSC; }
getBundleName
27,719
List<String> () { return Collections.singletonList(TestUtil.CSS_VSC); }
getExtraBundleNames
27,720
String () { return "html_vsc"; }
getTestDirRelativePath
27,721
List<Object[]> () { return Collections.emptyList(); }
params
27,722
void () { mySyntaxTable = new TextMateSyntaxTable(); CharSequence scope = null; Iterator<TextMateGrammar> grammars = TestUtil.readBundle(getBundleName()).readGrammars().iterator(); while (grammars.hasNext()) { TextMateGrammar grammar = grammars.next(); CharSequence rootScope = mySyntaxTable.loadSyntax(grammar.getPlist().getValue(), myInterner); if (rootScope != null) { grammar.getFileNameMatchers().forEach(matcher -> { myLanguageDescriptors.put(matcher, rootScope); }); if (scope == null) { scope = rootScope; } } } assertNotNull(scope); final List<String> extraBundleNames = getExtraBundleNames(); for (String bundleName : extraBundleNames) { Iterator<TextMateGrammar> extraGrammars = TestUtil.readBundle(bundleName).readGrammars().iterator(); while (extraGrammars.hasNext()) { TextMateGrammar grammar = extraGrammars.next(); mySyntaxTable.loadSyntax(grammar.getPlist().getValue(), myInterner); } } mySyntaxTable.compact(); CharSequence scopeForFileName = myLanguageDescriptors.get(new TextMateFileNameMatcher.Name(myFileName)); if (scopeForFileName != null) { myRootScope = scopeForFileName; } else { Iterator<CharSequence> extensionsIterator = TextMateEditorUtilsKt.fileNameExtensions(myFileName).iterator(); while (extensionsIterator.hasNext()) { CharSequence scopeForExtension = myLanguageDescriptors.get(new TextMateFileNameMatcher.Extension(extensionsIterator.next().toString())); if (scopeForExtension != null) { myRootScope = scopeForExtension; break; } } } assertNotNull("scope is empty for file name: " + myFileName, myRootScope); }
before
27,723
String (IElementType tokenType) { if (tokenType instanceof TextMateElementType) { TextMateScope scope = ((TextMateElementType)tokenType).getScope(); StringBuilder builder = new StringBuilder(); CharSequence scopeName = scope.getScopeName(); if (scopeName != null) { builder.append(scopeName); } TextMateScope parent = scope.getParent(); while (parent != null) { CharSequence parentScopeName = parent.getScopeName(); if (parentScopeName != null) { if (!builder.isEmpty()) { builder.insert(0, ";"); } builder.insert(0, parentScopeName); } parent = parent.getParent(); } return builder.toString().trim(); } return tokenType.toString(); }
getTokenTypePresentation
27,724
List<String> () { return Collections.emptyList(); }
getExtraBundleNames
27,725
void () { StringWithId string = new StringWithId("first-second"); MatchData data = regex("([A-z]+)-([A-z]+)").match(string, null); assertEquals("first+second+first", SyntaxMatchUtils.replaceGroupsWithMatchDataInRegex("\\1+\\2+\\1", string, data)); }
testReplaceGroupWithMatchData
27,726
void () { StringWithId string = new StringWithId("first-second"); MatchData data = regex("([A-z]+)-([A-z]+)").match(string, null); assertEquals("first+second+first", SyntaxMatchUtils.replaceGroupsWithMatchDataInCaptures("$1+$2+$1", string, data)); }
testReplaceGroupWithMatchDataInCaptures
27,727
void () { StringWithId string = new StringWithId("first-second"); MatchData data = regex("([A-z]+)-([A-z]+)").match(string, null); assertEquals("FIRST+second+first", SyntaxMatchUtils.replaceGroupsWithMatchDataInCaptures("${1:/upcase}+$2+$1", string, data)); }
testReplaceWithUppercase
27,728
void () { StringWithId string = new StringWithId("FIRST-second"); MatchData data = regex("([A-z]+)-([A-z]+)").match(string, null); assertEquals("first+second+FIRST", SyntaxMatchUtils.replaceGroupsWithMatchDataInCaptures("${1:/downcase}+$2+$1", string, data)); }
testReplaceWithDowncase
27,729
void () { StringWithId string = new StringWithId("first-$"); MatchData data = regex("([A-z]+)-([A-z$]+)").match(string, null); assertEquals("first+\\$+first", SyntaxMatchUtils.replaceGroupsWithMatchDataInRegex("\\1+\\2+\\1", string, data)); }
testReplaceWithDollarSign
27,730
String () { return "terraform"; }
getTestDirRelativePath
27,731
String () { return TestUtil.TERRAFORM; }
getBundleName
27,732
String () { return "python"; }
getTestDirRelativePath
27,733
String () { return TestUtil.PYTHON; }
getBundleName
27,734
String () { return "coldfusion"; }
getTestDirRelativePath
27,735
String () { return TestUtil.COLD_FUSION; }
getBundleName
27,736
String () { return "make"; }
getTestDirRelativePath
27,737
String () { return TestUtil.MAKE; }
getBundleName
27,738
String () { return TestUtil.PHP_VSC; }
getBundleName
27,739
List<String> () { return Arrays.asList(TestUtil.HTML_VSC, TestUtil.CSS_VSC); }
getExtraBundleNames
27,740
String () { return "php_vsc"; }
getTestDirRelativePath
27,741
String () { return "latex"; }
getTestDirRelativePath
27,742
String () { return TestUtil.LATEX; }
getBundleName
27,743
String () { return TestUtil.DOCKER; }
getBundleName
27,744
String () { return "docker_vsc"; }
getTestDirRelativePath
27,745
String () { return "markdown_blogging"; }
getTestDirRelativePath
27,746
String () { return TestUtil.MARKDOWN_BLOGGING; }
getBundleName
27,747
List<String> () { return asList(TestUtil.MARKDOWN_TEXTMATE); }
getExtraBundleNames
27,748
String () { return "turtle"; }
getTestDirRelativePath
27,749
String () { return TestUtil.TURTLE; }
getBundleName
27,750
String () { return "ruby"; }
getTestDirRelativePath
27,751
String () { return TestUtil.RUBY; }
getBundleName
27,752
String () { return "java"; }
getTestDirRelativePath
27,753
String () { return TestUtil.JAVA; }
getBundleName
27,754
String () { return "perl"; }
getTestDirRelativePath
27,755
String () { return TestUtil.PERL; }
getBundleName
27,756
String () { return TestUtil.MARKDOWN_TEXTMATE; }
getBundleName
27,757
List<String> () { return Collections.singletonList(TestUtil.HTML); }
getExtraBundleNames
27,758
String () { return "markdown_html"; }
getTestDirRelativePath
27,759
String () { return TestUtil.PHP; }
getBundleName
27,760
List<String> () { return Collections.singletonList(TestUtil.HTML); }
getExtraBundleNames
27,761
String () { return "php"; }
getTestDirRelativePath
27,762
String () { return "log"; }
getTestDirRelativePath
27,763
String () { return TestUtil.LOG; }
getBundleName
27,764
String () { return "markdown_sublime"; }
getTestDirRelativePath
27,765
String () { return TestUtil.MARKDOWN_SUBLIME; }
getBundleName
27,766
String () { return "cpp"; }
getTestDirRelativePath
27,767
String () { return "cpp"; }
getBundleName
27,768
String () { return "git"; }
getTestDirRelativePath
27,769
String () { return TestUtil.GIT; }
getBundleName
27,770
String () { return "markdown_vsc"; }
getTestDirRelativePath
27,771
String () { return TestUtil.MARKDOWN_VSC; }
getBundleName
27,772
String () { return "markdown"; }
getTestDirRelativePath
27,773
String () { return TestUtil.MARKDOWN_TEXTMATE; }
getBundleName
27,774
String () { return TestUtil.SMARTY; }
getBundleName
27,775
List<String> () { return Collections.singletonList(TestUtil.PHP); }
getExtraBundleNames
27,776
String () { return "smarty"; }
getTestDirRelativePath
27,777
String () { return "bat"; }
getTestDirRelativePath
27,778
String () { return TestUtil.BAT; }
getBundleName
27,779
String () { return "shellscript"; }
getTestDirRelativePath
27,780
String () { return TestUtil.SHELLSCRIPT; }
getBundleName
27,781
String () { return "elixir"; }
getTestDirRelativePath
27,782
String () { return TestUtil.ELIXIR; }
getBundleName
27,783
void () { myFixture.enableInspections(SpellCheckingInspection.class); myFixture.configureByText("test.md_hack", "some <TYPO>typooo</TYPO>"); myFixture.checkHighlighting(); }
testSimple
27,784
void () { doLineTest("tex"); }
testLatexLineCommenter
27,785
void () { doLineTest("php_hack"); }
testPhpLineCommenter
27,786
void () { doLineTest("bat_hack"); }
testBatLineCommenter
27,787
void () { doBlockTest("jsx_hack"); }
testJsxBlockCommenter
27,788
void () { doBlockTest("php_hack"); }
testBlockCommenter
27,789
void () { doBlockTest("php_hack"); }
testBlockCommenterInInjection
27,790
void () { doBlockTest("php_hack"); }
testBlockCommenterInInjection_2
27,791
void () { doBlockTest("php_hack"); }
testCommenterInInjectedCode
27,792
void (String extension) { doTest(extension, IdeActions.ACTION_COMMENT_LINE); }
doLineTest
27,793
void (String extension) { doTest(extension, IdeActions.ACTION_COMMENT_BLOCK); }
doBlockTest
27,794
void (final String extension, final String actionId) { myFixture.configureByFile(getTestName(true) + "." + extension); myFixture.performEditorAction(actionId); myFixture.checkResultByFile(getTestName(true) + "_after." + extension); }
doTest
27,795
String () { return "/editor/data"; }
getTestPath
27,796
void () { myFixture.configureByText("text.tex", "\\setlength<caret>{\\parskip}"); assertEquals(19, getMatchedOffset()); }
testBracesInLatex
27,797
void () { myFixture.configureByText("text.js_hack", "<caret>/** hello */"); assertEquals(10, getMatchedOffset()); }
testMultiCharBracesInJs
27,798
void () { myFixture.configureByText("text.md_hack", "<html><caret><p>Paragraph</p></html>"); assertEquals(8, getMatchedOffset()); }
testMatchingInInjectedCode
27,799
void () { myFixture.configureByText("text.jsx_hack", "foo() {<caret> return <p>Paragraph</p>;}"); assertEquals(32, getMatchedOffset()); }
testJsx