Skip to content

Commit

Permalink
Add context to snippets
Browse files Browse the repository at this point in the history
Part of redhat-developer#265

Signed-off-by: Ryan Zegray <ryan.zegray@gmail.com>
  • Loading branch information
rzgry committed Mar 31, 2020
1 parent e3a5dcd commit 9974367
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "An annotation that contains the metadata information when requesting a metric to be injected or produced. This annotation can be used on fields of type Meter, Timer, Counter, and Histogram. For Gauge, the @Metric annotation can only be used on producer methods/fields."
"description": "An annotation that contains the metadata information when requesting a metric to be injected or produced. This annotation can be used on fields of type Meter, Timer, Counter, and Histogram. For Gauge, the @Metric annotation can only be used on producer methods/fields.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.Metric"
}
},
"@Counted": {
"prefix": [
Expand All @@ -22,7 +26,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a counter, which counts the invocations of the annotated object."
"description": "Denotes a counter, which counts the invocations of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.Counted"
}
},
"@Gauge": {
"prefix": [
Expand All @@ -34,7 +42,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a gauge, which samples the value of the annotated object."
"description": "Denotes a gauge, which samples the value of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.Gauge"
}
},
"@ConcurrentGauge": {
"prefix": [
Expand All @@ -46,7 +58,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a gauge which counts the parallel invocations of the annotated object."
"description": "Denotes a gauge which counts the parallel invocations of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.ConcurrentGauge"
}
},
"@Metered": {
"prefix": [
Expand All @@ -58,7 +74,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a meter, which tracks the frequency of invocations of the annotated object."
"description": "Denotes a meter, which tracks the frequency of invocations of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.Metered"
}
},
"@Timed": {
"prefix": [
Expand All @@ -70,7 +90,27 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a timer, which tracks duration of the annotated object."
"description": "Denotes a timer, which tracks duration of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.Timed"
}
},
"@SimplyTimed": {
"prefix": [
"@SimplyTimed"
],
"body": [
"@SimplyTimed(",
"\tname = \"${1:name}\",",
"\tdescription = \"${2:description}\"",
")"
],
"description": "Denotes a simple timer, which tracks duration and invocations of the annotated object.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.SimplyTimed"
}
},
"@RegistryType": {
"prefix": [
Expand All @@ -79,6 +119,10 @@
"body": [
"@RegistryType(type=$1)"
],
"description": "Qualifies the scope of Metric Registry to inject when injecting a MetricRegistry."
"description": "Qualifies the scope of Metric Registry to inject when injecting a MetricRegistry.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.metrics.annotation.RegistryType"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"\tdescription = \"${2:description}\"",
")"
],
"description": "Describes an operation or typically a HTTP method against a specific path."
"description": "Describes an operation or typically a HTTP method against a specific path.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Operation"
}
},
"@Content": {
"prefix": [
Expand All @@ -19,7 +23,11 @@
"body": [
"@Content(mediaType = \"${1:text/plain}\")"
],
"description": "Provides media type"
"description": "Provides media type",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Content"
}
},
"@Content with Schema": {
"prefix": [
Expand All @@ -31,7 +39,11 @@
"\tschema = $2",
")"
],
"description": "Provides schema and examples for a particular media type."
"description": "Provides schema and examples for a particular media type.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Content"
}
},
"@Schema with implementation": {
"prefix": [
Expand All @@ -40,7 +52,11 @@
"body": [
"@Schema(implementation = $1)"
],
"description": "Allows the definition of input and output data types."
"description": "Allows the definition of input and output data types.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Schema"
}
},
"@Schema with type": {
"prefix": [
Expand All @@ -49,7 +65,11 @@
"body": [
"@Schema(type = $1)"
],
"description": "Allows the definition of input and output data types."
"description": "Allows the definition of input and output data types.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Schema"
}
},
"@Schema with implementation and type": {
"prefix": [
Expand All @@ -61,7 +81,11 @@
"\ttype = $2",
")"
],
"description": "Allows the definition of input and output data types."
"description": "Allows the definition of input and output data types.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Schema"
}
},
"@Parameters": {
"prefix": [
Expand All @@ -73,7 +97,11 @@
"\t}",
")"
],
"description": "Encapsulates input parameters."
"description": "Encapsulates input parameters.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Parameters"
}
},
"@Parameter": {
"prefix": [
Expand All @@ -87,7 +115,11 @@
"\tschema = $4",
")"
],
"description": "Describes a single operation parameter."
"description": "Describes a single operation parameter.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.Parameter"
}
},
"@APIResponses": {
"prefix": [
Expand All @@ -99,7 +131,11 @@
"\t}",
")"
],
"description": "A container for multiple responses from an API operation."
"description": "A container for multiple responses from an API operation.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.APIResponses"
}
},
"@APIResponse": {
"prefix": [
Expand All @@ -113,6 +149,10 @@
"\tschema = $4",
")"
],
"description": "Describes a single response from an API operation."
"description": "Describes a single response from an API operation.",
"context": {
"kind": "annotation",
"type": "org.eclipse.microprofile.openapi.annotations.APIResponse"
}
}
}

0 comments on commit 9974367

Please sign in to comment.