New tips and tricks for IntelliJ

GitOrigin-RevId: e19cb9431333ceeaf55ba9da076127762eb42669
This commit is contained in:
Alexander Zolotov
2019-11-22 16:12:35 +03:00
committed by intellij-monorepo-bot
parent a6190f7067
commit e9eaacf720
7 changed files with 26 additions and 185 deletions

View File

@@ -9,5 +9,15 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.java.ide.resources" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.ide.customization" scope="TEST" />
<orderEntry type="module-library" scope="RUNTIME">
<library name="tips-idea-ce" type="repository">
<properties maven-id="com.jetbrains.intellij.documentation:tips-intellij-idea-community:193.4" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/intellij/documentation/tips-intellij-idea-community/193.4/tips-intellij-idea-community-193.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View File

@@ -1,179 +0,0 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<!--
<tipAndTrick file="NotReadyYet.html"/>
-->
<tipAndTrick file="Welcome.html"/>
<tipAndTrick file="GoToClass.html" feature-id="navigation.popup.class"/>
<tipAndTrick file="CodeCompletion.html" feature-id="editing.completion.basic"/>
<tipAndTrick file="FindUsages.html"/>
<tipAndTrick file="QuickJavaDoc.html" feature-id="codeassists.quickjavadoc"/>
<tipAndTrick file="GoToDeclaration.html" feature-id="navigation.goto.declaration"/>
<tipAndTrick file="FileStructurePopup.html" feature-id="navigation.popup.file.structure"/>
<tipAndTrick file="Rename.html"/>
<tipAndTrick file="OverrideImplementMethods.html" feature-id="codeassists.overrideimplement"/>
<tipAndTrick file="SmartTypeCompletion.html" feature-id="editing.completion.smarttype.general"/>
<tipAndTrick file="TabInLookups.html" feature-id="editing.completion.replace"/>
<tipAndTrick file="TabInEditorClose.html"/>
<tipAndTrick file="AltInsertInEditor.html"/>
<!--<tipAndTrick file="ClosingTabsWithMiddleMouse.html"/>-->
<tipAndTrick file="SelectIn.html" feature-id="navigation.select.in"/>
<tipAndTrick file="SpeedSearch.html" feature-id="ui.tree.speedsearch"/>
<tipAndTrick file="Escape.html"/>
<tipAndTrick file="SurroundWith.html" feature-id="codeassists.surroundwith.expression"/>
<tipAndTrick file="SmartTypeAfterNew.html" feature-id="editing.completion.smarttype.afternew"/>
<tipAndTrick file="GoToImplementation.html" feature-id="navigation.goto.implementation"/>
<tipAndTrick file="CtrlW.html" feature-id="editing.select.word"/>
<tipAndTrick file="IntroduceVariable.html" feature-id="refactoring.introduceVariable"/>
<tipAndTrick file="CommentCode.html" feature-id="codeassists.comment.line"/>
<!--<tipAndTrick file="DisableBulb.html"/>-->
<tipAndTrick file="ExternalJavaDoc.html" feature-id="codeassists.javadoc.external"/>
<tipAndTrick file="SmartTypeCasting.html" feature-id="editing.completion.smarttype.casting"/>
<tipAndTrick file="CtrlD.html"/>
<tipAndTrick file="LiveTemplates.html"/>
<tipAndTrick file="VariableNameCompletion.html" feature-id="editing.completion.variable.name"/>
<tipAndTrick file="ParameterInfo.html"/>
<tipAndTrick file="JumpToLastEdit.html"/>
<tipAndTrick file="HighlightUsagesInFile.html"/>
<tipAndTrick file="LayoutCode.html"/>
<tipAndTrick file="LocalVCS.html"/>
<tipAndTrick file="ContextInfo.html"/>
<tipAndTrick file="RecentFiles.html" feature-id="navigation.recent.files"/>
<tipAndTrick file="NextPrevError.html"/>
<tipAndTrick file="InsertLiveTemplate.html"/>
<tipAndTrick file="MethodSeparators.html"/>
<tipAndTrick file="CodeCompletionMiddle.html"/>
<tipAndTrick file="MethodUpDown.html"/>
<tipAndTrick file="JoinLines.html"/>
<tipAndTrick file="CopyClass.html" feature-id="refactoring.copyClass"/>
<tipAndTrick file="ClipboardStack.html"/>
<tipAndTrick file="HierarchyBrowser.html"/>
<tipAndTrick file="BreakpointSpeedmenu.html"/>
<tipAndTrick file="EvaluateExpressionInEditor.html"/>
<tipAndTrick file="QuickEvaluateExpression.html"/>
<tipAndTrick file="WordCompletion.html"/>
<tipAndTrick file="QuickJavaDocInLookups.html" feature-id="codeassists.quickjavadoc.lookup"/>
<tipAndTrick file="DotEtcInLookups.html" feature-id="editing.completion.finishByDotEtc"/>
<tipAndTrick file="MenuItemsDescriptions.html"/>
<tipAndTrick file="WildcardsInNavigationPopups.html"/>
<tipAndTrick file="MoveInnerToUpper.html"/>
<tipAndTrick file="IntroduceVariableIncompleteCode.html"/>
<tipAndTrick file="GoToSymbol.html" feature-id="navigation.popup.symbol"/>
<tipAndTrick file="RecentChanges.html" feature-id="ui.recentchanges"/>
<tipAndTrick file="ImageFileCompletion.html"/>
<tipAndTrick file="CreatePropertyTag.html"/>
<tipAndTrick file="QuickSwitchScheme.html" feature-id="ui.scheme.quickswitch"/>
<tipAndTrick file="CompleteStatement.html"/>
<tipAndTrick file="CamelPrefixesInNavigationPopups.html"/>
<tipAndTrick file="CtrlShiftI.html" feature-id="codeassists.quickdefinition"/>
<tipAndTrick file="CompletionInHTML.html"/>
<tipAndTrick file="CopyPasteReference.html"/>
<tipAndTrick file="MoveUpDown.html"/>
<tipAndTrick file="SelectRunDebugConfiguration.html"/>
<tipAndTrick file="CtrlShiftIForLookup.html" feature-id="codeassists.quickdefinition.lookup"/>
<tipAndTrick file="PropertiesCompletion.html"/>
<tipAndTrick file="ShowAppliedStyles.html"/>
<tipAndTrick file="ImagesLookup.html"/>
<tipAndTrick file="RenameCssSelector.html"/>
<tipAndTrick file="NavBar.html"/>
<tipAndTrick file="ChangesView.html"/>
<tipAndTrick file="Antivirus.html"/>
<tipAndTrick file="MavenQuickOpen.html"/>
<tipAndTrick file="MoveToChangelist.html"/>
<tipAndTrick file="EclipseQuickOpen.html"/>
<tipAndTrick file="ShowUsages.html"/>
<tipAndTrick file="GoToAction.html"/>
<tipAndTrick file="GoToInspection.html"/>
<tipAndTrick file="SearchInSettings.html"/>
<tipAndTrick file="CompleteMethod.html"/>
<tipAndTrick file="HighlightImplements.html"/>
<tipAndTrick file="RecentSearch.html"/>
<tipAndTrick file="CodeCompletionInSearch.html"/>
<tipAndTrick file="HighlightMethodExitPoint.html"/>
<tipAndTrick file="HighlightThrows.html"/>
<tipAndTrick file="QuickFixRightArrow.html"/>
<tipAndTrick file="NavigateToFilePath.html"/>
<tipAndTrick file="IssueNavigation.html"/>
<tipAndTrick file="ColorEditingInCss.html"/>
<tipAndTrick file="CreateTestIntentionAction.html"/>
<tipAndTrick file="ColumnSelection.html"/>
<tipAndTrick file="ColorFiles.html"/>
<tipAndTrick file="CopyWithNoSelection.html"/>
<tipAndTrick file="moveFileToChangelist.html"/>
<tipAndTrick file="Spellchecker.html"/>
<tipAndTrick file="SpellcheckerDictionaries.html"/>
<tipAndTrick file="VcsQuickList.html"/>
<tipAndTrick file="Switcher.html"/>
<tipAndTrick file="DragToOpen.html"/>
<tipAndTrick file="CloseOthers.html"/>
<tipAndTrick file="EnterDirectoryInGotoFile.html"/>
<tipAndTrick file="GotoLineInFile.html"/>
<tipAndTrick file="AnnotationsAndDiffs.html"/>
<tipAndTrick file="DirDiff.html"/>
<tipAndTrick file="JarDiff.html"/>
<tipAndTrick file="ShowHideSideBars.html"/>
<tipAndTrick file="ExcludeFromProject.html"/>
<tipAndTrick file="CodeCompletionNoShift.html"/>
<tipAndTrick file="CommitCtrlK.html"/>
<tipAndTrick file="FindReplaceToggle.html"/>
<tipAndTrick file="ScopesInTODO.html"/>
<tipAndTrick file="PreviewTODO.html"/>
<tipAndTrick file="FixDocComment.html"/>
<tipAndTrick file="SelectTasks.html"/>
<tipAndTrick file="RunConfigFolders.html"/>
<tipAndTrick file="SpeedSearchinLiveTemplates.html"/>
<tipAndTrick file="EditRegExp.html"/>
<tipAndTrick file="Emmet.html"/>
<!--<tipAndTrick file="EscapeCharactersInResourceBundle.html"/>-->
<tipAndTrick file="LineEndings.html"/>
<tipAndTrick file="LineEndingsFolder.html"/>
<tipAndTrick file="RefactorThis.html"/>
<tipAndTrick file="FavoritesToolWindow1.html"/>
<tipAndTrick file="FavoritesToolWindow2.html"/>
<tipAndTrick file="WideScreen.html"/>
<tipAndTrick file="Terminal.html"/>
<tipAndTrick file="ConfiguringTerminal.html"/>
<tipAndTrick file="HorizontalScrolling.html" feature-id="ui.horizontal.scrolling"/>
<tipAndTrick file="SearchEverywhere.html" feature-id="SearchEverywhere"/>
<tipAndTrick file="CtrlDotInLookups.html" feature-id="editing.completion.finishByCtrlDot"/>
<tipAndTrick file="CancelByControlArrows.html" feature-id="editing.completion.cancelByControlArrows"/>
<tipAndTrick file="CamelHumpsInCodeCompletion.html" feature-id="editing.completion.camelHumps"/>
<tipAndTrick file="SecondSmartCompletionArrayMember.html" feature-id="editing.completion.second.smarttype.array.member"/>
<tipAndTrick file="SecondSmartCompletionAsList.html" feature-id="editing.completion.second.smarttype.aslist"/>
<tipAndTrick file="SecondSmartCompletionChain.html" feature-id="editing.completion.second.smarttype.chain"/>
<tipAndTrick file="FinishBySmartEnter.html" feature-id="editing.completion.finishBySmartEnter"/>
<tipAndTrick file="FinishByExclamation.html" feature-id="editing.completion.finishByExclamation"/>
<tipAndTrick file="CompletionImportStatic.html" feature-id="editing.completion.global.member.name"/>
<tipAndTrick file="SecondBasicClassNameCompletion.html" feature-id="editing.completion.second.basic"/>
<tipAndTrick file="SecondSmartCompletionToar.html" feature-id="editing.completion.second.smarttype.toar"/>
<tipAndTrick file="ChangeSorting.html" feature-id="editing.completion.changeSorting"/>
<tipAndTrick file="PostfixCompletion.html" feature-id="editing.completion.postfix"/>
<tipAndTrick file="Scratch.html" feature-id="scratch"/>
<tipAndTrick file="LiveTemplatesRestore.html"/>
<tipAndTrick file="Multicursor.html"/>
<tipAndTrick file="Multicursor1.html"/>
<tipAndTrick file="QuickDocInSuggestionList.html"/>
<tipAndTrick file="TerminalOpen.html"/>
<tipAndTrick file="PrintKeywords.html"/>
<tipAndTrick file="ConstructorDocs.html"/>
<tipAndTrick file="DiffChevron.html"/>
<tipAndTrick file="LensMode.html"/>
<tipAndTrick file="Multiselection1.html"/>
<tipAndTrick file="Multiselection2.html"/>
<tipAndTrick file="MultiselectionWords.html"/>
<tipAndTrick file="QuickDocOnMouseMove.html"/>
<tipAndTrick file="ScratchesView.html"/>
<tipAndTrick file="RichTextCopy.html"/>
<tipAndTrick file="RemoveToolWindowButton.html"/>
<tipAndTrick file="GoToFile.html"/>
<tipAndTrick file="DeleteLine.html" feature-id="editor.delete.line"/>
<tipAndTrick file="HippieCompletion.html"/>
<tipAndTrick file="ChangeSignatureAfterMovingParameters.html"/>
<tipAndTrick file="InspectCode.html" feature-id="codeassist.inspect.batch"/>
</extensions>
</idea-plugin>

