代码拉取完成,页面将自动刷新
#!/usr/bin/env python3
import argparse
import json
import sys
import re
p = argparse.ArgumentParser()
p.add_argument( "launch_name" )
args = p.parse_args()
TYPE_TO_ADAPTER = {
'cppdbg': 'vscode-cpptools'
}
configurations = {}
with open( args.launch_name ) as launch_file:
vsconfigurations = json.loads( re.sub( r"(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)", "", launch_file.read(), flags=re.MULTILINE ) ).get( "configurations", [] )
if not vsconfigurations:
exit( f"No launch.json configurations found in {args.launch_name}" )
for vsconfig in vsconfigurations:
name = vsconfig.pop( "name" )
configurations[ name ] = {
"adapter": TYPE_TO_ADAPTER[ vsconfig.pop( "type" ) ],
"configuration": vsconfig,
}
vimspector = {
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
"configurations": configurations
}
json.dump( vimspector, sys.stdout, indent=2 )
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。