microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.63k stars 29.04k forks source link

Support schema.org syntax and linter #31248

Closed jens1o closed 7 years ago

jens1o commented 7 years ago
Extension Author (truncated) Version
Bookmarks ale 0.15.2
vscode-intelephense-client bme 0.7.2
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
gitignore cod 0.5.0
vscode-dash dee 1.7.0
vscode-npm-source dku 1.0.0
python don 0.6.9
gitlens eam 4.3.2
tslint eg2 0.16.0
vscode-npm-script eg2 0.2.0
LogFileHighlighter emi 1.1.1
vscode-reveal evi 0.0.9
php-debug fel 1.11.1
auto-close-tag for 0.4.3
auto-rename-tag for 0.0.14
gc-excelviewer Gra 1.1.15
composer ika 0.5.0
smarty imp 0.2.0
code-guid jam 1.0.1
StretchTimer jpa 0.0.1
json-to-ts Mar 1.4.3
Runner mat 0.1.14
vscode-apache mrm 1.1.1
cpptools ms- 0.12.1
github-issues-prs ms- 0.3.1
php-docblocker nei 1.2.0
emoji Per 0.0.3
vscode-versionlens pfl 0.19.1
datetime rid 1.0.5
vscode-icons rob 7.10.1
sharecode Rol 0.4.1
code-settings-sync Sha 2.8.2
packagelinker sin 0.0.3
code-spell-checker str 1.3.0
lorem-ipsum Tyr 1.0.0
vscode-arduino vsc 0.2.4
vscode-todo-highlight way 0.5.8
highlight-trailing-white-spaces yba 0.0.2

(2 theme extensions excluded)


At the moment, it is not supported having schema.org json-rda script tags inside a html file, at least there is no syntax coloring for it. :/

For example:

    <script type="application/ld+json">
        {
            "@context": "http://schema.org",
            "@type": "WebPage",
            "name": "Jens Hausdorf",
            "description": "The website of the {'2002-07-12'|age}-years old developer.",
            "publisher": {
                "@type": "Person",
                "name": "Jens Hausdorf",
                "birthDate": "2002-07-12",
                "email": "hello@jens-hausdorf.de",
                "identifier": "jens1o"
            }
        }
    </script>
aeschli commented 7 years ago

This could be added by extension that contributes a grammar injection to the HTML grammar. See here on how this is done in vscode: https://github.com/Microsoft/vscode/issues/6693 I admit that's not a trivial task and might need some improvements of the HTML grammar in order allow injections at that place.