Skip to content
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

Support returning cursor offset #477

Open
mkdynamic opened this issue Jan 18, 2023 · 1 comment
Open

Support returning cursor offset #477

mkdynamic opened this issue Jan 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@mkdynamic
Copy link
Contributor

mkdynamic commented Jan 18, 2023

I have monkey patched locally (see below), but would be great to have a better solution upstream. Any ideas on how to include support for this in a nicer way?

async function run(cwd, { args, clientEnv }, text) {
    //...

    const opts = {
        ...options,
        filepath: fullPath
    };

    return JSON.stringify(prettier.formatWithCursor(text, opts));
}
@fsouza
Copy link
Owner

fsouza commented Jan 18, 2023

I assume you'd need to provide the cursor position somehow? And then return the updated position to the caller.

@fsouza fsouza added the enhancement New feature or request label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants