Razor Compiler Codespaces Support (#33)

* Support Codespaces for Razor Compiler

* Fix target
This commit is contained in:
Tanay Parikh 2022-01-20 13:49:33 -05:00 коммит произвёл GitHub
Родитель 952c29ce24
Коммит 1303a9edd8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 78 добавлений и 6 удалений

5
.devcontainer/Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,5 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/dotnet/.devcontainer/base.Dockerfile
# [Choice] .NET version: 6.0, 5.0, 3.1, 2.1
ARG VARIANT="6.0"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet

Просмотреть файл

@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/dotnet
{
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// The VARIANT here must align with a dotnet container image that
// is publicly available on https://mcr.microsoft.com/v2/vscode/devcontainers/dotnet/tags/list.
// We'll default to `latest` as the default. Generally, the .NET version that is baked
// into the image by default doesn't matter since we end up installing our own
// local version and using that by default in the container environment.
"VARIANT": "latest",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*"
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"EditorConfig.EditorConfig"
],
"settings": {
// Loading projects on demand is better for larger codebases
"omnisharp.enableMsBuildLoadProjectsOnDemand": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
},
// Use 'postCreateCommand' to run commands after the container is created.
"onCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/container-creation.sh",
// Add the locally installed dotnet to the path to ensure that it is activated
// This is needed so that things like the C# extension can resolve the correct SDK version
"remoteEnv": {
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}",
"DOTNET_MULTILEVEL_LOOKUP": "0",
"TARGET": "net6.0",
},
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

Просмотреть файл

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
# Install SDK and tool dependencies before container starts
# Also run the full restore on the repo so that go-to definition
# and other language features will be available in C# files
./restore.sh
# The container creation script is executed in a new Bash instance
# so we exit at the end to avoid the creation process lingering.
exit

6
.vscode/extensions.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,6 @@
{
"recommendations": [
"ms-dotnettools.csharp",
"EditorConfig.EditorConfig"
]
}

19
.vscode/settings.json поставляемый
Просмотреть файл

@ -1,8 +1,15 @@
{ {
"markdownlint.config": { "files.trimTrailingWhitespace": true,
"MD028": false, "files.associations": {
"MD025": { "*.*proj": "xml",
"front_matter_title": "" "*.props": "xml",
} "*.targets": "xml",
"*.tasks": "xml"
},
"markdownlint.config": {
"MD028": false,
"MD025": {
"front_matter_title": ""
} }
} }
}