Skip to content

Instantly share code, notes, and snippets.

@pakLebah pakLebah/launch.json
Last active Aug 14, 2018

Embed
What would you like to do?
My VS Code tasks for Free Pascal programs on Mac.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{ // shortcut: F5 (start debugging)
"type": "lldb",
"request": "launch",
"name": "LLDB Debugger",
"cwd": "${workspaceFolder}",
"program": "out/debug/${fileBasenameNoExtension}",
"args": [],
"terminal": "integrated",
"preLaunchTask": "fpc: Build Debug",
"postDebugTask": "fpc: Clean Files"
},
// { // native debugger
// "type": "lldb-mi",
// "request": "launch",
// "name": "Native Debugger",
// "cwd": "${workspaceFolder}",
// "target": "${workspaceFolder}/${fileBasenameNoExtension}",
// // "terminal": "",
// "preLaunchTask": "fpc: Build Debug",
// "postDebugTask": "fpc: Clean Files"
// },
]
}
{
"omnipascal.defaultDevelopmentEnvironment": "FreePascal",
"omnipascal.delphiInstallationPath": "/usr/local/bin/fpc",
"omnipascal.freePascalSourcePath": "~/Downloads/fpc-src/",
"omnipascal.searchPath": "~/Documents/GitHub/*",
"omnipascal.namingConventionString": "camelCase",
"[objectpascal]": {
"editor.fontFamily": "Fira Code",
"editor.fontSize": 12.5,
},
// "swift.path.sourcekite": "~/Documents/swift/sourcekite/.build/release/sourcekite",
// "sde.enableTracing.client": true,
"[swift]": {
"editor.fontFamily": "Dejavu Sans Code",
"editor.fontSize": 12.5,
},
"[markdown]": {
"files.trimTrailingWhitespace": false,
},
"files.associations": {
"*.json": "jsonc"
},
"editor.fontFamily": "SourceCodePro-Regular",
"editor.fontSize": 12.5,
"editor.tabSize": 2,
"editor.rulers": [80,120],
"editor.wordWrapColumn": 120,
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
// "editor.smoothScrolling": true,
// "editor.multiCursorModifier": "ctrlCmd",
"editor.matchBrackets": false,
"editor.quickSuggestionsDelay": 100,
"editor.acceptSuggestionOnEnter": "smart",
"editor.renderLineHighlight": "all",
"editor.renderWhitespace": "none",
"editor.renderControlCharacters": true,
"editor.occurrencesHighlight": false,
"editor.tokenColorCustomizations": {
"comments": {
"fontStyle": "italic"
}
},
"workbench.iconTheme": "vscode-great-icons",
"workbench.editor.tabCloseButton": "left",
"workbench.editor.swipeToNavigate": true,
"workbench.startupEditor": "newUntitledFile",
"workbench.statusBar.feedback.visible": false,
"workbench.colorCustomizations": {
"[Default Dark+]": {
"editorRuler.foreground": "#3f3f3f",
"editor.lineHighlightBackground": "#292929",
"editorGutter.background": "#181818",
// "editorIndentGuide.activeBackground": "#a0a0a0",
// "sideBar.border": "#3f3f3f",
"tab.border": "#3f3f3f",
},
},
"terminal.integrated.fontFamily": "Monaco",
"terminal.integrated.fontSize": 12.5,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.drawBoldTextInBrightColors": false,
"terminal.integrated.enableBell": true,
"terminal.integrated.lineHeight": 1,
"terminal.integrated.showExitAlert": false,
"window.title": "${dirty} ${activeEditorShort} – ${rootName} | Visual Studio Code",
"window.titleBarStyle": "native",
"window.zoomLevel": 0,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"breadcrumbs.enabled": true,
// "debug.allowBreakpointsEverywhere": true,
"debug.toolBarLocation": "docked",
"debug.inlineValues": false,
"debug.openDebug": "openOnDebugBreak",
"git.enableSmartCommit": true,
"extensions.ignoreRecommendations": true,
// "update.channel": "none",
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"lldb.launch.expressions": "native",
"bracketPairColorizer.forceIterationColorCycle": true,
"bracketPairColorizer.forceUniqueOpeningColor": true,
"bracketPairColorizer.showBracketsInRuler": true,
// "bracketPairColorizer.showBracketsInGutter": true,
// "bracketPairColorizer.timeOut": 100,
"bracketPairColorizer.consecutivePairColors": [
"()",
"[]",
"{}",
["<", "</"],
["<", "/>"],
["begin","end"],
["case","end"],
["class","end"],
["record","end"],
["try","end"],
["repeat","until"],
["interface","implementation"],
// ["implementation","initialization"],
// ["implementation","finalization"],
["implementation","end"],
// ["initialization","finalization"],
["initialization","end"],
["finalization","end"],
[
"Gold",
"Orchid",
"LightSkyBlue",
"LightGreen"
],
"Red"
],
"better-comments.tags": [
{
"tag": "*",
"color": "#00AA00",
"strikethrough": false
},{
"tag": "?",
"color": "#BABA00",
"strikethrough": false
},{
"tag": "!",
"color": "#DD2222",
"strikethrough": false
},{
"tag": "+",
"color": "#3377FF",
"strikethrough": false
},{
"tag": "-",
"color": "#666666",
"strikethrough": true
},{
"tag": "#",
"color": "#BBBBBB",
"strikethrough": false
},{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false
},{
"tag": "note",
"color": "#BBBBBB",
"strikethrough": false
},{
"tag": "debug",
"color": "#DD2222",
"strikethrough": false
},{
"tag": "log",
"color": "#666666",
"strikethrough": false
}
],
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"cwd": "${workspaceFolder}",
"env": {
// task settings for files and folders
"PROJECTFILE": "${relativeFile}",
"PROJECTBASE": "${fileBasenameNoExtension}",
"JCF" : "~/Documents/pascal/jcf",
"UNITS" : "~/Documents/GitHub/*",
"INCLUDES" : "~/Documents/pascal/inc/*",
"LIBRARIES" : "~/Documents/pascal/lib/*",
"OUTPUT" : "out",
"DEBUG" : "out/debug",
"RELEASE" : "out/release",
"DEPLOY" : "out/deploy",
"EXTENSION" : "", // set this to .cgi for web app
"PROCESSOR" : "-Px86_64",
"OPSYSTEM" : "-Tdarwin",
"SYNTAX" : "-Mobjfpc",
"INSTANTFPCOPTIONS": "-Fu~/Documents/GitHub/*",
},
},
"tasks": [
{ //! FPC Build Debug task
"label" : "fpc: Build Debug",
"type" : "shell",
"group" : "build",
"command": "fpc",
"args": [
"${PROJECTFILE}", // main project file
"${PROCESSOR}", // target processor
"${OPSYSTEM}", // target operating system
"${SYNTAX}", // pascal syntax mode
"-Scahi", // pascal syntax setting
"-CroOti", // generated code setting
"-O-", // disable optimization
"-Xg", // external debug info
"-B", // rebuild all units
"-v", // verbose message
"-glpsw2", // dwarf debug setting
"-godwarfcpp", // dwarf mode setting
"-Fu${UNITS}", // additional units
"-Fi${INCLUDES}", // additional include files
"-Fl${LIBRARIES}", // additional libraries
"-FE${DEBUG}", // output for binary
"-FU${OUTPUT}", // output for units
],
"problemMatcher": {
"owner" : "objectpascal",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern" : {
// capture FPC's error messages and display them in Problems panel
"kind" : "location",
"regexp" : "^(.*)\\((\\d.*),(\\d.*)\\) (Warning|Error|Fatal): (.*)$",
"file" : 1,
"line" : 2,
"column" : 3,
"severity" : 4,
"message" : 5,
"loop" : true
}
}
},
{ //! FPC Build Release task: cmd+shift+B (run build task)
"label" : "fpc: Build Release",
"type" : "shell",
"group": {
"kind": "build",
"isDefault": true
},
"command": "fpc",
"args": [
"${PROJECTFILE}", // main project file
"${PROCESSOR}", // target processor
"${OPSYSTEM}", // target operating system
"${SYNTAX}", // pascal syntax mode
"-Schi", // pascal syntax setting
"-CX", // generated code setting
"-O3", // code optimization setting
"-XXs", // executable setting
"-B", // rebuild all units
"-v", // verbose message
"-Fu${UNITS}", // additional units
"-Fi${INCLUDES}", // additional include files
"-Fl${LIBRARIES}", // additional libraries
"-FE${RELEASE}", // output for binary
"-FU${OUTPUT}", // output for units
],
"problemMatcher": {
"owner" : "objectpascal",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern" : {
// capture FPC's error messages and display them in Problems panel
"kind" : "location",
"regexp" : "^(.*)\\((\\d.*),(\\d.*)\\) (Warning|Error|Fatal): (.*)$",
"file" : 1,
"line" : 2,
"column" : 3,
"severity" : 4,
"message" : 5,
"loop" : true
}
}
},
{ //! FPC Syntax Check task
"label" : "fpc: Syntax Check",
"type" : "shell",
"group" : "build",
"command": "fpc",
"args": [
"${PROJECTFILE}", // main project file
"${PROCESSOR}", // target processor
"${OPSYSTEM}", // target operating system
"${SYNTAX}", // pascal syntax mode
"-Scahi", // pascal syntax setting
"-Se99", // maximum error found
"-B", // rebuild all units
"-v", // verbose message
"-s", // syntax check mode
"-Fu${UNITS}", // additional units
"-Fi${INCLUDES}", // additional include files
"-Fl${LIBRARIES}", // additional libraries
"-FE${OUTPUT}", // output for binary
"-FU${OUTPUT}", // output for units
],
"presentation": {
"reveal": "silent"
},
"problemMatcher": {
"owner" : "objectpascal",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern" : {
// capture FPC's error messages and display them in Problems panel
"kind" : "location",
"regexp" : "^(.*)\\((\\d.*),(\\d.*)\\) (Warning|Error|Fatal): (.*)$",
"file" : 1,
"line" : 2,
"column" : 3,
"severity" : 4,
"message" : 5,
"loop" : true
}
}
},
{ //! InstantFPC Run Code
"label" : "fpc: Run Code",
"type" : "shell",
"group" : "test",
"command": "instantfpc",
"args": [
"${PROJECTFILE}", // main project file
"-B", // always build
],
"presentation": {
"focus": true
},
"problemMatcher": {
"owner" : "objectpascal",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern" : {
// capture FPC's error messages and display them in Problems panel
"kind" : "location",
"regexp" : "^(.*)\\((\\d.*),(\\d.*)\\) (Warning|Error|Fatal): (.*)$",
"file" : 1,
"line" : 2,
"column" : 3,
"severity" : 4,
"message" : 5,
"loop" : true
}
}
},
{ //! Shell Run Binary: cmd+shift+R (run test task)
"label": "fpc: Run Binary",
"type" : "shell",
"group": {
"kind": "test",
"isDefault": true
},
"command": "./${RELEASE}/${PROJECTBASE}",
"args": [],
"presentation": {
"focus": true
},
"problemMatcher": []
},
{ //! Shell Deploy Binary
"label" : "fpc: Deploy Binary",
"type" : "shell",
"command": "cp",
"args": [
"${RELEASE}/${PROJECTBASE}", // from release
"${DEPLOY}/${PROJECTBASE}${EXTENSION}", // to deploy
],
"presentation": {
"reveal": "silent"
},
"problemMatcher": []
},
{ //! JCF Beautify Code
"label" : "JCF: Beautify Code",
"type" : "shell",
"command": "${JCF}",
"args": [
"${PROJECTFILE}",
"-clarify",
"-inplace",
"-config=jcf.xml"
],
"presentation": {
"reveal": "never"
},
"problemMatcher": []
},
{ //! JCF Obfuscate Code
"label" : "JCF: Obfuscate Code",
"type" : "shell",
"command": "${JCF}",
"args": [
"${PROJECTFILE}",
"-obfuscate",
"-inplace",
"-config=jcf.xml"
],
"presentation": {
"reveal": "never"
},
"problemMatcher": []
},
{ //! Shell Clean Files
"label" : "fpc: Clean Files",
"type" : "shell",
"command": "rm",
"args": [
"-rf", // force recursive
"${DEPLOY}/${PROJECTBASE}${EXTENSION}", // deployed binary
"${RELEASE}/${PROJECTBASE}", // released binary
"${DEBUG}/${PROJECTBASE}.dSYM", // dwarf folder
"${DEBUG}/${PROJECTBASE}", // debugged binary
"${OUTPUT}/${PROJECTBASE}", // compiled files
"${OUTPUT}/link.res", // linker libraries
"${OUTPUT}/ppas.sh", // linker script
"${OUTPUT}/*.o", // unit object
"${OUTPUT}/*.s", // unit assembly
"${OUTPUT}/*.ppu", // compiled units
// "${OUTPUT}/*.*", // all unit files
"~/.cache/instantfpc/${PROJECTBASE}", // ifpc cache
"~/.cache/instantfpc/${PROJECTBASE}.*", // ifpc cache
],
"presentation": {
"reveal": "never"
},
"problemMatcher": []
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.