(fileName: string, snippet: VSCodeSnippetValue)
| 73 | } |
| 74 | |
| 75 | function inferLanguage(fileName: string, snippet: VSCodeSnippetValue): string { |
| 76 | if (typeof snippet.scope === 'string' && snippet.scope.trim()) { |
| 77 | return snippet.scope.split(',')[0].trim() |
| 78 | } |
| 79 | |
| 80 | const baseName = path.basename(fileName) |
| 81 | if (baseName.endsWith('.code-snippets')) { |
| 82 | return 'plain_text' |
| 83 | } |
| 84 | |
| 85 | if (baseName.endsWith('.json')) { |
| 86 | const language = path.basename(baseName, '.json') |
| 87 | return LANGUAGE_FILE_NAMES.has(language) ? language : 'plain_text' |
| 88 | } |
| 89 | |
| 90 | return 'plain_text' |
| 91 | } |
| 92 | |
| 93 | function getPrefixTags(prefix: unknown): string[] { |
| 94 | if (typeof prefix === 'string') { |
no outgoing calls
no test coverage detected