chore: add mdc to Code extension

This commit is contained in:
Nate Moore 2021-07-09 11:46:31 -05:00
parent 2d99baee53
commit 6ae81296d7
9 changed files with 31 additions and 17 deletions

4
.vscode/launch.json vendored
View file

@ -7,8 +7,8 @@
"type": "extensionHost", "type": "extensionHost",
"request": "launch", "request": "launch",
"runtimeExecutable": "${execPath}", "runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/astro-vscode"], "args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/vscode"],
"outFiles": ["${workspaceRoot}/tools/astro-vscode/dist/**/*.js"] "outFiles": ["${workspaceRoot}/tools/vscode/dist/**/*.js"]
}, },
{ {
"type": "node", "type": "node",

View file

@ -1,5 +1,5 @@
export default { export default {
markdownOptions: { markdownOptions: {
components: './src/components/index.tsx' components: './src/components/index.ts'
} }
} }

View file

@ -0,0 +1 @@
export { default as PreactCounter } from './PreactCounter.js';

View file

@ -1 +0,0 @@
export { default as PreactCounter } from './PreactCounter.tsx';

View file

@ -9,4 +9,4 @@ text here.
<PreactCounter client:visible /> <PreactCounter client:visible />
Hello world! Hey, this is a demo!

View file

@ -77,11 +77,14 @@
"configuration": "./languages/astro-language-configuration.json" "configuration": "./languages/astro-language-configuration.json"
}, },
{ {
"id": "astro-markdown", "id": "mdc",
"aliases": [ "extensions": [
"Astro Markdown" ".mdc"
], ],
"configuration": "./languages/astro-markdown-language-configuration.json" "aliases": [
"Markdown + Components"
],
"configuration": "./languages/mdc-language-configuration.json"
} }
], ],
"grammars": [ "grammars": [
@ -91,7 +94,7 @@
"path": "./syntaxes/astro.tmLanguage.json", "path": "./syntaxes/astro.tmLanguage.json",
"embeddedLanguages": { "embeddedLanguages": {
"text.html.astro": "astro", "text.html.astro": "astro",
"text.html.markdown.astro": "astro-markdown", "text.html.markdown.astro": "mdc",
"text.html": "html", "text.html": "html",
"source.css": "css", "source.css": "css",
"source.scss": "scss", "source.scss": "scss",
@ -101,19 +104,20 @@
} }
}, },
{ {
"language": "astro-markdown", "language": "mdc",
"scopeName": "text.html.markdown.astro", "scopeName": "text.html.markdown.astro",
"path": "./syntaxes/astro-markdown.tmLanguage.json", "path": "./syntaxes/mdc.tmLanguage.json",
"injectTo": [ "injectTo": [
"text.html.astro" "text.html.astro"
], ],
"embeddedLanguages": { "embeddedLanguages": {
"text.html.astro": "astro", "text.html.astro": "astro",
"text.html.markdown.astro": "astro-markdown", "text.html.markdown.astro": "mdc",
"text.html.markdown": "markdown", "text.html.markdown": "markdown",
"source.tsx": "typescriptreact", "source.tsx": "typescriptreact",
"source.js": "javascript", "source.js": "javascript",
"source.css": "css", "source.css": "css",
"meta.embedded.block.frontmatter": "yaml",
"meta.embedded.block.css": "css", "meta.embedded.block.css": "css",
"meta.embedded.block.astro": "astro", "meta.embedded.block.astro": "astro",
"meta.embedded.block.ini": "ini", "meta.embedded.block.ini": "ini",

View file

@ -3,6 +3,9 @@
"name": "Astro Markdown", "name": "Astro Markdown",
"scopeName": "text.html.markdown.astro", "scopeName": "text.html.markdown.astro",
"patterns": [ "patterns": [
{
"include": "#frontMatter"
},
{ {
"include": "#block" "include": "#block"
}, },
@ -11,6 +14,16 @@
} }
], ],
"repository": { "repository": {
"frontMatter": {
"begin": "\\A-{3}\\s*$",
"contentName": "meta.embedded.block.frontmatter",
"patterns": [
{
"include": "source.yaml"
}
],
"end": "(^|\\G)-{3}|\\.{3}\\s*$"
},
"astro-expressions": { "astro-expressions": {
"patterns": [ "patterns": [
{ {

View file

@ -9,9 +9,6 @@
"declaration": true, "declaration": true,
"strict": true, "strict": true,
"skipLibCheck": true, "skipLibCheck": true,
"baseUrl": "./", "baseUrl": "./"
"paths": {
"@astro-vscode/*": ["packages/*/src"]
}
} }
} }