Skip to content

Commit 16f2c97

Browse files
aymericbouzythorn0
authored andcommitted
Add mongo as a VS Code supported language (prettier#6848)
* Add mongo as a VS Code supported language * updated Changelog * fix spellcheck error * fix tests
1 parent 4d9acf8 commit 16f2c97

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.unreleased.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ Previously, Prettier only supported the most common HTML entities, such as `&nbs
692692
[error] stdin: SyntaxError: Unknown entity "excl" - use the "&#<decimal>;" or "&#x<hex>;" syntax (1:6)
693693
[error] > 1 | <p>Hi&excl;</p>
694694
[error] | ^
695-
[error] 2 |
695+
[error] 2 |
696696
-->
697697
698698
<!-- Output (Prettier master) -->
@@ -1365,6 +1365,14 @@ const bigints = [200000n, 0x0000000an, 0b01111111n];
13651365
const bigints = [200_000n, 0x0000_000an, 0b0111_1111n];
13661366
```
13671367

1368+
#### VS Code: add support for .mongo files ([#6848] by [@aymericbouzy])
1369+
1370+
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.
1371+
1372+
```js
1373+
db.users.find({ someField: { $exists: true } });
1374+
```
1375+
13681376
[#5682]: https://github.com/prettier/prettier/pull/5682
13691377
[#6657]: https://github.com/prettier/prettier/pull/6657
13701378
[#5910]: https://github.com/prettier/prettier/pull/5910
@@ -1413,6 +1421,7 @@ const bigints = [200_000n, 0x0000_000an, 0b0111_1111n];
14131421
[#6708]: https://github.com/prettier/prettier/pull/6708
14141422
[#6687]: https://github.com/prettier/prettier/pull/6687
14151423
[#6796]: https://github.com/prettier/prettier/pull/6796
1424+
[#6848]: https://github.com/prettier/prettier/pull/6848
14161425
[@brainkim]: https://github.com/brainkim
14171426
[@duailibe]: https://github.com/duailibe
14181427
[@gavinjoyce]: https://github.com/gavinjoyce
@@ -1433,3 +1442,4 @@ const bigints = [200_000n, 0x0000_000an, 0b0111_1111n];
14331442
[@voithos]: https://github.com/voithos
14341443
[@andersk]: https://github.com/andersk
14351444
[@lydell]: https://github.com/lydell
1445+
[@aymericbouzy]: https://github.com/aymericbouzy

src/language-js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const languages = [
1010
Object.assign(data, {
1111
since: "0.0.0",
1212
parsers: ["babel", "flow"],
13-
vscodeLanguageIds: ["javascript"],
13+
vscodeLanguageIds: ["javascript", "mongo"],
1414
interpreters: data.interpreters.concat(["nodejs"])
1515
})
1616
),

tests_integration/__tests__/__snapshots__/support-info.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ exports[`CLI --support-info (stdout) 1`] = `
698698
\\"since\\": \\"0.0.0\\",
699699
\\"tmScope\\": \\"source.js\\",
700700
\\"type\\": \\"programming\\",
701-
\\"vscodeLanguageIds\\": [\\"javascript\\"]
701+
\\"vscodeLanguageIds\\": [\\"javascript\\", \\"mongo\\"]
702702
},
703703
{
704704
\\"aceMode\\": \\"javascript\\",

0 commit comments

Comments
 (0)