mirror of https://github.com/jetkvm/kvm.git
chore: add vscode configuration for c development
This commit is contained in:
parent
2f868bc36d
commit
db53e89df1
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
"compilerPath": "/opt/jetkvm-native-buildkit/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "gnu++17",
|
||||||
|
"intelliSenseMode": "linux-gcc-arm",
|
||||||
|
"configurationProvider": "ms-vscode.cmake-tools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"git.ignoreLimitWarning": true,
|
"git.ignoreLimitWarning": true,
|
||||||
"cmake.sourceDirectory": "/workspaces/kvm-static-ip/internal/native/cgo",
|
"cmake.sourceDirectory": "${workspaceFolder}/internal/native/cgo",
|
||||||
"cmake.ignoreCMakeListsMissing": true
|
"cmake.ignoreCMakeListsMissing": true,
|
||||||
|
"C_Cpp.inlayHints.autoDeclarationTypes.enabled": true,
|
||||||
|
"C_Cpp.inlayHints.parameterNames.enabled": true,
|
||||||
|
"C_Cpp.inlayHints.referenceOperator.enabled": true
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
DEFAULT_C_INTELLISENSE_SETTINGS = {
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
# "compilerPath": "/opt/jetkvm-native-buildkit/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "gnu++17",
|
||||||
|
"intelliSenseMode": "linux-gcc-arm",
|
||||||
|
"configurationProvider": "ms-vscode.cmake-tools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
|
|
||||||
|
def configure_c_intellisense():
|
||||||
|
settings_path = os.path.join('.vscode', 'c_cpp_properties.json')
|
||||||
|
settings = DEFAULT_C_INTELLISENSE_SETTINGS.copy()
|
||||||
|
|
||||||
|
# open existing settings if they exist
|
||||||
|
if os.path.exists(settings_path):
|
||||||
|
with open(settings_path, 'r') as f:
|
||||||
|
settings = json.load(f)
|
||||||
|
|
||||||
|
# update compiler path
|
||||||
|
settings['configurations'][0]['compilerPath'] = "/opt/jetkvm-native-buildkit/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc"
|
||||||
|
settings['configurations'][0]['configurationProvider'] = "ms-vscode.cmake-tools"
|
||||||
|
|
||||||
|
with open(settings_path, 'w') as f:
|
||||||
|
json.dump(settings, f, indent=4)
|
||||||
|
|
||||||
|
print("C/C++ IntelliSense configuration updated.")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
configure_c_intellisense()
|
||||||
Loading…
Reference in New Issue