Update .vscode, untrack and move to /contrib
This commit is contained in:
committed by
Adrián Insaurralde Avalos
parent
3895b5d6c0
commit
d98f0e1ae3
27
contrib/.vscode/c_cpp_properties.json
vendored
Normal file
27
contrib/.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
},
|
||||
{
|
||||
"name": "Mac",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
},
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"/usr/include/**"
|
||||
],
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
6
contrib/.vscode/extensions.json
vendored
Normal file
6
contrib/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"ms-python.python"
|
||||
]
|
||||
}
|
||||
102
contrib/.vscode/launch.json
vendored
Normal file
102
contrib/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug C++ Tests",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": "${command:cmake.buildDirectory}/tests/Tests_run",
|
||||
"args": [],
|
||||
"environment": [
|
||||
{
|
||||
"name": "PATH",
|
||||
"value": "${command:cmake.buildDirectory}/tests:${env:PATH}"
|
||||
}
|
||||
],
|
||||
"linux": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/bin/gdb"
|
||||
},
|
||||
"osx": {
|
||||
"MIMode": "lldb"
|
||||
},
|
||||
"windows": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb.exe"
|
||||
},
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "CMake: build",
|
||||
"sourceFileMap": {
|
||||
"${workspaceFolder}": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "C/C++ debugger",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"program": "${command:cmake.buildDirectory}/bin/FreeCAD",
|
||||
"args": ["${workspaceFolder}/.vscode/scripts/VSCodeAutostartDebug.FCMacro"],
|
||||
"environment": [
|
||||
{
|
||||
"name": "PATH",
|
||||
"value": "${command:cmake.buildDirectory}/bin:${env:PATH}"
|
||||
},
|
||||
{
|
||||
"name": "PYDEVD_DISABLE_FILE_VALIDATION",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"linux": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/bin/gdb"
|
||||
},
|
||||
"osx": {
|
||||
"MIMode": "lldb"
|
||||
},
|
||||
"windows": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
|
||||
},
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": false,
|
||||
"presentation": {
|
||||
"hidden": true,
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Python debugger",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"preLaunchTask": "WaitForDebugpy",
|
||||
"redirectOutput": true,
|
||||
"connect": {
|
||||
"host": "localhost",
|
||||
"port": 5678
|
||||
},
|
||||
"pathMappings": [
|
||||
{
|
||||
"localRoot": "${workspaceFolder}/src",
|
||||
"remoteRoot": "${command:cmake.buildDirectory}"
|
||||
}
|
||||
],
|
||||
"justMyCode": false,
|
||||
"presentation": {
|
||||
"hidden": true,
|
||||
}
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Debug FreeCAD",
|
||||
"configurations": ["C/C++ debugger", "Python debugger"],
|
||||
"preLaunchTask": "CMake: build",
|
||||
"stopAll": true,
|
||||
"presentation": {
|
||||
"order": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
18
contrib/.vscode/scripts/VSCodeAutostartDebug.FCMacro
vendored
Normal file
18
contrib/.vscode/scripts/VSCodeAutostartDebug.FCMacro
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import debugpy
|
||||
from multiprocessing.connection import Listener
|
||||
from freecad.utils import get_python_exe
|
||||
|
||||
# get_python_exe is needed because debugpy needs a python interpreter to work.
|
||||
# It does not have to be FC embedded interpreter.
|
||||
# By default it attempts to use Freecad's PID mistaking it for python.
|
||||
# https://github.com/microsoft/debugpy/issues/262
|
||||
debugpy.configure(python=get_python_exe())
|
||||
debugpy.listen(('localhost', 5678))
|
||||
|
||||
# Turns out you cannot probe debugpy to see if it is up:
|
||||
# https://github.com/microsoft/debugpy/issues/974
|
||||
# Open another port that the script WaitForDebugpy can probe to see if
|
||||
# debugpy is running
|
||||
listener = Listener(('localhost', 6000), backlog=10)
|
||||
|
||||
debugpy.wait_for_client()
|
||||
29
contrib/.vscode/scripts/WaitForDebugpy.py
vendored
Normal file
29
contrib/.vscode/scripts/WaitForDebugpy.py
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import socket
|
||||
from contextlib import closing
|
||||
import time
|
||||
|
||||
TIMEOUT_TIME_S = 30
|
||||
RETRY_DELAY_S = 0.1
|
||||
|
||||
MAX_ATTEMPTS = TIMEOUT_TIME_S / RETRY_DELAY_S
|
||||
|
||||
def check_socket(host, port):
|
||||
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
|
||||
sock.settimeout(RETRY_DELAY_S)
|
||||
return sock.connect_ex((host, port)) == 0
|
||||
|
||||
def main():
|
||||
# DO NOT CHECK 5678 or debugpy will break
|
||||
# Check other port manually opened instead
|
||||
attempt_counter = 0
|
||||
while (not check_socket('localhost', 6000)) and attempt_counter < MAX_ATTEMPTS:
|
||||
time.sleep(RETRY_DELAY_S)
|
||||
attempt_counter += 1
|
||||
|
||||
if attempt_counter >= MAX_ATTEMPTS:
|
||||
exit(1)
|
||||
else:
|
||||
exit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
39
contrib/.vscode/settings.json
vendored
Normal file
39
contrib/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
// This disables vscode from adding lines to files.associations,
|
||||
// some files might not be recognized though.
|
||||
// This is a vscode issue.
|
||||
"C_Cpp.autoAddFileAssociations": false,
|
||||
"files.associations": {
|
||||
"*.c": "c",
|
||||
"*.h": "cpp",
|
||||
"*.cpp": "cpp",
|
||||
"*.hpp": "cpp",
|
||||
"*.cxx": "cpp",
|
||||
"*.hxx": "cpp",
|
||||
"*.py": "python",
|
||||
"*.FCMacro": "python"
|
||||
},
|
||||
|
||||
"editor.formatOnType": true,
|
||||
"files.autoSave": "afterDelay",
|
||||
"debug.onTaskErrors": "abort", //to not launch the python debugger when waitforport.py fails
|
||||
|
||||
// Does not quick launch the debugger, forces to select debugger config every time
|
||||
// Use the debug panel on the left instead
|
||||
"debug.showInStatusBar": "never",
|
||||
|
||||
"cmake.options.advanced": {
|
||||
"configurePreset": {
|
||||
"statusBarVisibility": "visible"
|
||||
},
|
||||
"build": {
|
||||
"statusBarVisibility": "visible"
|
||||
},
|
||||
"launch": {
|
||||
"statusBarVisibility": "hidden"
|
||||
},
|
||||
"debug": {
|
||||
"statusBarVisibility": "hidden"
|
||||
}
|
||||
}
|
||||
}
|
||||
71
contrib/.vscode/tasks.json
vendored
Normal file
71
contrib/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "FreeCAD: setup conda environment",
|
||||
"linux": {
|
||||
"command": "conda/setup-environment.sh",
|
||||
},
|
||||
"osx": {
|
||||
"command": "conda/setup-environment.sh",
|
||||
},
|
||||
"windows": {
|
||||
"command": "conda/setup-environment.cmd",
|
||||
},
|
||||
"group": "none",
|
||||
"problemMatcher": [],
|
||||
},
|
||||
{
|
||||
"label": "WaitForDebugpy",
|
||||
"type": "shell",
|
||||
"command": "python ${workspaceFolder}/.vscode/scripts/WaitForDebugpy.py",
|
||||
"group": "none",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"reveal": "never", //silently fail and don't launch the debugger
|
||||
"panel": "dedicated",
|
||||
"close": true,
|
||||
"revealProblems": "never"
|
||||
},
|
||||
"hide": true
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: build",
|
||||
"command": "build",
|
||||
"preset": "${command:cmake.activeBuildPresetName}",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Build all targets",
|
||||
"dependsOn": [],
|
||||
"problemMatcher": ["$gcc"]
|
||||
},
|
||||
{
|
||||
"label": "Tests: run c++ tests",
|
||||
"detail": "Run googletest",
|
||||
"type": "shell",
|
||||
"command": "${command:cmake.buildDirectory}/tests/Tests_run",
|
||||
"group": {
|
||||
"kind": "test",
|
||||
"isDefault": true
|
||||
},
|
||||
"dependsOn": ["CMake: build"],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Tests: run python tests",
|
||||
"detail": "Run FreeCAD integrated tests",
|
||||
"type": "shell",
|
||||
"command": "${command:cmake.buildDirectory}/bin/FreeCAD",
|
||||
"args": ["-t", "0"],
|
||||
"group": {
|
||||
"kind": "test"
|
||||
},
|
||||
"dependsOn": ["CMake: build"],
|
||||
"problemMatcher": []
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user