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

Reloading / Restarting Window is the only way to apply config file #584

Closed
webberwang opened this issue Sep 18, 2018 · 8 comments
Closed
Labels
locked Please open a new issue and fill out the template instead of commenting. need-more-info

Comments

@webberwang
Copy link

webberwang commented Sep 18, 2018

I'm using a .prettierrc.yml config at project root to override my Workspace Settings. But whenever I edit the setting, the only way for VSCode to pick up those new settings is to reload the project.

VSCode: 1.27.2
Prettier: 1.6.1

@RobinMalfait
Copy link
Contributor

Is this actually an issue? I mean, how many times do you change your settings on a daily basis?

@webberwang
Copy link
Author

Well the rationale is that if Workspace Settings apply without reloading the window manually, you would expect the prettier configs to do the same.

It's 1 extra factor someone setting up the config will have to test for when something doesn't work. Also it may not be a huge factor after you have already determined all your settings, but during the process of testing those rules, it becomes very cumbersome to reload every time.

@CiGit
Copy link
Member

CiGit commented Oct 2, 2018

When we detect a change in a config file we empty prettier's config cache.
Please share your other settings and on what kind of file this fails

@jondkinney
Copy link

I'm seeing this same issue on a fresh install of VSCode (Version 1.30.1) on macOS Mojave (10.14.1). When I edit a setting in .prettierrc, for example printWidth, it doesn't pickup the change until I restart VSCode.

Also, I see the detecting a change code includes all prettier config formats:

const PRETTIER_CONFIG_FILES = [
    '.prettierrc',
    '.prettierrc.json',
    '.prettierrc.yaml',
    '.prettierrc.yml',
    '.prettierrc.js',
    'package.json',
    'prettier.config.js',
];

However, the plugin doesn't seem to actually support all of those file formats. For instance, I can't get prettierrc.js to be recognized at all. I know that's a different issue, but wanted to mention it in this context / thread since the "detecting the change" code seems related and like it's watching for changes that the overall plugin doesn't fully support, which seems odd.

@dquist
Copy link

dquist commented Mar 13, 2019

Yes, .prettierrc.js does not seem to be a valid configuration (even though it's watched), whereas .prettierrc.json does, however even with the json config a window reload is required.

@no-response
Copy link

no-response bot commented Aug 9, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

@no-response no-response bot closed this as completed Aug 9, 2019
@igorakkerman
Copy link

I'd like to re-open this issue. .prettierrc does not seem to be watched, the configuration is not reloaded when the file changes.

VSCode 1.44.0
Windows 10
Prettier 2.0.4
Prettier Plugin Svelte 0.7.0
VSCode Svelte plugin 0.9.3

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Jul 10, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting. need-more-info
Projects
None yet
Development

No branches or pull requests

6 participants