Skip to content

Commit

Permalink
Add mongo as a VS Code supported language (#6848)
Browse files Browse the repository at this point in the history
* Add mongo as a VS Code supported language

* updated Changelog

* fix spellcheck error

* fix tests
  • Loading branch information
aymericbouzy authored and thorn0 committed Nov 6, 2019
1 parent 4d9acf8 commit 16f2c97
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.unreleased.md
Expand Up @@ -692,7 +692,7 @@ Previously, Prettier only supported the most common HTML entities, such as `&nbs
[error] stdin: SyntaxError: Unknown entity "excl" - use the "&#<decimal>;" or "&#x<hex>;" syntax (1:6)
[error] > 1 | <p>Hi&excl;</p>
[error] | ^
[error] 2 |
[error] 2 |
-->
<!-- Output (Prettier master) -->
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/language-js/index.js
Expand Up @@ -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"])
})
),
Expand Down
Expand Up @@ -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\\",
Expand Down

0 comments on commit 16f2c97

Please sign in to comment.