我最近切换到 Visual Studio Code,到目前为止我一直非常缺少一个功能,那就是自动完成可覆盖方法的能力。
在完整的 Visual Studio 版本中,您可以键入override,IDE 将列出当前类的所有方法,这些方法在任何父类中标记为抽象或虚拟。Visual Studio Code 中似乎缺少此功能。是否有可以调整的设置,或者有人知道会添加这种功能的扩展吗?
我正在尝试创建一个面向 .NET Standard 2.0 的新 .NET MVC 应用程序。当我做一个时,dotnet new mvc -au None我最终会得到一个针对aspnetcore2.0. 由于我希望项目定位,因此netstandard2.0我必须手动制作.csproj文件:
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
一切都很好,但是当我做某事时dotnet run会往南走:
一个可运行的项目应该针对一个可运行的 TFM(例如,netcoreapp2.0)并具有 OutputType 'Exe'。
相关资料:
dotnet --version
2.1.4
Run Code Online (Sandbox Code Playgroud)
我在这里缺少什么?
嗨,我只是想从我正在处理的 Angular 项目中的组件上的几个单选按钮中获取值。如果我放了相同的违规代码..
this.format = document.querySelector('input[name="case"]:checked').value;
Run Code Online (Sandbox Code Playgroud)
...在控制台日志中的 if 语句中,它不会引发错误。此外,当我重新加载 vs 代码时,有时也不会抛出错误并且它运行良好。
那么有人能明白为什么我会收到这个错误吗?谢谢你的帮助。如果您需要更多信息,请告诉我。
'file:////src/app/input-format2.directive.ts'
severity: 'Error'
message: 'Property 'value' does not exist on type 'Element'.'
at: '15,72'
source: 'ts'
code: '2339'
Run Code Online (Sandbox Code Playgroud)
这是指令:
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({
selector: '[appInputFormat2]'
})
export class InputFormat2Directive {
// tslint:disable-next-line:no-input-rename
@Input('appInputFormat2') format;
constructor(private el: ElementRef) {}
@HostListener('blur')
onBlur() {
const value: string = this.el.nativeElement.value;
this.format = document.querySelector('input[name="case"]:checked').value;
if (this.format === 'lowercase') {
this.el.nativeElement.value = value.toLowerCase();
} else {
this.el.nativeElement.value = …Run Code Online (Sandbox Code Playgroud) 我有两个不同版本的node项目,它们是用nvm管理的:
在每个项目的根文件夹中,都有一个文件 .nvmrc 及其节点版本。当我在 VS Code 上打开集成终端时,选择了默认节点版本(前两个除外),我需要键入$ nvm use以更改为每个项目使用的正确节点版本。有没有办法$ nvm use在终端打开后自动执行,或者另一种方式来实现我的目标?有时我打开终端忘记执行命令。
我使用的是 Ubuntu 16.04、VS Code 1.20.1 和 nvm 0.33.8。
谢谢。
似乎找不到我要找的东西,也许它还不存在?我安装了 sublime text keymap 扩展,但与 VS Code / Emmet 一起似乎缺少我最喜欢的 sublime 快捷方式之一......
选择所有内部标签/向外扩展选择
ctrl+,或ctrl+ shift+a
我可以在 .php 文件中使用 html emmet 吗?它适用于 .html 文件。
我的设置:
{
"editor.insertSpaces": false,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.renderWhitespace": "none",
"editor.renderControlCharacters": true,
"php.validate.executablePath": "C:/xampp/php/php.exe",
"emmet.includeLanguages": {
"php": "html"
},
"emmet.showExpandedAbbreviation": "always",
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Blade 文件中的 VS Code 中使用 Emmet 的“用缩写包装”功能,但它不起作用。我已经尝试过 cmd+shift+a 快捷方式和 cmd+shift+p > wrap with abbreviation 命令,但没有任何反应。我在 .html、.php 文件中使用它没有问题,但是使用文件扩展名.blade.php和 Laravel Blade 作为活动语言,它不会包装 html 代码。这是一个错误,还是有办法激活这种语言的“换行”?
非常感谢!
在 VS Code 中,我想进行以下搜索和替换,但它不仅仅匹配大写字母。这是一个错误/缺陷还是我错过了什么?
查找:\{\$([A-Z_]+)\}
替换:{$1}
所以这:
$(document).ready(function ()
{
generarEstado('{$GRAPH_BY_STATUS} ','{$nombreSitio}','{$nombreSitioCorto}');
generarSexo('{$GRAPH_BY_SEX} ','{$nombreSitio}','{$nombreSitioCorto}');
generarSexGrade('{$GRAPH_BY_SEX_AND_GRADE} ','{$nombreSitio}','{$nombreSitioCorto}');
});
Run Code Online (Sandbox Code Playgroud)
应该变成:
$(document).ready(function ()
{
generarEstado('{GRAPH_BY_STATUS} ','{$nombreSitio}','{$nombreSitioCorto}');
generarSexo('{GRAPH_BY_SEX} ','{$nombreSitio}','{$nombreSitioCorto}');
generarSexGrade('{GRAPH_BY_SEX_AND_GRADE} ','{$nombreSitio}','{$nombreSitioCorto}');
});
Run Code Online (Sandbox Code Playgroud)
但它也符合其他{$nombreSitio}和{$nombreSitioCorto}等
有没有办法创建一个键绑定来对文件执行 shell 命令?就像是:
{
"key": "ctrl+shift+e",
"command": "run",
"command": "touch $file",
"when": "editorTextFocus"
}
Run Code Online (Sandbox Code Playgroud)
我不想使用任务,因为这需要对整个编辑器是全局的,而不是特定的工作区。
在使用 开发应用程序时,如何将本机语言更改为Swift&Kotlin来自Objective-C& ?JavaVS CodeFlutter Framework
以前,我IntelliJ IDEA在创建项目时使用并获得了为 iOS(Swift 或 Objective-C)和 Android(Java 或 Kotlin)平台选择本机语言的选项。
VS Code 不显示此类选项。
emmet ×2
.net ×1
angular ×1
asp.net-mvc ×1
blade ×1
c# ×1
flutter ×1
intellisense ×1
kotlin ×1
node.js ×1
nvm ×1
overriding ×1
php ×1
regex ×1
sublimetext ×1
swift ×1
typescript ×1