(path: string, extension = '', name = '')
| 178 | }; |
| 179 | |
| 180 | export const resolveEditorLanguage = (path: string, extension = '', name = '') => { |
| 181 | if (isSpecialEditorFileName(name)) { |
| 182 | return 'dockerfile'; |
| 183 | } |
| 184 | |
| 185 | const candidates = [extension, path.split('/').pop() || ''] |
| 186 | .map((value) => normalizeEditorExtension(value)) |
| 187 | .filter(Boolean); |
| 188 | |
| 189 | for (const ext of candidates) { |
| 190 | const language = editorLanguages.get(ext); |
| 191 | if (language) { |
| 192 | return language; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | const fileName = path.split('/').pop() || ''; |
| 197 | if (isSpecialEditorFileName(fileName)) { |
| 198 | return 'dockerfile'; |
| 199 | } |
| 200 | |
| 201 | return 'yaml'; |
| 202 | }; |
nothing calls this directly
no test coverage detected