Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
27,800
void () { myFixture.configureByText("text.jsx_hack", "foo() { return <caret><p>Paragraph</p>;}"); assertEquals(17, getMatchedOffset()); }
testJsxTags
27,801
void () { myFixture.configureByText("text.md_hack", "<caret>[link](url)"); assertEquals(5, getMatchedOffset()); }
testBrackets
27,802
int () { return ReadAction .compute(() -> BraceMatchingUtil.getMatchedBraceOffset(myFixture.getEditor(), true, myFixture.getFile())); }
getMatchedOffset
27,803
void () { myFixture.configureByText("test.md_hack", """ Hello, I love you Let me jump in your game <caret>"""); myFixture.completeBasic(); assertSameElements(myFixture.getLookupElementStrings(), "Hello", "I", "love", "you", "Let", "me", "jump", "in", "your", "game"); }
testCompletionWithEmptyPrefix
27,804
void () { myFixture.configureByText("test.md_hack", "s<caret>"); myFixture.completeBasic(); assertSameElements(myFixture.getLookupElementStrings(), "select"); myFixture.finishLookup(Lookup.NORMAL_SELECT_CHAR); myFixture .checkResult(""" <select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}$...
testCompletionWithPrefix
27,805
void () { myFixture.configureByText("test.md_hack", "<caret>"); myFixture.completeBasic(); assertSameElements(myFixture.getLookupElementStrings(), "!", "!", "!", "!", "!", "!", "!", "!", "div", "doctype", "doctype", "doctype", "doctype", "doctype", "doctype", "doctype", "fieldset", "input", "movie", "opt", "select"); }
testCompletionWithEmptyPrefix
27,806
void () { myFixture.configureByText("test.md_hack", "fi<caret>"); new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor()); List<String> lookupElementStrings = myFixture.getLookupElementStrings(); assertContainsElements(lookupElementStrings, "fieldset"); assertDoesntContain(lookupEle...
testListTemplatesWithPrefix
27,807
void () { myFixture.configureByText("test.md_hack", "<caret>"); new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor()); assertContainsElements(myFixture.getLookupElementStrings(), "!", "!", "!", "!", "!", "!", "!", "!", "div", "doctype", "doctype", "doctype", "doctype", "doctype", ...
testListTemplateWithEmptyPrefix
27,808
void () { doTest("<caret>", "md_hack", "\"", "\"<caret>\""); }
testQuotes_1
27,809
void () { doTest("\"<caret>\"", "md_hack", "\"", "\"\"<caret>"); }
testQuotes_2
27,810
void () { doTest("\"asd<caret>", "md_hack", "\"", "\"asd\"<caret>"); }
testQuotesAfterSpecSymbol_1
27,811
void () { doTest("\"asd <caret>", "md_hack", "\"", "\"asd \"<caret>\""); }
testQuotesAfterSpecSymbol_2
27,812
void () { doTest("\"asd(<caret>", "md_hack", "\"", "\"asd(\"<caret>\""); }
testQuotesAfterSpecSymbol_3
27,813
void () { doTest("\"asd <caret>asd", "md_hack", "\"", "\"asd \"<caret>asd"); }
testQuotesBeforeChar
27,814
void () { doTest("<html><caret></html>", "md_hack", "<", "<html><<caret>></html>"); }
testTagsInHtml
27,815
void () { doTest("var a = <div><caret></div>", "jsx_hack", "<", "var a = <div><<caret>></div>"); }
testTagsInJsx
27,816
void () { doTest("<caret>", "tex", "`", "`<caret>'"); }
testBracePairInLatex_1
27,817
void () { doTest("`<caret>'", "tex", "'", "`'<caret>"); }
testBracePairInLatex_2
27,818
void () { doTest("/*<caret>", "js_hack", "*", "/**<caret> */"); }
testMultiCharBraces
27,819
void () { doTest("\\<caret>", "text", "`", "\\`<caret>"); }
testDisabledSmartBraces
27,820
void () { CodeInsightSettings settings = CodeInsightSettings.getInstance(); boolean oldValue = settings.AUTOINSERT_PAIR_QUOTE; try { settings.AUTOINSERT_PAIR_QUOTE = false; doTest("<caret>", "md_hack", "\"", "\"<caret>"); } finally { settings.AUTOINSERT_PAIR_QUOTE = oldValue; } }
testDisableQuotes
27,821
void () { CodeInsightSettings settings = CodeInsightSettings.getInstance(); boolean oldValue = settings.AUTOINSERT_PAIR_BRACKET; try { settings.AUTOINSERT_PAIR_BRACKET = false; doTest("<html><caret></html>", "md_hack", "<", "<html><<caret></html>"); } finally { settings.AUTOINSERT_PAIR_BRACKET = oldValue; } }
testDisableBraces
27,822
void (String source, String extension, String toType, String expected) { myFixture.configureByText(getTestName(true) + "." + extension, source); myFixture.type(toType); myFixture.checkResult(expected); }
doTest
27,823
Path () { return PluginPathManager.getPluginHome("textmate").toPath().resolve("lib/bundles").normalize(); }
getBundledBundlePath
27,824
void () { registerBundles(true); }
reloadEnabledBundles
27,825
void (boolean fireEvents) { myRegistrationLock.lock(); try { Map<TextMateFileNameMatcher, CharSequence> oldExtensionsMapping = new HashMap<>(myExtensionMapping); unregisterAllBundles(); TextMateUserBundlesSettings settings = TextMateUserBundlesSettings.getInstance(); if (settings == null) { return; } Map<TextMateFileNa...
registerBundles
27,826
void (@NonNls @NotNull String reason, @NotNull Runnable update) { ApplicationManager.getApplication().invokeLater(() -> { ApplicationManager.getApplication().runWriteAction(() -> { FileTypeManagerImpl fileTypeManager = (FileTypeManagerImpl)FileTypeManager.getInstance(); fileTypeManager.makeFileTypesChange(reason, updat...
fireFileTypesChangedEvent
27,827
List<TextMateBundleToLoad> (@NotNull TextMateBuiltinBundlesSettings builtinBundlesSettings) { List<TextMateBundleToLoad> builtinBundles = builtinBundlesSettings.getBuiltinBundles(); if (builtinBundles.isEmpty()) { Path builtinBundlesPath = getBundledBundlePath(); try (Stream<Path> files = Files.list(builtinBundlesPath)...
discoverBuiltinBundles
27,828
void () { myExtensionMapping.clear(); myPreferenceRegistry.clear(); myCustomHighlightingColors.clear(); mySyntaxTable.clear(); mySnippetRegistry.clear(); myShellVariablesRegistry.clear(); }
unregisterAllBundles
27,829
ShellVariablesRegistry () { ensureInitialized(); return myShellVariablesRegistry; }
getShellVariableRegistry
27,830
SnippetsRegistry () { ensureInitialized(); return mySnippetRegistry; }
getSnippetRegistry
27,831
PreferencesRegistry () { ensureInitialized(); return myPreferenceRegistry; }
getPreferenceRegistry
27,832
void () { if (!myInitialized) { myRegistrationLock.lock(); try { if (myInitialized) return; registerBundles(false); myInitialized = true; } finally { myRegistrationLock.unlock(); } } }
ensureInitialized
27,833
boolean (@Nullable Path directory, @NotNull Map<TextMateFileNameMatcher, CharSequence> extensionMapping) { TextMateBundleReader reader = readBundle(directory); if (reader != null) { registerLanguageSupport(reader, extensionMapping); registerPreferences(reader); registerSnippets(reader); return true; } return false; }
registerBundle
27,834
void (@NotNull TextMateBundleReader reader) { if (ApplicationManager.getApplication().isUnitTestMode()) { // it's used in internal mode only (see org.jetbrains.plugins.textmate.editor.TextMateCustomLiveTemplate.isApplicable), // do not register to save some memory and loading time Iterator<TextMateSnippet> snippetsIter...
registerSnippets
27,835
void (@NotNull TextMateBundleReader reader) { Iterator<TextMatePreferences> preferencesIterator = reader.readPreferences().iterator(); while (preferencesIterator.hasNext()) { TextMatePreferences preferences = preferencesIterator.next(); CharSequence scopeName = myInterner.intern(preferences.getScopeName()); Set<TextMat...
registerPreferences
27,836
void (@NotNull TextMateBundleReader reader, @NotNull Map<TextMateFileNameMatcher, CharSequence> extensionMapping) { Iterator<TextMateGrammar> grammarIterator = reader.readGrammars().iterator(); while (grammarIterator.hasNext()) { TextMateGrammar grammar = grammarIterator.next(); CharSequence rootScopeName = mySyntaxTab...
registerLanguageSupport
27,837
void (Disposable disposable) { ourBuiltinBundlesDisabled = true; TextMateService.getInstance().reloadEnabledBundles(); myInitialized = true; Disposer.register(disposable, () -> { ourBuiltinBundlesDisabled = false; unregisterAllBundles(); myInitialized = false; }); }
disableBuiltinBundles
27,838
Lexer (@NotNull PsiFile file) { return file instanceof TextMateFile ? new EmptyLexer() : null; }
getIndexingLexer
27,839
TokenSet (@NotNull PsiFile file) { return null; }
getCommentTokenSet
27,840
int (IElementType tokenType) { return 0; }
getCommentStartDelta
27,841
int (IElementType tokenType) { return 0; }
getCommentEndDelta
27,842
String () { return "textmate"; }
getName
27,843
String () { return TextMateBundle.message("filetype.textmate.description"); }
getDescription
27,844
String () { return ""; }
getDefaultExtension
27,845
Icon () { return AllIcons.FileTypes.Text; }
getIcon
27,846
boolean (@NotNull VirtualFile file) { if (file.isDirectory()) { return false; } CharSequence fileName = file.getNameSequence(); FileType originalFileType = FileTypeManager.getInstance().getFileTypeByFileName(fileName); return isTypeShouldBeReplacedByTextMateType(originalFileType) && TextMateService.getInstance().getLan...
isMyFileType
27,847
boolean (@Nullable FileType registeredType) { return registeredType == UnknownFileType.INSTANCE || registeredType == INSTANCE || registeredType == PlainTextFileType.INSTANCE || registeredType instanceof TextMateBackedFileType; }
isTypeShouldBeReplacedByTextMateType
27,848
boolean () { return true; }
isReadOnly
27,849
int () { return 0; }
getDesiredContentPrefixLength
27,850
TextMateService () { return ApplicationManager.getApplication().getService(TextMateService.class); }
getInstance
27,851
TextMateBundleReader (@Nullable Path directory) { return null; }
readBundle
27,852
void (@NotNull TextMateConfigurableData settings) { Set<TextMateConfigurableBundle> state = settings.getConfigurableBundles(); if (myBundlesListPanel.isModified(state)) { settings.applySettings(myBundlesListPanel.getState()); ProgressManager.getInstance().run(new Task.Backgroundable(null, TextMateBundle.message("textma...
apply
27,853
void (@NotNull ProgressIndicator indicator) { TextMateService.getInstance().reloadEnabledBundles(); }
run
27,854
void (@NotNull TextMateConfigurableData settings) { myBundlesListPanel.setState(settings.getConfigurableBundles()); }
reset
27,855
boolean (@NotNull TextMateConfigurableData settings) { return myBundlesListPanel.isModified(settings.getConfigurableBundles()); }
isModified
27,856
JComponent () { return myBundlesList; }
getComponent
27,857
JComponent () { return myBundlesList; }
getPreferredFocusedComponent
27,858
void () { }
dispose
27,859
String () { return name; }
getName
27,860
void (String name) { this.name = name; }
setName
27,861
String () { return path; }
getPath
27,862
void (String path) { this.path = path; }
setPath
27,863
boolean () { return enabled; }
isEnabled
27,864
void (boolean enabled) { this.enabled = enabled; }
setEnabled
27,865
BundleConfigBean () { return new BundleConfigBean(name, path, enabled); }
copy
27,866
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; BundleConfigBean bean = (BundleConfigBean)o; if (enabled != bean.enabled) return false; if (!Objects.equals(name, bean.name)) return false; if (!Objects.equals(path, bean.path)) return false; return true; }
equals
27,867
int () { int result = name != null ? name.hashCode() : 0; result = 31 * result + (path != null ? path.hashCode() : 0); result = 31 * result + (enabled ? 1 : 0); return result; }
hashCode
27,868
TextMateSettings () { return new TextMateSettings(); }
getInstance
27,869
TextMateSettingsState () { TextMateSettingsState state = new TextMateSettingsState(); ArrayList<BundleConfigBean> bundles = new ArrayList<>(); TextMateUserBundlesSettings settings = TextMateUserBundlesSettings.getInstance(); if (settings != null) { for (Map.Entry<String, TextMatePersistentBundle> entry : settings.getBu...
getState
27,870
void (@NotNull TextMateSettingsState state) { TextMateUserBundlesSettings settings = TextMateUserBundlesSettings.getInstance(); if (settings != null) { Map<String, TextMatePersistentBundle> bundles = new HashMap<>(); for (BundleConfigBean bundle : state.bundles) { bundles.put(bundle.getPath(), new TextMatePersistentBun...
loadState
27,871
Collection<BundleConfigBean> () { return getState().getBundles(); }
getBundles
27,872
List<BundleConfigBean> () { return new ArrayList<>(bundles); }
getBundles
27,873
void (@NotNull Collection<BundleConfigBean> value) { bundles.clear(); bundles.ensureCapacity(value.size()); for (BundleConfigBean bundle : value) { bundles.add(bundle.copy()); } }
setBundles
27,874
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextMateSettingsState state = (TextMateSettingsState)o; if (!bundles.equals(state.bundles)) return false; return true; }
equals
27,875
int () { return bundles.hashCode(); }
hashCode
27,876
Configurable () { return SimpleConfigurable .create("reference.settingsdialog.textmate.bundles", IdeBundle.message("configurable.TextMateConfigurableProvider.display.name"), TextMateConfigurableUi.class, TextMateConfigurableData::getInstance); }
createConfigurable
27,877
boolean () { return TextMateConfigurableData.getInstance() != null; }
canCreateConfigurable
27,878
EditorHighlighter (@Nullable Project project, @NotNull FileType fileType, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) { return new TextMateLexerEditorHighlighter(SyntaxHighlighterFactory.getSyntaxHighlighter(fileType, project, virtualFile), colors); }
getEditorHighlighter
27,879
DataStorage () { return new TextMateLexerDataStorage(); }
createStorage
27,880
Lexer () { return myLexer == null ? PLAIN_SYNTAX_HIGHLIGHTER.getHighlightingLexer() : myLexer; }
getHighlightingLexer
27,881
TextMateScope (TextMateElementType tokenType) { TextMateScope current = tokenType.getScope(); List<CharSequence> trail = new ArrayList<>(); while (current != null) { CharSequence scopeName = current.getScopeName(); if (scopeName != null && Strings.contains(scopeName, ".embedded.")) { TextMateScope result = TextMateScop...
trimEmbeddedScope
27,882
TextAttributesKey (@NotNull TextMateTheme textMateTheme) { Color defaultBackground = textMateTheme.getDefaultBackground(); Color mixedBackground = mixBackground(defaultBackground, myTextAttributes.getBackgroundColor(), myBackgroundAlpha); Color mixedForeground = mixBackground(defaultBackground, myTextAttributes.getFore...
getTextAttributesKey
27,883
Color (@Nullable Color color, @Nullable Color defaultBackground, double alpha) { if (color == null || defaultBackground == null || alpha < 0) { return null; } return ColorUtil.mix(defaultBackground, color, alpha); }
mixBackground
27,884
double (String string) { try { return Integer.parseInt(string, 16) / 256.0; } catch (NumberFormatException e) { return -1; } }
parseAlpha
27,885
Set<CharSequence> () { return DEFAULT_HIGHLIGHTING_RULES.keySet(); }
getAllDefaultKeys
27,886
TextAttributesKey (CharSequence selector) { return DEFAULT_HIGHLIGHTING_RULES.getOrDefault(selector, HighlighterColors.TEXT); }
getTextAttributesKey
27,887
String () { return myName; }
getName
27,888
Color () { return EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground(); }
getDefaultBackground
27,889
Set<CharSequence> () { return RULES; }
getRules
27,890
TextAttributesKey (CharSequence highlightingRule) { CharSequence keyName = EXTENSIONS_MAPPING.get(highlightingRule); TextAttributesKey extendedKey = keyName != null ? TextAttributesKey.find(keyName.toString()) : null; return extendedKey == null ? DEFAULT_COLORS_PROVIDER.getTextAttributesKey(highlightingRule) : extended...
getTextAttributesKey
27,891
SyntaxHighlighter (@Nullable Project project, @Nullable VirtualFile virtualFile) { if (virtualFile == null) { return PLAIN_SYNTAX_HIGHLIGHTER; } TextMateService textMateService = TextMateService.getInstance(); if (textMateService != null) { final TextMateLanguageDescriptor languageDescriptor = textMateService.getLangua...
getSyntaxHighlighter
27,892
void (@NotNull CharSequence buffer, int startOffset, int endOffset, int initialState) { myBuffer = buffer; myCurrentOffset = startOffset; myTokenStart = startOffset; myEndOffset = endOffset; currentLineTokens.clear(); myLexer.init(myBuffer, startOffset); advance(); }
start
27,893
int () { return myRestartable ? 0 : 1; }
getState
27,894
IElementType () { return myTokenType; }
getTokenType
27,895
int () { return myTokenStart; }
getTokenStart
27,896
int () { return myTokenEnd; }
getTokenEnd
27,897
CharSequence () { return myBuffer; }
getBufferSequence
27,898
int () { return myEndOffset; }
getBufferEnd
27,899
void () { if (myCurrentOffset >= myEndOffset) { updateState(null, myEndOffset); return; } if (currentLineTokens.isEmpty()) { myLexer.advanceLine(currentLineTokens); } updateState(currentLineTokens.poll(), myLexer.getCurrentOffset()); }
advance