mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
code blocks: use properties
language
This commit is contained in:
parent
fb3d2c1c1a
commit
6b26006b86
@ -85,9 +85,10 @@ While `SimpleProperty` elements will provide us with their key and value, we hav
|
|||||||
Since we would like to show this comment in the documentation as well, we need a small helper function that extracts the text from the comment.
|
Since we would like to show this comment in the documentation as well, we need a small helper function that extracts the text from the comment.
|
||||||
This function will reside in the `SimpleUtil` class and will find, for instance, the comment preceding `apikey` in the following short example:
|
This function will reside in the `SimpleUtil` class and will find, for instance, the comment preceding `apikey` in the following short example:
|
||||||
|
|
||||||
```text
|
```properties
|
||||||
#An application programming interface key (API key) is a unique identifier
|
# An application programming interface key (API key) is a unique
|
||||||
#used to authenticate a user, developer, or calling program to an API.
|
# identifier used to authenticate a user, developer, or calling
|
||||||
|
# program to an API.
|
||||||
apikey=ph342m91337h4xX0r5k!11Zz!
|
apikey=ph342m91337h4xX0r5k!11Zz!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@ Define a formatter that removes extra spaces except for the single spaces around
|
|||||||
|
|
||||||
<compare type="top-bottom">
|
<compare type="top-bottom">
|
||||||
|
|
||||||
```
|
```properties
|
||||||
foo = bar
|
foo = bar
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```properties
|
||||||
foo = bar
|
foo = bar
|
||||||
```
|
```
|
||||||
</compare>
|
</compare>
|
||||||
|
@ -101,7 +101,7 @@ Run the plugin by using the Gradle [`runIde`](creating_plugin_project.md#running
|
|||||||
|
|
||||||
Create a <path>test.simple</path> file with the following content:
|
Create a <path>test.simple</path> file with the following content:
|
||||||
|
|
||||||
```text
|
```properties
|
||||||
# You are reading the ".properties" entry.
|
# You are reading the ".properties" entry.
|
||||||
! The exclamation mark can also mark text as comments.
|
! The exclamation mark can also mark text as comments.
|
||||||
website = https://en.wikipedia.org/
|
website = https://en.wikipedia.org/
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
Create the <path>DefaultTestData.simple</path> file in the <path>testData</path> directory.
|
Create the <path>DefaultTestData.simple</path> file in the <path>testData</path> directory.
|
||||||
This file contains test Simple language properties that will be completed in a test Java file (see the `Test` class later in this section).
|
This file contains test Simple language properties that will be completed in a test Java file (see the `Test` class later in this section).
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/DefaultTestData.simple"}
|
{src="simple_language_plugin/src/test/testData/DefaultTestData.simple"}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
## Define the Test Data
|
## Define the Test Data
|
||||||
Create the <path>FindUsagesTestData.simple</path> file in the <path>testData</path> directory.
|
Create the <path>FindUsagesTestData.simple</path> file in the <path>testData</path> directory.
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/FindUsagesTestData.simple"}
|
{src="simple_language_plugin/src/test/testData/FindUsagesTestData.simple"}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ See also [`FormatterTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/p
|
|||||||
## Define Test Data
|
## Define Test Data
|
||||||
Create the <path>FormatterTestData.simple</path> file in the <path>testData</path> directory.
|
Create the <path>FormatterTestData.simple</path> file in the <path>testData</path> directory.
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/FormatterTestData.simple"}
|
{src="simple_language_plugin/src/test/testData/FormatterTestData.simple"}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ private recover_property ::= !(KEY|SEPARATOR|COMMENT)
|
|||||||
Create the <path>ParsingTestData.simple</path> properties file in the <path>testData</path> folder.
|
Create the <path>ParsingTestData.simple</path> properties file in the <path>testData</path> folder.
|
||||||
Note the last few lines define a purposely incorrect key.
|
Note the last few lines define a purposely incorrect key.
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/ParsingTestData.simple"}
|
{src="simple_language_plugin/src/test/testData/ParsingTestData.simple"}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ Use the <control>Copy PSI</control> button to copy the expected PSI structure to
|
|||||||
## Define the Output Reference Test Data
|
## Define the Output Reference Test Data
|
||||||
Create a file <path>ParsingTestData.txt</path> with the copied PSI tree.
|
Create a file <path>ParsingTestData.txt</path> with the copied PSI tree.
|
||||||
|
|
||||||
```text
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/ParsingTestData.txt"}
|
{src="simple_language_plugin/src/test/testData/ParsingTestData.txt"}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
## Define Input Test Data
|
## Define Input Test Data
|
||||||
Create the <path>RenameTestData.simple</path> properties file in the <path>testData</path> directory.
|
Create the <path>RenameTestData.simple</path> properties file in the <path>testData</path> directory.
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/RenameTestData.simple"}
|
{src="simple_language_plugin/src/test/testData/RenameTestData.simple"}
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ Create the <path>RenameTestDataAfter.simple</path> file in the <path>testData</p
|
|||||||
This file contains the expected outcome of the test.
|
This file contains the expected outcome of the test.
|
||||||
Note the `website =` in <path>RenameTestData.simple</path> should be renamed to `websiteUrl =` by the test.
|
Note the `website =` in <path>RenameTestData.simple</path> should be renamed to `websiteUrl =` by the test.
|
||||||
|
|
||||||
```bash
|
```properties
|
||||||
```
|
```
|
||||||
{src="simple_language_plugin/src/test/testData/RenameTestDataAfter.simple"}
|
{src="simple_language_plugin/src/test/testData/RenameTestDataAfter.simple"}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user