-
Notifications
You must be signed in to change notification settings - Fork 1
Claude/custom file extensions 01 lh d3jpyebr ec f34tfrua5y #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Claude/custom file extensions 01 lh d3jpyebr ec f34tfrua5y #129
Conversation
- Add new fileNameHelpers utility with extension detection and sanitization - Extract and preserve common file extensions (.sh, .py, .js, etc.) when provided by user - Fall back to default .md extension when no extension is provided - Update createNoteFromTemplate to use new sanitization logic - Update getCategoryFolderPath to preserve extensions - Add comprehensive test suite with 20 unit tests Fixes issue where creating "example.sh" would create "examplesh.md" instead of "example.sh" BREAKING CHANGE: None - maintains backward compatibility with default behavior
Resolved conflict in src/extension.ts by adopting the logger service from main branch, replacing console.log statements with proper structured logging. Changes merged from main: - New logService.ts with structured logging - Updated extension.ts to use logger service - CHANGELOG.md updates - package.json updates
Summary of ChangesHello @jsonify, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the note-taking extension by allowing users to define custom file extensions for their notes. It achieves this by refactoring filename sanitization into a new, dedicated utility module, which intelligently parses user input to preserve explicit extensions while applying standard sanitization rules. This change improves user flexibility and maintains data integrity by ensuring filenames are always valid and consistently formatted. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable feature by allowing users to specify custom file extensions when creating notes. The implementation correctly centralizes the filename sanitization logic into a new, well-tested utility file (fileNameHelpers.ts). My review focuses on removing leftover debugging code that would negatively impact the user experience and code maintainability. I've also pointed out an opportunity to improve an import statement for consistency and an unused function that should be removed to keep the codebase clean.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Remove logger import from fileNameHelpers.ts - Remove logger.info calls from sanitizeFileName - Remove logger import and calls from noteService.ts createNoteFromTemplate - Remove unused buildFileName function per code review - All 599 unit tests now passing
329d656 to
6cdfac4
Compare
🎯 Summary
This PR enhances the note creation system with support for custom file extensions and comprehensive debugging capabilities. Users can
now specify file extensions when creating notes (e.g., .py, .js, .json), and the extension includes detailed logging to improve
troubleshooting.
✨ Key Features
📄 Custom File Extension Support
🔍 Enhanced Debugging & Logging
🛠️ Technical Changes
New Files
Modified Files
📊 Test Coverage
🚀 Use Cases
// Create Python script note
noted.openWithTemplate("data-processor.py", "quick")
// Create JavaScript config
noted.openWithTemplate("webpack.config.js", "research")
// Create JSON data file
noted.openWithTemplate("settings.json", "problem-solution")
📝 Testing Instructions
🔗 Related Issues
Addresses user request for custom file extension support while improving debuggability of the extension.