diff --git a/topics/tutorials/custom_language_support/completion_contributor.md b/topics/tutorials/custom_language_support/completion_contributor.md index aa949fe29..9ca811afb 100644 --- a/topics/tutorials/custom_language_support/completion_contributor.md +++ b/topics/tutorials/custom_language_support/completion_contributor.md @@ -2,9 +2,9 @@ -Custom languages provide code completion using one of two approaches: Contributor and Reference-based (see [10. Reference Contributor](reference_contributor.md)) completion. +Custom languages provide code completion using one of two approaches: Contributor and Reference-based (see [](reference_contributor.md)) completion. -**Reference**: [Code Completion](code_completion.md) +**Reference**: [](code_completion.md) ## Define a Completion Contributor For this tutorial, the `simple_language_plugin` provides custom completion for values in Simple Language property files. @@ -32,4 +32,4 @@ Open the [`test.simple`](lexer_and_parser_definition.md#run-the-project) file. Erase the property "English" and invoke [Basic Code Completion](https://www.jetbrains.com/help/idea/auto-completing-code.html#invoke-basic-completion). The choice "Hello" is shown: -![Completion](completion.png) \ No newline at end of file +![Completion](completion.png) diff --git a/topics/tutorials/custom_language_support/documentation_provider.md b/topics/tutorials/custom_language_support/documentation_provider.md index d3b347423..5ea6cb38f 100644 --- a/topics/tutorials/custom_language_support/documentation_provider.md +++ b/topics/tutorials/custom_language_support/documentation_provider.md @@ -7,12 +7,12 @@ helps users by showing documentation for symbols like method calls inside the ed For the custom language tutorial, we’re implementing a version of this EP for the Simple Language that shows the key/value, the file where it is defined, and any related documentation comment. -**Reference:** [Documentation](documentation.md) +**Reference:** [](documentation.md) ## Implement DocumentationProvider and Register the EP -In the first step, we create an empty class that extends +In the first step, we create an empty class that extends [`AbstractDocumentationProvider`](upsource:///platform/analysis-api/src/com/intellij/lang/documentation/AbstractDocumentationProvider.java) and registers it in the plugin.xml. @@ -36,7 +36,7 @@ Make sure the class is registered in the plugin.xml between the `ex For the Simple Language, we consider two use-cases: -1. A Simple key is [used inside a Java string literal](reference_contributor.md), +1. A Simple key is [used inside a Java string literal](reference_contributor.md), and we would like to show documentation for the key/value right from the reference inside the Java file. 2. The cursor is already over a key/value definition inside a Simple file, in which case we would also like to show its documentation. @@ -194,7 +194,7 @@ In other circumstances, you can override `getDocumentationElementForLookupItem() To be able to call View | Quick Documentation for Simple properties in all places of a Java string literal, two steps are required: -1. The extension point needs to be changed from `lang.documentationProvider` to `documentationProvider` because only then +1. The extension point needs to be changed from `lang.documentationProvider` to `documentationProvider` because only then the Simple DocumentationProvider is called for PSI elements with a different language. 2. The `getCustomDocumentationElement()` method needs to be implemented to find the correct target PSI element for creating the documentation. diff --git a/topics/tutorials/custom_language_support/find_usages_provider.md b/topics/tutorials/custom_language_support/find_usages_provider.md index e19221de8..6c11bb268 100644 --- a/topics/tutorials/custom_language_support/find_usages_provider.md +++ b/topics/tutorials/custom_language_support/find_usages_provider.md @@ -5,7 +5,7 @@ A `FindUsagesProvider` uses a word scanner to build an index of words in every file. A scanner breaks the text into words and defines the context for each word. -**Reference**: [Find Usages](find_usages.md) +**Reference**: [](find_usages.md) ## Define a Find Usages Provider The `SimpleFindUsagesProvider` implements [`FindUsagesProvider`](upsource:///platform/indexing-api/src/com/intellij/lang/findUsages/FindUsagesProvider.java). @@ -31,4 +31,4 @@ Run the plugin by using the Gradle [runIde task](gradle_prerequisites.md#running The IDE now supports [Find Usages](https://www.jetbrains.com/help/idea/find-highlight-usages.html) for any property with a reference: -![Find Usages](find_usages.png) \ No newline at end of file +![Find Usages](find_usages.png) diff --git a/topics/tutorials/custom_language_support/formatter.md b/topics/tutorials/custom_language_support/formatter.md index 03e91bd10..5b7c0fd2c 100644 --- a/topics/tutorials/custom_language_support/formatter.md +++ b/topics/tutorials/custom_language_support/formatter.md @@ -6,7 +6,7 @@ The IntelliJ Platform includes a powerful framework for implementing formatting A formatter enables reformatting code automatically based on code style settings. The formatter controls spaces, indents, wrap, and alignment. -**Reference**: [Code Formatter](code_formatting.md) +**Reference**: [](code_formatting.md) ## Define a Block The formatting model represents the formatting structure of a file as a tree of [`Block`](upsource:///platform/code-style-api/src/com/intellij/formatting/Block.java) objects, with associated indent, wrap, alignment and spacing settings. @@ -45,4 +45,4 @@ Open the example Simple Language [properties file ](lexer_and_parser_definition. Add some extra spaces around the `=` separator between `language` and `English`. Reformat the code by selecting **Code \| Show Reformat File Dialog** and choose **Run**. -![Formatter](formatter.png) \ No newline at end of file +![Formatter](formatter.png) diff --git a/topics/tutorials/custom_language_support/go_to_symbol_contributor.md b/topics/tutorials/custom_language_support/go_to_symbol_contributor.md index f0ef48b3e..ca9548cea 100644 --- a/topics/tutorials/custom_language_support/go_to_symbol_contributor.md +++ b/topics/tutorials/custom_language_support/go_to_symbol_contributor.md @@ -4,7 +4,7 @@ A _Go to Symbol Contributor_ helps the user to navigate to any PSI element by its name. -**Reference**: [Go to Class and Go to Symbol](go_to_class_and_go_to_symbol.md) +**Reference**: [](go_to_class_and_go_to_symbol.md) ## Define a Helper Method for Generated PSI Elements To specify how a PSI element looks like in the Navigate | Symbol popup window, Structure tool window, or other components, it should implement `getPresentation()`. @@ -50,4 +50,4 @@ Run the plugin by using the Gradle [runIde task](gradle_prerequisites.md#running The IDE now supports navigating to a property definition by name pattern via Navigate | Symbol action. -![Go To Symbol](go_to_symbol.png){width="800"} \ No newline at end of file +![Go To Symbol](go_to_symbol.png){width="800"} diff --git a/topics/tutorials/custom_language_support/grammar_and_parser.md b/topics/tutorials/custom_language_support/grammar_and_parser.md index 774410470..fceacad4c 100644 --- a/topics/tutorials/custom_language_support/grammar_and_parser.md +++ b/topics/tutorials/custom_language_support/grammar_and_parser.md @@ -5,7 +5,7 @@ In order for the IntelliJ Platform to parse a Simple Language file, tokens and elements must be defined based on [`IElementType`](upsource:///platform/core-api/src/com/intellij/psi/tree/IElementType.java). The Simple Language grammar must also be defined to generate a parser. -**Reference**: [Implementing a Parser and PSI](implementing_parser_and_psi.md) +**Reference**: [](implementing_parser_and_psi.md) ## Define a Token Type Create `SimpleTokenType` in the `org.intellij.sdk.language.psi` package (see the `simple_language_plugin` code sample) by subclassing `IElementType`. @@ -66,4 +66,4 @@ Mark this folder as *Generated Sources Root* and make sure everything compiles w > {type="tip"} -![Parser](generated_parser.png){width="800"} \ No newline at end of file +![Parser](generated_parser.png){width="800"} diff --git a/topics/tutorials/custom_language_support/language_and_filetype.md b/topics/tutorials/custom_language_support/language_and_filetype.md index 384f7937d..ba7990d65 100644 --- a/topics/tutorials/custom_language_support/language_and_filetype.md +++ b/topics/tutorials/custom_language_support/language_and_filetype.md @@ -6,7 +6,7 @@ The IntelliJ Platform determines file type by examining the name of a file. Each language has [Language](upsource:///platform/core-api/src/com/intellij/lang/Language.java) and [LanguageFileType](upsource:///platform/core-api/src/com/intellij/openapi/fileTypes/LanguageFileType.java) objects defining the language. Register the `LanguageFileType` with the IntelliJ Platform in the plugin configuration file. -**Reference**: [Registering a File Type](registering_file_type.md) +**Reference**: [](registering_file_type.md) ## Define the Language The language implemented in this tutorial is named "Simple" - note the case of the name. diff --git a/topics/tutorials/custom_language_support/lexer_and_parser_definition.md b/topics/tutorials/custom_language_support/lexer_and_parser_definition.md index e4ee99868..afd8d880a 100644 --- a/topics/tutorials/custom_language_support/lexer_and_parser_definition.md +++ b/topics/tutorials/custom_language_support/lexer_and_parser_definition.md @@ -5,7 +5,7 @@ The lexical analyzer defines how the contents of a file are broken into tokens, which is the basis for supporting custom language features. The easiest way to create a lexer is to use [JFlex](https://jflex.de/). -**Reference**: [Implementing Lexer](implementing_lexer.md) +**Reference**: [](implementing_lexer.md) ## Required Project Configuration Change The previous tutorial step [Grammar and Parser](grammar_and_parser.md), and this page, generate source files in the directory `src/main/gen`. @@ -20,7 +20,7 @@ Or the following line in the project's `build.gradle.kts` file: sourceSets["main"].java.srcDirs("src/main/gen") ``` -Reload the Gradle project for changes to take effect. +Reload the Gradle project for changes to take effect. ## Define a Lexer Define a `Simple.flex` file with rules for the Simple Language lexer, as demonstrated in `org.intellij.sdk.language.Simple.flex`. @@ -101,4 +101,4 @@ tab : \u0009 Now open the *PsiViewer* tool window and check how the lexer breaks the content of the file into tokens, and the parser parsed the tokens into PSI elements. -![PSI Elements](psi_elements.png) \ No newline at end of file +![PSI Elements](psi_elements.png) diff --git a/topics/tutorials/custom_language_support/quick_fix.md b/topics/tutorials/custom_language_support/quick_fix.md index 090ae8389..e35d023ba 100644 --- a/topics/tutorials/custom_language_support/quick_fix.md +++ b/topics/tutorials/custom_language_support/quick_fix.md @@ -5,7 +5,7 @@ A quick fix for a custom language supports the IntelliJ Platform-based IDE feature [Intention Actions](https://www.jetbrains.com/help/idea/intention-actions.html#apply-intention-actions). For the Simple Language, this tutorial adds a quick fix that helps to define an unresolved property from its usage. -**Reference**: [Code Inspections and Intentions](code_inspections_and_intentions.md) +**Reference**: [](code_inspections_and_intentions.md) ## Update the Element Factory The `SimpleElementFactory` is updated to include two new methods to support the user choice of creating a new property for the Simple Language quick fix. diff --git a/topics/tutorials/custom_language_support/reference_contributor.md b/topics/tutorials/custom_language_support/reference_contributor.md index ac72353e0..cdda36634 100644 --- a/topics/tutorials/custom_language_support/reference_contributor.md +++ b/topics/tutorials/custom_language_support/reference_contributor.md @@ -9,7 +9,7 @@ Resolving references means the ability to go from the usage of an element to its > {type="note"} -**Reference**: [References and Resolve](references_and_resolve.md), [PSI References](psi_references.md) +**Reference**: [](references_and_resolve.md), [](psi_references.md) ## Define a Named Element Class The classes below show how the Simple Language fulfills the need to implement `PsiNamedElement`. @@ -162,4 +162,4 @@ Run the project by using the Gradle [runIde task](gradle_prerequisites.md#runnin The IDE now supports [refactoring](https://www.jetbrains.com/help/idea/rename-refactorings.html) suggestions: -![In Place Rename](in_place_rename.png){width="800"} \ No newline at end of file +![In Place Rename](in_place_rename.png){width="800"} diff --git a/topics/tutorials/custom_language_support/structure_view_factory.md b/topics/tutorials/custom_language_support/structure_view_factory.md index 15de932d6..8d77c9430 100644 --- a/topics/tutorials/custom_language_support/structure_view_factory.md +++ b/topics/tutorials/custom_language_support/structure_view_factory.md @@ -5,7 +5,7 @@ The structure view can be customized for a specific file type. Creating a structure view factory allows showing the structure of any file in a _Structure_ Tool Window for easy navigation between items in the current editor. -**Reference**: [Structure View](structure_view.md) +**Reference**: [](structure_view.md) ## Define a Structure View Factory The structure view factory implements [`PsiStructureViewFactory`](upsource:///platform/editor-ui-api/src/com/intellij/lang/PsiStructureViewFactory.java). @@ -49,4 +49,4 @@ Run the project by using the Gradle [runIde task](gradle_prerequisites.md#runnin Open the `test.simple` file and choose **View \| Tool Windows \| Structure**. The IDE now supports a structure view of the Simple Language: -![Structure View](structure_view.png) \ No newline at end of file +![Structure View](structure_view.png) diff --git a/topics/tutorials/custom_language_support/syntax_highlighter_and_color_settings_page.md b/topics/tutorials/custom_language_support/syntax_highlighter_and_color_settings_page.md index eed518a60..90c4bd6bc 100644 --- a/topics/tutorials/custom_language_support/syntax_highlighter_and_color_settings_page.md +++ b/topics/tutorials/custom_language_support/syntax_highlighter_and_color_settings_page.md @@ -6,7 +6,7 @@ The first level of syntax highlighting is based on the lexer output, and is prov A plugin can also define color settings based on `ColorSettingPage` so the user can configure highlight colors. The `SimpleSyntaxHighlighter`, `SimpleSyntaxHighlighterFactory`, and `SimpleColorSettingsPage` discussed on this page are demonstrated in the `simple_language_plugin` code sample. -**Reference**: [Syntax Highlighting and Error Highlighting](syntax_highlighting_and_error_highlighting.md) +**Reference**: [](syntax_highlighting_and_error_highlighting.md) ## Define a Syntax Highlighter The Simple Language syntax highlighter class extends [`SyntaxHighlighterBase`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/fileTypes/SyntaxHighlighterBase.java). @@ -64,4 +64,4 @@ Run the project by using the Gradle [runIde task](gradle_prerequisites.md#runnin In the IDE Development Instance, open the Simple Language highlight settings page: Settings/Preferences | Editor | Color Scheme | Simple. Each color initially inherits from a Language Defaults value. -![Color Settings Page](color_settings_page.png) \ No newline at end of file +![Color Settings Page](color_settings_page.png)