|
1 | 1 | import path from 'path'; |
2 | 2 | import { window } from 'vscode'; |
3 | 3 |
|
4 | | -import componentsSnippets, { |
5 | | - ComponentsSnippet, |
6 | | -} from '../sourceSnippets/components'; |
7 | | -import consoleSnippets, { ConsoleSnippet } from '../sourceSnippets/console'; |
8 | | -import hooksSnippets, { HooksSnippet } from '../sourceSnippets/hooks'; |
9 | | -import importsSnippets, { ImportsSnippet } from '../sourceSnippets/imports'; |
10 | | -import othersSnippets, { OthersSnippet } from '../sourceSnippets/others'; |
11 | | -import propTypesSnippets, { |
12 | | - PropTypesSnippet, |
13 | | -} from '../sourceSnippets/propTypes'; |
14 | | -import reactNativeSnippets, { |
15 | | - ReactNativeSnippet, |
16 | | -} from '../sourceSnippets/reactNative'; |
17 | | -import reduxSnippets, { ReduxSnippet } from '../sourceSnippets/redux'; |
18 | | -import testsSnippets, { TestsSnippet } from '../sourceSnippets/tests'; |
19 | | -import typescriptSnippets, { |
20 | | - TypescriptSnippet, |
21 | | -} from '../sourceSnippets/typescript'; |
| 4 | +import componentsSnippets from '../sourceSnippets/components'; |
| 5 | +import consoleSnippets from '../sourceSnippets/console'; |
| 6 | +import hooksSnippets from '../sourceSnippets/hooks'; |
| 7 | +import importsSnippets from '../sourceSnippets/imports'; |
| 8 | +import othersSnippets from '../sourceSnippets/others'; |
| 9 | +import propTypesSnippets from '../sourceSnippets/propTypes'; |
| 10 | +import reactNativeSnippets from '../sourceSnippets/reactNative'; |
| 11 | +import reduxSnippets from '../sourceSnippets/redux'; |
| 12 | +import testsSnippets from '../sourceSnippets/tests'; |
| 13 | +import typescriptSnippets from '../sourceSnippets/typescript'; |
| 14 | +import { Snippets } from '../snippetTypes'; |
22 | 15 | import { writeFile } from 'fs/promises'; |
23 | 16 |
|
24 | 17 | import extensionConfig from './extensionConfig'; |
@@ -49,34 +42,6 @@ const validateLanguageScopes = (scopes: string) => { |
49 | 42 | return valid.length > 0 ? valid.join(',') : VALID_LANGUAGE_SCOPES.join(','); |
50 | 43 | }; |
51 | 44 |
|
52 | | -export type SnippetKeys = |
53 | | - | OthersSnippet['key'] |
54 | | - | HooksSnippet['key'] |
55 | | - | ImportsSnippet['key'] |
56 | | - | ReactNativeSnippet['key'] |
57 | | - | TypescriptSnippet['key'] |
58 | | - | ReduxSnippet['key'] |
59 | | - | ComponentsSnippet['key'] |
60 | | - | ConsoleSnippet['key'] |
61 | | - | PropTypesSnippet['key'] |
62 | | - | TestsSnippet['key']; |
63 | | - |
64 | | -export type Snippet = |
65 | | - | OthersSnippet |
66 | | - | HooksSnippet |
67 | | - | ImportsSnippet |
68 | | - | ReactNativeSnippet |
69 | | - | TypescriptSnippet |
70 | | - | ReduxSnippet |
71 | | - | ComponentsSnippet |
72 | | - | ConsoleSnippet |
73 | | - | PropTypesSnippet |
74 | | - | TestsSnippet; |
75 | | - |
76 | | -export type Snippets = { |
77 | | - [key in SnippetKeys]: Snippet; |
78 | | -}; |
79 | | - |
80 | 45 | const getSnippets = () => { |
81 | 46 | const { typescript, languageScopes: rawScopes } = extensionConfig(); |
82 | 47 | const languageScopes = validateLanguageScopes(rawScopes); |
|
0 commit comments