-
Notifications
You must be signed in to change notification settings - Fork 2
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 new languages #40
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
55574e6
to
bb658bb
Compare
0a78e34
to
3d37617
Compare
b46931f
to
a5c1b14
Compare
const { hardline, group, line, softline, indent } = builders; | ||
const { mapDoc } = utils; | ||
|
||
export const embedder: Embedder<Options> = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with the code base, but can these functions be refactored as a common factory? I saw almost same codes for every plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For most of the plugins, they're basically the same. But there're some plugins that need custom tweaking. I'll see what I can do to avoid most of the redundant code.
3bdad92
to
3378021
Compare
e534a43
to
3feb677
Compare
uses `prettier-plugin-latex`
uses `prettier-plugin-properties`
3feb677
to
061a54d
Compare
Is there a hope of getting a new release soon (like within a week) with all these new languages? I'd like to try it out, but wondering whether I should just wait a bit or should I pull this repo and fiddle around with it. |
@nene Sorry for the delay, my mind is currently occupied by another project. I'll make some cleanups and hopefully release a new version in 48 hrs. |
@Sec-ant You'd better find some collaborators. I've just posted this repo into the private prettier Discord channel. |
@nene You should be able to test the Note that the default sql plugin used for embedded SQL language formatting is still {
"plugins": ["prettier-plugin-sql-cst", "prettier-plugin-embed"],
"embeddedSqlIdentifiers": ["sql"],
"embeddedSqlPlugin": "prettier-plugin-sql-cst",
"embeddedSqlParser": "sqlite",
"sqlKeywordCase": "upper",
} And then you should be able to format code blocks that look like this: /* sql */`
ATTACH DATABASE 'my_file.sqlite' AS my_schema
` or this: sql`
ATTACH DATABASE 'my_file.sqlite' AS my_schema
` If you need other strings to be recognized as identifiers, like {
"embeddedSqlIdentifiers": ["sql", "sqlite", "bigquery"],
} I know the documentation of this plugin is still very immature and in early stage. If you have any questions regarding how to use this plugin, feel free to ask me. Comments, new issues, everywhere is ok. I see there're new parsers getting supported in
|
Or is that possible to generate those information via cc @nene |
Thanks. I'll be playing around with it and will report if I run into issues.
I find the documentation to be great. Considering this plugin is just a few months old, I'd say the docs are spectacular. |
toml
(usesprettier-plugin-toml
). Thanks @JounQin @so1veini
(usesprettier-plugin-ini
). Thanks @kddnewtonlatex
(usesprettier-plugin-latex
). Thanks @siefkenjproperties
(usesprettier-plugin-properties
). Thanks @eemeliyaml
(no plugins required). Thanks @ikatyangjson
(no plugins required).graphql
(no plugins required).sh
(usesprettier-plugin-sh
). Thanks @JounQinsql
): addprettier-plugin-sql-cst
. Thanks @nene👇 Use the package built by codesandbox-ci below to test the new languages support.