我有点不确定我正在使用谁的控制台。但假设我有以下调试配置:
{
"version": "0.2.0",
"inputs": [
...
],
"configurations": [
{
"type": "lldb",
"request": "attach",
"name": "Attach to...",
"program": "${workspaceFolder}/src/lib/${input:pickPackage}/target/debug/${input:pickPackage}"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我的程序正在 macos 终端中运行cargo run -p ...
vscode 的调试器为我提供了 lldb 的调试控制台
比如说,我正处于断点,想尝试一下......
到目前为止我尝试过生锈
script println!("{:?}", &t[op_end_index..])
File "<input>", line 1
println!("{:?}", &t[op_end_index..])
^
SyntaxError: invalid syntax
script &t[op_end_index..]
File "<input>", line 1
&t[op_end_index..]
^
SyntaxError: invalid syntax
script fn main () {println!("{:?}", &t[op_end_index..])}
File "<input>", line 1
fn main () {println!("{:?}", &t[op_end_index..])}
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我很新来反应。我正在编写将在<svg>标签中使用的组件。
我想对这些组件进行测试。但是,我所有的测试都无法识别<svg>eg <path>、<rect>and<circle>等的有效子级。
import React from 'react';
import ReactDOM from 'react-dom';
import { Layout } from './Layout';
import { LayoutAlignmentHorizontal, LayoutAlignmentVertical, LayoutFlow } from './Layout.enum';
it('renders without crashing', () => {
const svg = document.createElement('svg');
svg.setAttribute('xmlns','http://www.w3.org/2000/svg');
ReactDOM.render(<Layout flow={LayoutFlow.COLUMN}
horizontalAlignment={LayoutAlignmentHorizontal.LEFT}
verticalAlignment={LayoutAlignmentVertical.TOP}>
<rect width={50} height={50} fill={'red'}/>
<circle r={15} fill={'blue'} transform="translate(15 15)"/>
<path transform="scale(.15)"
d="M 10,30 A 20,20 0,0,1 50,30
A 20,20 0,0,1 90,30
Q 90,60 50,90
Q 10,60 10,30 z"
fill={'green'}/>
</Layout>, svg); …Run Code Online (Sandbox Code Playgroud)