Skip to content
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

Basic support of toggle line breakpoints in C/C++ Editor (LSP) #46

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

ghentschke
Copy link
Contributor

Implements #45

@ghentschke
Copy link
Contributor Author

ghentschke commented Apr 17, 2023

To enable C/C++ breakpoints in the LSP based C/C++ editor, this fix is needed in org.eclipse.cdt.debug.internal.ui.breakpoints.ToggleCBreakpointTester:

	// Test for LSP based C/C++ Editor
} else if ("isCEditorSupportsCBreakpoint".equals(property) && (receiver instanceof TextEditor)) { //$NON-NLS-1$
	var editor = (TextEditor) receiver;
	if (editor.getEditorSite() == null || !editor.getEditorSite().getId().equals("org.eclipse.cdt.lsp.CEditor")) //$NON-NLS-1$
		return false;
	if (!CDebugUtils.isCustomToggleBreakpointFactory())
		return true;
}

@ghentschke ghentschke changed the title Support toggle breakpoints in C/C++ Editor (LSP) Basic support of toggle line breakpoints in C/C++ Editor (LSP) Apr 17, 2023
@jonahgraham
Copy link
Member

jonahgraham commented Apr 17, 2023 via email

jonahgraham added a commit to eclipse-cdt/cdt that referenced this pull request Apr 25, 2023
This is an example of where we have somewhat an inversion of dependencies.
The existing CDT code assumes it knows about all types of editors
at compile time. In this case the LSP C Editor is a new type. However,
rather than creating a new extension mechanism here we are simply
adding the LSP C Editor to the known list as the LSP C Editor
is (or will soon be) part of CDT itself anyway (see #354)

By itself this change doesn't do anything, it needs the
change in eclipse-cdt/cdt-lsp#46

Also-by: Gesa HENTSCHKE <Gesa.HENTSCHKE@bachmann.info>
@jonahgraham
Copy link
Member

To enable C/C++ breakpoints in the LSP based C/C++ editor, this fix is needed in org.eclipse.cdt.debug.internal.ui.breakpoints.ToggleCBreakpointTester:

	// Test for LSP based C/C++ Editor
} else if ("isCEditorSupportsCBreakpoint".equals(property) && (receiver instanceof TextEditor)) { //$NON-NLS-1$
	var editor = (TextEditor) receiver;
	if (editor.getEditorSite() == null || !editor.getEditorSite().getId().equals("org.eclipse.cdt.lsp.CEditor")) //$NON-NLS-1$
		return false;
	if (!CDebugUtils.isCustomToggleBreakpointFactory())
		return true;
}

In progress on eclipse-cdt/cdt#384

@ghentschke ghentschke merged commit 45dbe72 into eclipse-cdt:master Apr 26, 2023
@ghentschke ghentschke deleted the toggle-breakpoints branch April 26, 2023 05:49
jonahgraham added a commit to eclipse-cdt/cdt that referenced this pull request Apr 27, 2023
This is an example of where we have somewhat an inversion of dependencies.
The existing CDT code assumes it knows about all types of editors
at compile time. In this case the LSP C Editor is a new type. However,
rather than creating a new extension mechanism here we are simply
adding the LSP C Editor to the known list as the LSP C Editor
is (or will soon be) part of CDT itself anyway (see #354)

By itself this change doesn't do anything, it needs the
change in eclipse-cdt/cdt-lsp#46

Also-by: Gesa HENTSCHKE <Gesa.HENTSCHKE@bachmann.info>
@jonahgraham jonahgraham added this to the 1.0.0 milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants