Project generator for VSCode IDE // Issue #619 Resolve #960

This commit is contained in:
Ivan Kravets
2017-05-28 00:30:23 +03:00
parent 1bd159e60d
commit fa24d61680
9 changed files with 177 additions and 2 deletions

2
docs

Submodule docs updated: f49813d110...fb19765e60

View File

@ -14,7 +14,7 @@
import sys
VERSION = (3, 4, "0b6")
VERSION = (3, 4, "0b7")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -0,0 +1,3 @@
.pioenvs
.piolibdeps
.vscode/browse.vc.db*

View File

@ -0,0 +1,28 @@
{
"configurations": [
{
"includePath": [
% for include in includes:
"{{include.replace('"', '\\"')}}",
% end
""
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "",
"path": [
% for include in includes:
"{{include.replace('"', '\\"')}}",
% end
""
]
},
"defines": [
% for define in defines:
"{{!define.replace('"', '\\"')}}",
% end
""
]
}
]
}

View File

@ -0,0 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
"ms-vscode.cpptools",
"webfreak.debug"
]
}

View File

@ -0,0 +1,15 @@
% from os.path import dirname, join
{
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "launch",
"cwd": "${workspaceRoot}",
"name": "PlatformIO Debugger",
"target": "{{prog_path.replace('"', '\\"')}}",
"gdbpath": "{{join(dirname(platformio_path), "piodebuggdb").replace('"', '\\"')}}",
"autorun": [ "source .pioinit" ]
}
]
}

View File

@ -0,0 +1,14 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.pioenvs": true,
"**/.piolibdeps": true,
".vscode/BROWSE.VC.DB*": true
},
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.autocomplete": "Default"
}

View File

@ -0,0 +1,104 @@
{
"version": "0.1.0",
"command": "{{platformio_path}}",
"isShellCommand": true,
"args": ["-c", "vscode"],
"showOutput": "always",
"echoCommand": false,
"suppressTaskName": true,
"tasks": [
{
"taskName": "PlatformIO: Build",
"isBuildCommand": true,
"args": ["run"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"taskName": "PlatformIO: Clean",
"args": ["run", "-t", "clean"]
},
{
"taskName": "PlatformIO: Upload",
"args": ["run", "-t", "upload"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"taskName": "PlatformIO: Upload using Programmer",
"args": ["run", "-t", "program"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"taskName": "PlatformIO: Upload SPIFFS image",
"args": ["run", "-t", "uploadfs"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"taskName": "PlatformIO: Test",
"args": ["test"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^([^:\\n]+):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"taskName": "PlatformIO: Update platforms and libraries",
"args": ["update"]
},
{
"taskName": "PlatformIO: Upgrade PIO Core",
"args": ["upgrade"]
}
]
}

View File

@ -49,6 +49,8 @@ def on_platformio_start(ctx, force, caller):
if not caller:
if getenv("PLATFORMIO_CALLER"):
caller = getenv("PLATFORMIO_CALLER")
elif getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"):
caller = "vscode"
elif util.is_container():
if getenv("C9_UID"):
caller = "C9"