mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
simplify links
This commit is contained in:
parent
857f7a60c7
commit
276955ed78
@ -2,9 +2,9 @@
|
||||
|
||||
<!-- 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. -->
|
||||
|
||||
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.
|
||||
|
@ -7,7 +7,7 @@ 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
|
||||
|
@ -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).
|
||||
|
@ -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.
|
||||
|
@ -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 <menupath>Navigate | Symbol</menupath> popup window, <control>Structure</control> tool window, or other components, it should implement `getPresentation()`.
|
||||
|
@ -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`.
|
||||
|
@ -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.
|
||||
|
@ -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`.
|
||||
|
@ -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.
|
||||
|
@ -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`.
|
||||
|
@ -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).
|
||||
|
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user