由于轻量级,我使用 vscode 的 REST 客户端扩展而不是 postman,但当我尝试发送 POST 请求时,它似乎没有发送 JSON 数据。它在邮递员和 reqbin 上工作正常,但在 REST 客户端上则不然,我只收到空的正文。
这是请求 URL
@hostname-tour = http://localhost:3000/api/v1/tours
POST {{hostname-tour}} HTTP/1.1
Content-Type: "application/json"
{
"name": "Test Tour",
"duration": "10",
"diffculty": "easy"
}
Run Code Online (Sandbox Code Playgroud)
这是后端代码
const express = require("express");
const app = express();
app.use(express.json());
app.post("/api/v1/tours", (req, res) => {
console.log(req.body);
res.status(200).json({
received: req.body,
});
});
let port = 3000;
app.listen(port, () => {
console.log("Listening at port: ", port);
});
Run Code Online (Sandbox Code Playgroud)
我有一个可用的 Angular 12 项目。现在我想转换这个项目,或者说我想从这个 Angular 项目中进行 VS Code 扩展。有没有办法构建 Angular 项目并将其作为 VS Code 扩展加载?
这里有人让 IntelliSense 在带有 DxCore 项目的 Arduino 的 Visual Studio Code 中相对完美地工作吗?我已经完成了大部分工作,但仍然存在一些问题。
对我来说,任何需要Serial.printf()用红色波浪线标记的电话。Ctrl+单击printf可以很好地显示定义。这里那里的其他事物也有相同的行为。例如,在定义va_start内printf。
除此之外,在验证草图时,我得到:
[Error] Failed to read or write IntelliSense configuration: {}
不认为这是一个真正的问题,但它很烦人。
这是我的c_pp_properties.json文件:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:\\Users\\nabel\\OneDrive\\Documents\\ArduinoData\\packages\\DxCore\\hardware\\megaavr\\**",
"C:\\Users\\nabel\\OneDrive\\Documents\\Arduino\\libraries\\**",
"C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\**",
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\**",
"C:\\Program Files (x86)\\Arduino\\tools\\**",
"C:\\Program Files (x86)\\Arduino\\libraries\\**"
],
"forcedInclude": [
"C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"ARDUINO=10816", // Should be updated for version of Arduino IDE installed; …Run Code Online (Sandbox Code Playgroud) intellisense arduino dxcore visual-studio-code vscode-extensions
我已经安装了多个版本的 .NET Sdk。现在 Omnisharp 建议无法正常工作。
输出显示这些
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /BO-V2/Techne-Travel/travel-techne-bo-for-ota/src/Application/Application.csproj
A compatible installed .NET SDK for global.json version [6.0.101] from [/BO-V2/Techne-Travel/travel-techne-bo-for-ota/global.json] was not found.
Install the [6.0.101] .NET SDK or update [/BO-V2/Techne-Travel/travel-techne-bo-for-ota/global.json] with an installed .NET SDK:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
A compatible installed .NET SDK for global.json version [6.0.101] from [/BO-V2/Techne-Travel/travel-techne-bo-for-ota/global.json] was not found.
Install the [6.0.101] .NET SDK or update [/BO-V2/Techne-Travel/travel-techne-bo-for-ota/global.json] with an installed .NET …Run Code Online (Sandbox Code Playgroud) 我的反应项目有几个“flex”兼容性错误。如何消除 VS Code 中的这些错误?我已经在我的项目中使用了 postcss。
'flex' is not supported by Internet Explorer < 11. Add '-ms-flex' to support Internet Explorer 10+.
'flex-direction' is not supported by Internet Explorer < 11. Add '-ms-flex-direction' to support Internet Explorer 10+.
'transform' is not supported by Internet Explorer < 10. Add '-ms-transform' to support Internet Explorer 9+.
Run Code Online (Sandbox Code Playgroud) 我正在尝试设置自定义 emmet 片段,但它不起作用。
我的snippets.json文件
{
"html": {
"snippets": {
"testing": "div{Hello World}"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的文件肯定是“HTML”格式,我尝试重新启动 vscode。
我还检查了 snippets.json 的路径是否正确并且在“设置”中可见。
也尝试了两台不同的机器,同样的情况。
这是settings.json
{
"some other settings",
"emmet.extensionsPath": ["D:\\FRONTEND\\snippets.json"]
}
Run Code Online (Sandbox Code Playgroud) 我正在使用自定义 CSS 加载器,一切都已设置完毕。
我可以更改 VSCode 的 CSS 并进行更改。但由于某种原因我唯一无法更改的是选项卡中的文本。
当我只调整选项卡的字体大小时,我可以更改图标大小。但它对文本大小没有影响。
我尝试增加选项卡的宽度,但没有成功。
我只能猜测 .tab-container 和 .tab 的作用。
这是我从 VSCode 问题中某人的建议中窃取的 CSS 代码:
:root {
--size-reduction: 12px;
}
.monaco-shell {
font-family: "JetBrains Mono", "Monoco", monospace;
}
.tabs-container .tab,
.tabs-container .monaco-icon-label,
.tabs-container .monaco-icon-label::before,
.tabs-and-actions-container .editor-actions {
height: unset !important;
}
.monaco-workbench .tabs-container .tab * {
font-size: 0.5em;
width: 100px;
}
.editor-instance > .monaco-editor,
.editor-instance > .monaco-editor .overflow-guard,
.editor-instance > .monaco-editor .monaco-scrollable-element {
height: 100% !important;
}
.editor-instance,
.editor-instance > .settings-editor .settings-toc-wrapper,
.editor-instance > …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一些设置以在保存时自动检查和格式化 Python 文件。我有 Python 所需的设置,但在编辑 XML 等其他文件时,VSCode 也会自动格式化它们。有没有办法让 VSCode 只格式化 Python 文件?
以下是我的格式化和 linting 设置:
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--max-line-length=240",
"--disable=C0111,unused-import"
],
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"line-length", "250"
],
"python.linting.lintOnSave": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
Run Code Online (Sandbox Code Playgroud)