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

feat: add default formatter question on initialize #790

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

khaosdoctor
Copy link

This is a proposed solution to #789.

fixes #789

fix Deno.fmt seems not to be executing by default denoland#789

Signed-off-by: Lucas Santos <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Jan 15, 2023

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Lucas Santos <[email protected]>
@@ -78,6 +78,7 @@ export function initializeWorkspace(
try {
const settings = await pickInitWorkspace();
const config = vscode.workspace.getConfiguration(EXTENSION_NS);
const languageSpecificConfigs = await Promise.all(["typescript", "typescriptreact"].map(async (languageId) => vscode.workspace.getConfiguration("", { languageId })))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Did this because, since language specifics are not namespaced by the extension settings, we couldn't really rely on the other variable since it would return nothing. So I added it as an array in case we need to add more support (JS, JSX) in the future, so this would be very easy to do.

Also, in case we need to change any other language-specific configs in the future we just need to iterate through it again.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @khaosdoctor, I modified it a bit. Fresh started adding these settings by default in denoland/fresh#1431 so I think it totally makes sense to add it.

@dsherret are you fine with this PR?

@khaosdoctor
Copy link
Author

Yay! Thanks for merging!

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

Successfully merging this pull request may close these issues.

Add formatter settings on workspace initialization
4 participants