Skip to content

Commit 2ef49b4

Browse files
committed
feat(ls): provide OpenAPI 3.0.x Tag completion rules
Refs #2032
1 parent d576d8d commit 2ef49b4

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import {
2+
ApidomCompletionItem,
3+
CompletionFormat,
4+
CompletionType,
5+
} from '../../../apidom-language-types';
6+
7+
const completion: ApidomCompletionItem[] = [
8+
{
9+
label: 'name',
10+
insertText: 'name',
11+
kind: 14,
12+
format: CompletionFormat.QUOTED,
13+
type: CompletionType.PROPERTY,
14+
insertTextFormat: 2,
15+
documentation: {
16+
kind: 'markdown',
17+
value: '**REQUIRED**. The name of the tag.',
18+
},
19+
},
20+
{
21+
label: 'description',
22+
insertText: 'description',
23+
kind: 14,
24+
format: CompletionFormat.QUOTED,
25+
type: CompletionType.PROPERTY,
26+
insertTextFormat: 2,
27+
documentation: {
28+
kind: 'markdown',
29+
value:
30+
'A description for the tag. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.',
31+
},
32+
},
33+
{
34+
label: 'externalDocs',
35+
insertText: 'externalDocs',
36+
kind: 14,
37+
format: CompletionFormat.OBJECT,
38+
type: CompletionType.PROPERTY,
39+
insertTextFormat: 2,
40+
documentation: {
41+
kind: 'markdown',
42+
value:
43+
'[External Documentation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this tag.',
44+
},
45+
targetSpecs: [
46+
{ namespace: 'openapi', version: '3.0.0' },
47+
{ namespace: 'openapi', version: '3.0.1' },
48+
{ namespace: 'openapi', version: '3.0.2' },
49+
{ namespace: 'openapi', version: '3.0.3' },
50+
],
51+
},
52+
];
53+
54+
export default completion;

packages/apidom-ls/src/config/openapi/tag/meta.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import completion from './completion';
12
import documentation from './documentation';
23
import { FormatMeta } from '../../../apidom-language-types';
34

45
const meta: FormatMeta = {
6+
completion,
57
documentation,
68
};
79

0 commit comments

Comments
 (0)