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

Selective Formatting not working #178

Open
amitkumarj1979 opened this issue Feb 19, 2020 · 4 comments
Open

Selective Formatting not working #178

amitkumarj1979 opened this issue Feb 19, 2020 · 4 comments

Comments

@amitkumarj1979
Copy link

# Prettier options (if any):
Default

**Input:**
cls file - Selected Text

```apex
// code snippet
```errorList.addAll(validateField(contact.FirstName, objectName, 'First Name', 0));


**Actual output:**
```errorList.addAll(validateField(contact.FirstName, objectName, 'First Name', 0));

```apex
// code snippet

Expected output:

            validateField(contact.FirstName, objectName, 'First Name', 0)
        );


```apex
// code snippet

Additional information (please fill this out):

  • OS: [e.g. Windows/OS X/Ubuntu]
  • Version: [e.g. 1.0.0]
    mac 10.14.6
@dangmai
Copy link
Owner

dangmai commented Feb 19, 2020

Hi, thank you for submitting your issue. Currently there are some issues with formatting in your post, so I can't really tell what is not working right. Could you reformat it, or describe it in some way?

@amitkumarj1979
Copy link
Author

Sorry, the issue is if I try to Format the complete file the formatting works, But it does not work with Selective text. Example : I select a block of code

errorList.addAll(validateField(contact.FirstName, objectName, 'First Name', 0));

Nothing happens and I get an error in the VS Code status bar as Extension Prettier cannot format the file.

Does this help ?

@dangmai
Copy link
Owner

dangmai commented Feb 19, 2020

Oh I see, thank you for the explanation, that helps a lot. I think this is actually a feature request for Range Formatting support by this plugin. I will take a look at this soon.

@dangmai
Copy link
Owner

dangmai commented Feb 19, 2020

I have looked into this, and unfortunately Prettier does not allow its plugins to do this at the moment. I have opened an issue upstream here, and when that is resolved I will make sure prettier-plugin-apex supports it.

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

2 participants