View File

@@ -610,5 +610,6 @@ class CommunityLibraryLicenses {
jetbrainsLibrary("rd-swing"),
jetbrainsLibrary("rd-text"),
jetbrainsLibrary("tcServiceMessages"),
jetbrainsLibrary("tips-idea-ce"),
] as List<LibraryLicense>
}

View File

@@ -180,8 +180,7 @@ public class ShowFeatureUsageStatisticsDialog extends DialogWrapper {
browser.setText("");
}
else {
FeatureDescriptor feature = (FeatureDescriptor)selection.iterator().next();
TipUIUtil.openTipInBrowser(TipUIUtil.getTip(feature.getTipFileName()), browser);
TipUIUtil.openTipInBrowser(TipUIUtil.getTip((FeatureDescriptor)selection.iterator().next()), browser);
}
}
});

View File

@@ -2,6 +2,7 @@
package com.intellij.ide.util;
import com.intellij.CommonBundle;
import com.intellij.featureStatistics.FeatureDescriptor;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.plugins.PluginManagerCore;
@@ -84,8 +85,16 @@ public class TipUIUtil {
}
@Nullable
public static TipAndTrickBean getTip(String tipFileName) {
TipAndTrickBean tip = TipAndTrickBean.findByFileName(tipFileName);
public static TipAndTrickBean getTip(@Nullable FeatureDescriptor feature) {
if (feature == null) {
return null;
}
String tipFileName = feature.getTipFileName();
TipAndTrickBean tip = TipAndTrickBean.findByFileName("neue-" + tipFileName);
if (tip == null && StringUtil.isNotEmpty(tipFileName)) {
tip = TipAndTrickBean.findByFileName(tipFileName);
}
if (tip == null && StringUtil.isNotEmpty(tipFileName)) {
tip = new TipAndTrickBean();
tip.fileName = tipFileName;

View File

@@ -80,7 +80,7 @@ public class ProductivityFeaturesTest extends LightPlatformTestCase {
try {
Registry.get("ide.javafx.tips").setValue(false);//Don't test JavaFX case as is it triggers 'Thread leaked' failure
TipUIUtil.Browser browser = TipUIUtil.createBrowser();
TipUIUtil.openTipInBrowser(TipUIUtil.getTip(featureDescriptor.getTipFileName()), browser);
TipUIUtil.openTipInBrowser(TipUIUtil.getTip(featureDescriptor), browser);
//if (Registry.is("ide.javafx.tips")) {
// assertEquals("<html><body>Test Tip</body></html>", browser.getText());
//}

View File

@@ -4,6 +4,7 @@ package com.intellij.testFramework;
import com.intellij.featureStatistics.FeatureDescriptor;
import com.intellij.featureStatistics.ProductivityFeaturesRegistry;
import com.intellij.ide.util.TipAndTrickBean;
import com.intellij.ide.util.TipUIUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ResourceUtil;
@@ -25,7 +26,7 @@ public abstract class IdeResourcesTestCase extends LightPlatformTestCase {
Collection<String> errors = new TreeSet<>();
for (String id : ids) {
FeatureDescriptor descriptor = registry.getFeatureDescriptor(id);
TipAndTrickBean tip = TipAndTrickBean.findByFileName(descriptor.getTipFileName());
TipAndTrickBean tip = TipUIUtil.getTip(descriptor);
if (tip == null) {
errors.add("<tipAndTrick file=\"" + descriptor.getTipFileName() + "\" feature-id=\"" + id + "\"/>");
}