Skip to content

Add .cjs to known JavaScript file extensions - #85460

Merged
Matt Bierner (mjbvz) merged 1 commit into
microsoft:masterfrom
xiaoxiangmoe:master
Nov 26, 2019
Merged

Add .cjs to known JavaScript file extensions#85460
Matt Bierner (mjbvz) merged 1 commit into
microsoft:masterfrom
xiaoxiangmoe:master

Conversation

@xiaoxiangmoe

Copy link
Copy Markdown
Contributor

Add .cjs to known JavaScript file extensions.

Related:

@msftclas

Microsoft Contribution License Agreements (msftclas) commented Nov 23, 2019

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

},
"fenced_code_block_js": {
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(js|jsx|javascript|es6|mjs|\\{\\.js.+?\\})((\\s+|:|\\{)[^`~]*)?$)",
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(js|jsx|javascript|es6|mjs|cjs|\\{\\.js.+?\\})((\\s+|:|\\{)[^`~]*)?$)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this grammar is generated from https://github.com/microsoft/vscode-markdown-tm-grammar

Make sure this is also updated upstream or else this change will be overwritten when we pull in the next update to this grammar

function adaptToJavaScript(grammar, replacementScope) {
grammar.name = 'JavaScript (with React support)';
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs'];
grammar.fileTypes = ['.js', '.jsx', '.es6', '.mjs', '.cjs'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to re-build the grammar after changing the build script:

cd extensions/typescript-basics
npm run update-grammars

@mjbvz

Copy link
Copy Markdown
Contributor

Can you please create an issue for this as well. This helps us track what is delivered each milestone

@mjbvz

Copy link
Copy Markdown
Contributor

Thanks!

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants