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

Error during output formatting: Couldn't resolve parser "rust-parse" #29

Open
vladilen11 opened this issue Aug 31, 2023 · 0 comments
Open

Comments

@vladilen11
Copy link

Input code

import * as prettier from "prettier";
import * as rustPlugin from "prettier-plugin-rust";

export async function formatMove(content: string, prettierConfigPath?: string): Promise<string> {
  let config;
  if (prettierConfigPath) {
    config = await prettier.resolveConfig(prettierConfigPath);
  }
  try {
    return prettier.format(content, {
      plugins: [rustPlugin],
      parser: "rust-parse",

      printWidth: 120,
      semi: true,
      tabWidth: 2,
      useTabs: false,
      bracketSpacing: true,

      ...config,
    });
  } catch (error) {
    let message;
    if (error instanceof Error) {
      message = error.message;
    } else {
      message = error;
    }
    console.log(chalk.yellow(`Error during output formatting: ${message}`));
    return content;
  }
}

Output code

Error during output formatting: Couldn't resolve parser "rust-parse"
Promise {

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant