Skip to content

Commit

Permalink
fix: 🩹 enhance file handling messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelGil committed Jan 6, 2025
1 parent 3b09e40 commit 14654e7
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 21 deletions.
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.16.1] - 2025-01-06

### Fixed

- Enhance file handling messages in the `FileController` class.

## [1.16.0] - 2024-12-18

### Changed

- Improve export handling by separating type and value exports
- Improve configuration retrieval in `ExtensionConfig` class
- Update welcome messages with version info
- Improve export handling by separating type and value exports.
- Improve configuration retrieval in `ExtensionConfig` class.
- Update welcome messages with version info.

## [1.15.0] - 2024-12-16

Expand Down Expand Up @@ -160,7 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add basic functionality for generating barrel files.
- Add support for TypeScript and JavaScript projects.

[Unreleased]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.16.0...HEAD
[Unreleased]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.16.1...HEAD
[1.16.1]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.16.0...v1.16.1
[1.16.0]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.15.0...v1.16.0
[1.15.0]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.14.0...v1.15.0
[1.14.0]: https://github.com/ManuelGil/vscode-auto-barrel/compare/v1.13.0...v1.14.0
Expand Down
2 changes: 2 additions & 0 deletions l10n/bundle.l10n.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"Remember to update the barrel file": "Recuerda actualizar el archivo barrel",
"The file does not exist!": "¡El archivo no existe!",
"No files found in the folder!": "¡No se encontraron archivos en la carpeta!",
"The {0} folder is empty!": "¡La carpeta {0} está vacía!",
"No files found matching the specified patterns!": "¡No se encontraron archivos que coincidan con los patrones especificados!",
"The file has not been created!": "¡El archivo no ha sido creado!",
"File created successfully!": "¡Archivo creado con éxito!",
"File successfully updated!": "¡Archivo actualizado con éxito!",
Expand Down
24 changes: 22 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-auto-barrel",
"displayName": "Auto Barrel for VSCode",
"description": "🛢️ Automatically generate index files for your project.",
"version": "1.16.0",
"version": "1.16.1",
"icon": "icon.png",
"license": "MIT",
"publisher": "imgildev",
Expand All @@ -20,10 +20,30 @@
"auto",
"auto-barrel",
"barrel",
"barrels",
"create",
"default",
"deno",
"development",
"export",
"exports",
"extension",
"file",
"files",
"generate",
"generator",
"index.js",
"index.ts",
"index",
"typescript",
"javascript",
"js",
"module",
"modules",
"node.js",
"node",
"nodejs",
"typescript",
"ts",
"vscode"
],
"homepage": "https://github.com/ManuelGil/vscode-auto-barrel",
Expand Down
17 changes: 15 additions & 2 deletions src/app/controllers/files.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,21 @@ export class FilesController {

// If no files are found, return
if (files.length === 0) {
const message = l10n.t('No files found in the folder!');
window.showErrorMessage(message);
const relativePath = workspace.asRelativePath(folderPath);
const allFilesInFolder = await workspace.findFiles(
`${relativePath}/**/*`,
);

if (allFilesInFolder.length === 0) {
const message = l10n.t('The {0} folder is empty!', [folderPath]);
window.showWarningMessage(message);
} else {
const message = l10n.t(
'No files found matching the specified patterns!',
);
window.showWarningMessage(message);
}

return;
}

Expand Down
23 changes: 10 additions & 13 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,16 @@ export async function activate(context: vscode.ExtensionContext) {
'New version of {0} is available. Check out the release notes for version {1}',
[EXTENSION_DISPLAY_NAME, currentVersion],
);
const option = await vscode.window.showInformationMessage(
message,
...actions,
);

// Handle the actions
switch (option?.title) {
case actions[0].title:
vscode.env.openExternal(
vscode.Uri.parse(`${REPOSITORY_URL}/blob/main/CHANGELOG.md`),
);
break;
}
vscode.window.showInformationMessage(message, ...actions).then((option) => {
// Handle the actions
switch (option?.title) {
case actions[0].title:
vscode.env.openExternal(
vscode.Uri.parse(`${REPOSITORY_URL}/blob/main/CHANGELOG.md`),
);
break;
}
});

// Update the version in the global state
context.globalState.update('version', currentVersion);
Expand Down

0 comments on commit 14654e7

Please sign in to comment.