diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 438c4ed052c0..280485ba37bc 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -692,7 +692,7 @@ Previously, Prettier only supported the most common HTML entities, such as `&nbs [error] stdin: SyntaxError: Unknown entity "excl" - use the "&#;" or "&#x;" syntax (1:6) [error] > 1 |

Hi!

[error] | ^ -[error] 2 | +[error] 2 | --> @@ -1365,6 +1365,14 @@ const bigints = [200000n, 0x0000000an, 0b01111111n]; const bigints = [200_000n, 0x0000_000an, 0b0111_1111n]; ``` +#### VS Code: add support for .mongo files ([#6848] by [@aymericbouzy]) + +When using the Azure Cosmos DB extension for VS Code, you can create .mongo files to write MongoDB queries, which use Javascript syntax. This change allows VS Code to format your file using Prettier. + +```js +db.users.find({ someField: { $exists: true } }); +``` + [#5682]: https://github.com/prettier/prettier/pull/5682 [#6657]: https://github.com/prettier/prettier/pull/6657 [#5910]: https://github.com/prettier/prettier/pull/5910 @@ -1413,6 +1421,7 @@ const bigints = [200_000n, 0x0000_000an, 0b0111_1111n]; [#6708]: https://github.com/prettier/prettier/pull/6708 [#6687]: https://github.com/prettier/prettier/pull/6687 [#6796]: https://github.com/prettier/prettier/pull/6796 +[#6848]: https://github.com/prettier/prettier/pull/6848 [@brainkim]: https://github.com/brainkim [@duailibe]: https://github.com/duailibe [@gavinjoyce]: https://github.com/gavinjoyce @@ -1433,3 +1442,4 @@ const bigints = [200_000n, 0x0000_000an, 0b0111_1111n]; [@voithos]: https://github.com/voithos [@andersk]: https://github.com/andersk [@lydell]: https://github.com/lydell +[@aymericbouzy]: https://github.com/aymericbouzy diff --git a/src/language-js/index.js b/src/language-js/index.js index a02f4c81256a..7c80fd7a7394 100644 --- a/src/language-js/index.js +++ b/src/language-js/index.js @@ -10,7 +10,7 @@ const languages = [ Object.assign(data, { since: "0.0.0", parsers: ["babel", "flow"], - vscodeLanguageIds: ["javascript"], + vscodeLanguageIds: ["javascript", "mongo"], interpreters: data.interpreters.concat(["nodejs"]) }) ), diff --git a/tests_integration/__tests__/__snapshots__/support-info.js.snap b/tests_integration/__tests__/__snapshots__/support-info.js.snap index e654050ebb11..8df224c939e9 100644 --- a/tests_integration/__tests__/__snapshots__/support-info.js.snap +++ b/tests_integration/__tests__/__snapshots__/support-info.js.snap @@ -698,7 +698,7 @@ exports[`CLI --support-info (stdout) 1`] = ` \\"since\\": \\"0.0.0\\", \\"tmScope\\": \\"source.js\\", \\"type\\": \\"programming\\", - \\"vscodeLanguageIds\\": [\\"javascript\\"] + \\"vscodeLanguageIds\\": [\\"javascript\\", \\"mongo\\"] }, { \\"aceMode\\": \\"javascript\\",