Skip to content

Commit f02929b

Browse files
committed
feat: instrument plpgsql function bodies with lexer
1 parent 98cc372 commit f02929b

8 files changed

Lines changed: 442 additions & 96 deletions

File tree

.vscode/launch.json

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
"mode": "test",
4040
"program": "${fileDirname}",
4141
"env": {
42-
"CGO_ENABLED": "1"
42+
"CGO_ENABLED": "1",
43+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
44+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
4345
},
4446
"showLog": false
4547
},
@@ -50,7 +52,9 @@
5052
"mode": "test",
5153
"program": "${fileDirname}",
5254
"env": {
53-
"CGO_ENABLED": "1"
55+
"CGO_ENABLED": "1",
56+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
57+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
5458
},
5559
"args": [
5660
"-test.run",
@@ -65,7 +69,9 @@
6569
"mode": "test",
6670
"program": "${workspaceFolder}/internal",
6771
"env": {
68-
"CGO_ENABLED": "1"
72+
"CGO_ENABLED": "1",
73+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
74+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
6975
},
7076
"args": [
7177
"-test.v",
@@ -75,6 +81,51 @@
7581
"5m"
7682
],
7783
"showLog": false
84+
},
85+
{
86+
"name": "Debug Current Test Function",
87+
"type": "go",
88+
"request": "launch",
89+
"mode": "test",
90+
"program": "${fileDirname}",
91+
"env": {
92+
"CGO_ENABLED": "1",
93+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
94+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
95+
},
96+
"args": [
97+
"-test.run",
98+
"^${input:testName}$",
99+
"-test.v"
100+
],
101+
"showLog": true,
102+
"buildFlags": "-gcflags='all=-N -l'"
103+
},
104+
{
105+
"name": "Debug Test at Cursor",
106+
"type": "go",
107+
"request": "launch",
108+
"mode": "test",
109+
"program": "${fileDirname}",
110+
"env": {
111+
"CGO_ENABLED": "1",
112+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
113+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
114+
},
115+
"args": [
116+
"-test.run",
117+
"${command:go.test.cursor}"
118+
],
119+
"showLog": false,
120+
"buildFlags": "-gcflags='all=-N -l'"
121+
}
122+
],
123+
"inputs": [
124+
{
125+
"id": "testName",
126+
"description": "Test function name",
127+
"default": "TestInstrumentWithLexer",
128+
"type": "promptString"
78129
}
79130
]
80131
}

.vscode/settings.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,31 @@
3333
// Go language server (gopls) settings
3434
"gopls": {
3535
"build.env": {
36-
"CGO_ENABLED": "1"
36+
"CGO_ENABLED": "1",
37+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe"
3738
}
39+
},
40+
// Go extension debugging configuration
41+
"go.delveConfig": {
42+
"apiVersion": 2,
43+
"showGlobalVariables": true
44+
},
45+
// Ensure Go test runner uses CGO
46+
"go.testEnvVars": {
47+
"CGO_ENABLED": "1",
48+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
49+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
50+
},
51+
// Go build tags and flags
52+
"go.buildTags": "",
53+
"go.buildFlags": ["-ldflags", "-s -w"],
54+
"go.testFlags": ["-v"],
55+
"go.testTimeout": "300s",
56+
// Additional settings to help with debugging
57+
"go.useLanguageServer": true,
58+
"go.alternateTools": {},
59+
"go.enableCodeLens": {
60+
"runtest": true
3861
}
3962
}
4063

.vscode/tasks.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
"label": "Unit Test",
3131
"type": "shell",
3232
"command": "go test -failfast -p 1 -timeout=300s -parallel=1 .${pathSeparator}${relativeFileDirname}${pathSeparator}... -coverprofile='coverage.out' -json | tparse -all -progress",
33+
"options": {
34+
"env": {
35+
"CGO_ENABLED": "1",
36+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
37+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
38+
}
39+
},
3340
"problemMatcher": [
3441
"$go"
3542
],
@@ -43,6 +50,31 @@
4350
"focus": true
4451
}
4552
},
53+
{
54+
"label": "Debug Test Build",
55+
"type": "shell",
56+
"command": "go",
57+
"args": [
58+
"test",
59+
"-c",
60+
"-gcflags",
61+
"all=-N -l",
62+
"./${relativeFileDirname}"
63+
],
64+
"options": {
65+
"env": {
66+
"CGO_ENABLED": "1",
67+
"CC": "C:\\msys64\\mingw64\\bin\\gcc.exe",
68+
"PATH": "${env:PATH};C:\\msys64\\mingw64\\bin"
69+
}
70+
},
71+
"group": "test",
72+
"presentation": {
73+
"reveal": "always",
74+
"panel": "shared"
75+
},
76+
"problemMatcher": ["$go"]
77+
},
4678
{
4779
"label": "Coverage Report",
4880
"type": "shell",

internal/instrument/injector.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)