Skip to content

Have cursor end in a logical spot after the snippet is created. #2

Open
@agillispie

Description

Feature Request: Enhanced Cursor Placement for useState and useEffect Snippets

Description

When generating snippets for useState and useEffect using the Actual React Emmet extension, it would significantly enhance the developer experience if the cursor were automatically positioned within the snippet's editable area. Specifically, for useState, the cursor should be inside the parentheses to quickly set the initial value. For useEffect, it should be inside the code block to immediately write the effect's logic.

Expected Behavior

  • useState: After triggering a useState snippet (e.g., usestate.counter), the cursor should be placed inside the parentheses of useState(), allowing the user to immediately type the initial state value.
  • useEffect: For useEffect snippets, including both synchronous and asynchronous (e.g., useeffect.loadData or useeffect.loadData.async), the cursor should be placed inside the effect's function body, ready for the developer to start typing the logic.

This feature request aims to streamline the coding workflow, reducing the need for additional keystrokes or mouse clicks to navigate to the correct position in the snippet. It aligns with the goal of the Actual React Emmet extension to enhance productivity and ease of use.

PS I know I am opening an issue on my own codebase...i just don't want to forget about this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions