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

add prettier and prettyhtml for wxml formatter #23

Merged
merged 3 commits into from
Mar 17, 2019

Conversation

NewFuture
Copy link
Contributor

@NewFuture NewFuture commented Mar 17, 2019

related issues:

#11
#17
#19
#22

新增配置

  • minapp-vscode.wxmlFormatter string 三种可选,默认wxml
  • minapp-vscode.documentSelector string[] 自定义关联文件类型,
  • minapp-vscode.prettyHtml {} prettyhtml配置项
  • minapp-vscode.prettier {} prettier配置项

新增两者格式支持本地配置文件

  1. Prettier configuration file
  2. .editorconfig

@qiu8310
Copy link
Contributor

qiu8310 commented Mar 17, 2019

不应该污染 html 文件吧,要考虑下非小程序项目。如果是小程序项目可以建议用户将 html 转化成 wxml 格式

@NewFuture
Copy link
Contributor Author

对,这部分应该拿掉,
或者换成可配置

@qiu8310
Copy link
Contributor

qiu8310 commented Mar 17, 2019

那你先拿掉 html,我合下

@NewFuture
Copy link
Contributor Author

@qiu8310
Copy link
Contributor

qiu8310 commented Mar 17, 2019

还有个建议,配置使用哪个格式化工具应该写到里面去,不应该写在 extension.ts 这个入口文件中,因为配置可能随时更新,如果放在入口文件上了,更新了配置无法生效,需要重启 vscode

@NewFuture
Copy link
Contributor Author

嗯,热切换确实更好

@NewFuture
Copy link
Contributor Author

这样的话都得放在一个provider里?

@qiu8310
Copy link
Contributor

qiu8310 commented Mar 17, 2019

是的,一个 provider 里调用三个格式化的工具,这样还可以复用一些代码

@qiu8310 qiu8310 merged commit 813f693 into wx-minapp:master Mar 17, 2019
qiu8310 added a commit that referenced this pull request Mar 25, 2019
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.

2 participants