-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
breakpoints are ignored in debug mode #268
Comments
path in vscode-antlr4/src/backend/GrammarDebugger.ts Lines 485 to 489 in bc5e746
|
a simple patch just work for myselfjust to solve my own problem, without studying the code carefully, this patch may cause other problems. src/backend/facade.ts | 2 ++
src/frontend/AntlrDebugAdapter.ts | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/backend/facade.ts b/src/backend/facade.ts
index 88e712a..4f5a732 100644
--- a/src/backend/facade.ts
+++ b/src/backend/facade.ts
@@ -24,6 +24,7 @@ import {
} from "../types.js";
import { IATNGraphData } from "../webview-scripts/types.js";
import { SentenceGenerator } from "./SentenceGenerator.js";
+import { Uri } from 'vscode';
export class AntlrFacade {
// Mapping file names to SourceContext instances.
@@ -362,6 +363,7 @@ export class AntlrFacade {
}
public createDebugger(fileName: string, actionFile: string, dataDir: string): GrammarDebugger | undefined {
+ fileName = Uri.file(fileName).fsPath;
const context = this.getContext(fileName);
if (!context) {
return;
diff --git a/src/frontend/AntlrDebugAdapter.ts b/src/frontend/AntlrDebugAdapter.ts
index 24bf0d6..9e90e99 100644
--- a/src/frontend/AntlrDebugAdapter.ts
+++ b/src/frontend/AntlrDebugAdapter.ts
@@ -239,7 +239,6 @@ export class AntlrDebugSession extends DebugSession {
protected override setBreakPointsRequest(response: DebugProtocol.SetBreakpointsResponse,
args: DebugProtocol.SetBreakpointsArguments): void {
if (this.debugger) {
- this.debugger.clearBreakPoints();
if (args.breakpoints && args.source.path) {
const actualBreakpoints = args.breakpoints.map((sourceBreakPoint) => {
const { validated, line, id } = this.debugger!.addBreakPoint(args.source.path!,
|
Thanks for reporting the issue and providing a possible solution. I'll look at this later when I come back to the extension development. |
test code from #74
If I have another file also have some breakpoints (such as
Ztest.g
, which is used bysetBreakPointsRequest()
later thantest.g
).The breakpoints set by
test.g
will be clear byZtest.g
inthis.debugger.clearBreakPoints();
:vscode-antlr4/src/frontend/AntlrDebugAdapter.ts
Lines 239 to 245 in bc5e746
The text was updated successfully, but these errors were encountered: