当我在 VS Code 中使用 Python 中的匹配大小写语句时,它会在“问题”选项卡中显示红色波浪线和错误:

python python-jedi visual-studio-code vscode-python python-3.10
问题描述
当我在 Visual Studio Code 1.58.2 中的模块 SampleModule.psm1 上选择“运行而不调试”时
function ConvertTo-PascalCase([String []] $words) {
[String] $pascalCaseString = [String]::Empty
foreach ($word in $words) {
$pascalCaseString = $pascalCaseString + ($word.Substring(0,1).ToUpper() + $word.Substring(1))
}
$pascalCaseString = ($pascalCaseString.TrimEnd(',')).Trim()
return $pascalCaseString
}
Export-ModuleMember -Function Convert-ToPascalCase
Run Code Online (Sandbox Code Playgroud)
我不断收到错误消息:
InvalidOperation:无法在管道中间运行文档
屏幕截图更详细地显示了它。每当我构建任何模块时,我都会收到同样的错误消息
我尝试过但不起作用的事情:
我如何知道这是运行 PSM1 文件的问题
如果我将 .psm1 模块文件转换回普通的旧 Powershell 脚本 (*.ps1) 脚本并删除所有Export-Module 成员命令,则脚本运行得很好。
我的工作
要在 VSCode 中执行该模块,我必须使用 dotsource 才能成功导入该模块: …
当尝试使用 scoop via 更新 Powershell Core 时scoop update pwsh,出现以下错误:
ERROR Application "pwsh" is still running. Close all instances and try again.
我尝试关闭 PowerShell 并更新 via cmd,但它仍然引发该错误。
我正在使用(尝试)带有 arduino-cli 的 VSCode Arduino 扩展。当尝试编译草图时,它会抛出以下错误:
Cannot find Arduino IDE. Please specify the "arduino.path" in the User Settings. Requires a restart after change.
Run Code Online (Sandbox Code Playgroud)
这是以下的输出arduino-cli version:
arduino-cli.exe Version: 0.21.1 Commit: 9fcbb392 Date: 2022-02-24T15:41:45Z
Run Code Online (Sandbox Code Playgroud)
这些是所有arduino.设置settings.json:
Cannot find Arduino IDE. Please specify the "arduino.path" in the User Settings. Requires a restart after change.
Run Code Online (Sandbox Code Playgroud)