cleanup: <kdb> -> <shortcut>

This commit is contained in:
Yann Cébron 2021-04-29 17:00:14 +02:00
parent 9d5cd2a6e9
commit fc381c3c8b
11 changed files with 25 additions and 25 deletions

View File

@ -1,6 +1,6 @@
[//]: # (title: PSI References)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
A *reference* in a PSI tree is an object that represents a link from a *usage* of a particular element in the code to the corresponding *declaration*. *Resolving* a reference means locating the declaration to which a specific usage refers.
@ -48,7 +48,7 @@ File f = new File("foo.txt");
```
Here, "foo.txt" has no special meaning from the point of view of the Java syntax - it's just a string literal.
However, opening this example in IntelliJ IDEA and having a file called "foo.txt" in the same directory, one can <kbd>Ctrl/Cmd</kbd>-Click on "foo.txt" and navigate to the file.
However, opening this example in IntelliJ IDEA and having a file called "foo.txt" in the same directory, one can <shortcut>Ctrl/Cmd+Click</shortcut> on "foo.txt" and navigate to the file.
This works because the IDE recognizes the semantics of `new File(...)` and _contributes a reference_ into the string literal passed as a parameter to the method.
Typically, references can be contributed to elements that don't have their own references, such as string literals and comments.

View File

@ -1,6 +1,6 @@
[//]: # (title: Running and Debugging a Plugin)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
It's possible to run and debug a plugin directly from the IntelliJ IDEA.
You need a configured special profile (a *Plugin* Run/Debug configuration) that specifies the plugin module, VM parameters, and other specific options.
@ -14,8 +14,8 @@ Using IntelliJ IDEA's debugger, you can find out the origin of the run-time erro
**To debug a plugin**
* Select **Run \| Debug** in the main menu, or press <kbd>Shift</kbd> + <kbd>F9</kbd>.
* Select **Run \| Debug** in the main menu, or press <shortcut>Shift+F9</shortcut>.
**To run a plugin**
* Select **Run \| Run** in the main menu, or press <kbd>Shift</kbd> + <kbd>F10</kbd>.
* Select **Run \| Run** in the main menu, or press <shortcut>Shift+F10</shortcut>.

View File

@ -1,6 +1,6 @@
[//]: # (title: Plugin Dependencies)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
A plugin may depend on classes from other plugins, either bundled, third-party, or by the same author.
This document describes the syntax for declaring plugin dependencies and optional plugin dependencies.
@ -63,7 +63,7 @@ If the project uses [DevKit](using_dev_kit.md), add the JARs of the plugin on wh
>
{type="warning"}
To do that, open the Project Structure dialog, select the SDK used in the project, press the <kbd>+</kbd> button in the Classpath tab, and select the plugin JAR file or files:
To do that, open the Project Structure dialog, select the SDK used in the project, press the <shortcut>+</shortcut> button in the Classpath tab, and select the plugin JAR file or files:
* For bundled plugins, the plugin JAR files are located in `plugins/<pluginname>` or `plugins/<pluginname>/lib` under the main installation directory.
If you're not sure which JAR to add, you can add all of them.
* For non-bundled plugins, the plugin JAR files are located in `config/plugins/<pluginname>` or `config/plugins/<pluginname>/lib` under the directory specified as "Sandbox Home" in the IntelliJ Platform Plugin SDK settings.

View File

@ -1,6 +1,6 @@
[//]: # (title: Plugin Services)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
A _service_ is a plugin component loaded on demand when your plugin calls the `getService()` method of [`ServiceManager`](upsource:///platform/core-api/src/com/intellij/openapi/components/ServiceManager.java).
@ -127,5 +127,5 @@ If this number exceeds the maximum number of simultaneously opened projects allo
* Download the included sample plugin project located [here](https://github.com/JetBrains/intellij-sdk-code-samples/tree/main/max_opened_projects).
* Start IntelliJ IDEA, on the starting page, click *Open Project*, and then use the *Open Project* dialog box to open the project.
* On the main menu, choose *Run \| Run* or press <kbd>Shift</kbd>+<kbd>F10</kbd>.
* On the main menu, choose *Run \| Run* or press <shortcut>Shift+F10</shortcut>.
* If necessary, change the [Run/Debug Configurations](https://www.jetbrains.com/help/idea/run-debug-configuration-plugin.html).

View File

@ -1,6 +1,6 @@
[//]: # (title: About This Guide)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
This guide is split into several parts, similar to a textbook.
Each one builds on the content of the previous section, but it is not necessary to read the guide in order.
@ -42,7 +42,7 @@ It also details how PSI creates and uses indexes.
#### Part V - Features
Describes how to extend and interact with various features that use the PSI layer, such as code completion, navigation, <kbd>Alt</kbd>+<kbd>Enter</kbd> items, intentions, refactorings, and more.
Describes how to extend and interact with various features that use the PSI layer, such as code completion, navigation, <shortcut>Alt+Enter</shortcut> items, intentions, refactorings, and more.
See also the section on Custom Languages below for language-specific features that are only applicable when adding support for a new language.
#### [Part VI - Testing](testing_plugins.md)

View File

@ -1,6 +1,6 @@
[//]: # (title: Key Topics)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
The IntelliJ Platform is extensive and very capable, and its size and scope can initially be very daunting.
This page is intended to list the key topics that a plugin author would be interested in, and provide quick links to the most common extension points.
@ -31,5 +31,5 @@ Some of the common extension points are:
* [Actions](action_system.md) - menu and toolbar items
* [Code inspections](code_inspections.md) - code analysis that looks at the syntax trees and semantic models and highlight issues in the editor.
* [Intentions](code_intentions.md) - context-specific actions that are available in the <kbd>Alt</kbd>+<kbd>Enter</kbd> menu when the text caret is at a particular location.
* [Intentions](code_intentions.md) - context-specific actions that are available in the <shortcut>Alt+Enter</shortcut> menu when the text caret is at a particular location.
* [Code completion](code_completion.md).

View File

@ -1,11 +1,11 @@
[//]: # (title: Documentation)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
To provide different kinds of documentation support, the plugin needs to provide an implementation of the [`DocumentationProvider`](upsource:///platform/analysis-api/src/com/intellij/lang/documentation/DocumentationProvider.java) interface and register it in the `com.intellij.lang.documentationProvider` extension point.
A standard base class for such implementations is available in [`AbstractDocumentationProvider`](upsource:///platform/analysis-api/src/com/intellij/lang/documentation/AbstractDocumentationProvider.java).
The `getQuickNavigateInfo()` method returns the text to be displayed when the user holds the mouse over an element with <kbd>Ctrl</kbd> pressed.
The `getQuickNavigateInfo()` method returns the text to be displayed when the user holds the mouse over an element with <shortcut>Ctrl/Cmd</shortcut> pressed.
When generating complete documentation via `generateDoc()`, use [`DocumentationMarkup`](upsource:///platform/analysis-api/src/com/intellij/lang/documentation/DocumentationMarkup.java) to layout contents (see JavaDoc for details).

View File

@ -1,13 +1,13 @@
[//]: # (title: IntelliJ Platform Plugin Template)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
[**IntelliJ Platform Plugin Template**][gh:ippt] is a repository that provides a pure boilerplate template to make it easier to create a new plugin project using the recommended [Gradle setup](gradle_build_system.md).
The main goal of this template is to speed up the setup phase of plugin development for both new and experienced developers by preconfiguring the project scaffold and CI, linking to the proper documentation pages, and keeping everything organized.
GitHub Template allows you to create a new repository from the scaffold without having to copy and paste content, clone repositories, or clear the history manually.
All you have to do is click the <kbd>Use this template</kbd> button on the GitHub project page.
All you have to do is click the <shortcut>Use this template</shortcut> button on the GitHub project page.
After that, the GitHub Actions workflow will be triggered to override or remove any template-specific configurations, such as the plugin name, current changelog, etc.
Once this is complete, the project is ready to be cloned to your local environment and opened with [IntelliJ IDEA][jb:download-ij].

View File

@ -1,6 +1,6 @@
[//]: # (title: Creating New Functions for Live Templates)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
The [Predefined Functions](https://www.jetbrains.com/help/idea/template-variables.html?s=quick#predefined_functions) are the building blocks for creating [Parameterized Templates and Surround Templates](https://www.jetbrains.com/help/idea/using-live-templates.html?s=quick#live_templates_types).
However, sometimes the Predefined Functions are not enough.
@ -57,12 +57,12 @@ Using the `com.intellij.liveTemplateMacro` extension point, register the impleme
Now verify the plugin is working correctly.
* Run the plugin in a Development Instance.
* Create a new file `testing.md` and enter several words in lower case.
* Highlight the text and enter <kbd>⌥⌘J</kbd> to open the Select Template popup.
* Highlight the text and enter <shortcut>Ctrl/Cmd+J</shortcut> to open the Select Template popup.
Confirm that the _SDK: Convert to title case_ is available in the popup, and select it.
![Convert to title case](invoke_titleCase.png){width="700"}
Test that the Live Template works by entering <kbd>m</kbd> or <kbd>return</kbd>.
Test that the Live Template works by entering <shortcut>m</shortcut> or <shortcut>Return</shortcut>.
The text will change to have each word capitalized:
![Converted to title case](applied_titleCase.png){width="700"}

View File

@ -137,4 +137,4 @@ Using the `com.intellij.defaultLiveTemplatesProvider` and `com.intellij.liveTemp
Now verify the plugin is working correctly.
Run the plugin in a Development Instance and verify there is a new entry under **Settings/Preferenes \| Live Templates \| Markdown \| \{ (SDK: New link reference)**.
Finally, create a new file `test.md` and confirm that the Live Template works by entering a <kbd>{</kbd> character and then pressing <kbd>Tab</kbd>.
Finally, create a new file `test.md` and confirm that the Live Template works by entering a <shortcut>{</shortcut> character and then pressing <shortcut>Tab</shortcut>.

View File

@ -1,6 +1,6 @@
[//]: # (title: Dialogs)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
## DialogWrapper
@ -13,9 +13,9 @@ It provides the following features:
* Remembering the size of the dialog
* Non-modal validation (displaying an error message text when the data entered into the dialog is not valid)
* Keyboard shortcuts:
* <kbd>Esc</kbd> for closing the dialog
* <kbd>Left/Right</kbd> for switching between buttons
* <kbd>Y</kbd>/<kbd>N</kbd> for _Yes_/_No_ actions if they exist in the dialog
* <shortcut>Esc</shortcut> for closing the dialog
* <shortcut>Left/Right</shortcut> for switching between buttons
* <shortcut>Y</shortcut>/<shortcut>N</shortcut> for _Yes_/_No_ actions if they exist in the dialog
* Optional _Do not ask again_ checkbox
When using the [`DialogWrapper`](upsource:///platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java) class for a dialog, follow these steps: