Quick Touch

A Visual Studio Code extension for creating files and nested directory structures instantly from the command palette without reaching for the mouse.

Demo

The Problem

When working in large codebases within Visual Studio Code, creating new files or nested folders via the Explorer sidebar often interrupts developer flow. You have to take your hands off the keyboard, navigate deep folder trees, and manually create parent directories one by one. I wanted to build a developer tool that:

  • Lets developers create files and entire nested path hierarchies instantly from the command palette.
  • Automatically creates missing parent directories on the fly without failing.
  • Provides a keyboard-first workflow that keeps developers focused on writing code.

Architecture & Tech Stack

The extension is built using TypeScript and the official Visual Studio Code Extension API, cleanly separating UI inputs from underlying file-system operations:

  • Language: TypeScript (Strict mode) for type-safe extension development.
  • Runtime API: VSCode Extension API (vscode.window, vscode.workspace, vscode.Uri) for command registration, input boxes, and workspace integration.
  • Core Modules:
    • extension.ts: Handles lifecycle activation, command registration (quickTouch.newFile), and user prompts.
    • FileSystemManager.ts: Manages recursive directory creation and file writing safely across platforms.
    • FileNavigator.ts: Handles workspace path resolution and contextual path determination based on active editor tabs.
  • Testing: Integration testing suite using @vscode/test-electron and Mocha (src/test/extension.test.ts).

Key Challenges Solved

1. Recursive Nested Directory Creation

Users often type deep paths like src/components/shared/Modal.tsx where none of the parent folders exist yet.

  • Solution: Designed the FileSystemManager to parse path strings and recursively generate intermediate directories before creating the target file, ensuring seamless execution without throwing "directory not found" exceptions.

2. Context-Aware Path Resolution

Determining where a new file should be created when multiple workspace folders or split editor tabs are open can be ambiguous.

  • Solution: Implemented FileNavigator to intelligently detect the current active file's directory or fall back to the workspace root, making path entry intuitive and relative to the user's current working context.

3. Lightweight & Fast Execution

  • Solution: Minimized external dependencies and optimized activation events so the extension activates instantaneously only when invoked via the command palette or keyboard shortcuts.

Live Features & Capabilities

  • Instant Command Palette Access: Trigger file creation quickly using Quick Touch: New File from the command palette.
  • Nested Path Support: Automatically generates all missing parent folders from a single input string (e.g., app/api/auth/route.ts).
  • Contextual Working Directory: Smartly defaults to the currently opened file's directory to speed up sibling file creation.
  • Cross-Platform Compatibility: Works reliably across Windows, macOS, and Linux file systems.

What's Next?

  • Add mv and rn command to move and delete file or directory.