@nogataka/smart-edit 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import { loadYaml, saveYaml } from '../util/general.js';
7
7
  import { determineProgrammingLanguageComposition } from '../util/inspection.js';
8
8
  import { singleton } from '../util/class_decorators.js';
9
9
  import { ToolRegistry } from '../tools/tools_base.js';
10
- import { Language, coerceLanguage } from '../../smart-lsp/ls_config.js';
10
+ import { Language, coerceLanguage, listLanguages, getLanguageFilenameMatcher } from '../../smart-lsp/ls_config.js';
11
11
  const { logger: log } = createSmartEditLogger({ name: 'smart-edit.config' });
12
12
  export class ToolInclusionDefinition {
13
13
  excludedTools;
@@ -259,7 +259,11 @@ export class ProjectConfig extends ToolInclusionDefinition {
259
259
  const name = options.projectName ?? path.basename(resolvedRoot);
260
260
  let language = options.projectLanguage;
261
261
  if (!language) {
262
- const composition = determineProgrammingLanguageComposition(resolvedRoot);
262
+ const languageDefinitions = listLanguages().map((lang) => ({
263
+ name: lang,
264
+ matcher: getLanguageFilenameMatcher(lang)
265
+ }));
266
+ const composition = determineProgrammingLanguageComposition(resolvedRoot, { languages: languageDefinitions });
263
267
  const entries = Object.entries(composition);
264
268
  if (entries.length === 0) {
265
269
  const relativePath = path.join(resolvedRoot, this.relPathToProjectYml());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nogataka/smart-edit",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Smart Edit is a tool for editing code with AI.",
5
5
  "private": false,
6
6
  "license": "MIT",