File size: 450 Bytes
7a1ad33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import { getLanguageFromFilePath } from '../utils/language-detection.js';

export function getProgrammingLanguage(
  args: Record<string, unknown>,
): string | undefined {
  const filePath = args['file_path'] || args['path'] || args['absolute_path'];
  if (typeof filePath === 'string') {
    return getLanguageFromFilePath(filePath);
  }
  return undefined;
}