Skip to content

Commit 89a24db

Browse files
committed
First implementation prototype for "Move to Line" action
1 parent 2502e53 commit 89a24db

File tree

9 files changed

+647
-1
lines changed

9 files changed

+647
-1
lines changed

bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Require-Bundle: org.eclipse.ui,
3535
org.eclipse.lsp4j.jsonrpc;bundle-version="0.22.0",
3636
org.eclipse.cdt.codan.core,
3737
org.eclipse.cdt.debug.ui,
38-
org.eclipse.ui.workbench.texteditor
38+
org.eclipse.ui.workbench.texteditor,
39+
org.eclipse.core.filesystem,
40+
org.eclipse.cdt.debug.core
3941
Bundle-RequiredExecutionEnvironment: JavaSE-17
4042
Automatic-Module-Name: org.eclipse.cdt.lsp
4143
Bundle-ActivationPolicy: lazy
140 Bytes
Loading

bundles/org.eclipse.cdt.lsp/plugin.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ providerName=C/C++ Editor (LSP)
33

44
AddBreakpoint.label=Toggle Brea&kpoint
55
EnableBreakpoint.label=&Toggle Breakpoint Enabled
6+
MoveToLineAction.label=&Move to Line\u0020

bundles/org.eclipse.cdt.lsp/plugin.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@
277277
menubarPath="debug">
278278
</action>
279279
</viewerContribution>
280+
<viewerContribution
281+
id="org.eclipse.cdt.lsp.CEditor.EditorPopupActions"
282+
targetID="org.eclipse.cdt.lsp.CEditor.EditorContext">
283+
<action
284+
class="org.eclipse.cdt.lsp.internal.debug.ui.MoveToLineActionDelegate"
285+
enablesFor="1"
286+
icon="icons/elcl16/move_to_line_co.gif"
287+
id="org.eclipse.cdt.lsp.CEditor.MoveToLineActionDelegate"
288+
label="%MoveToLineAction.label"
289+
menubarPath="additions">
290+
</action>
291+
</viewerContribution>
280292
</extension>
281293

282294
<extension
@@ -378,6 +390,16 @@
378390
contentType="org.eclipse.cdt.core.cxxHeader"
379391
icon="icons/h.png">
380392
</icon>
393+
</extension>
394+
<extension
395+
point="org.eclipse.core.runtime.adapters">
396+
<factory
397+
adaptableType="org.eclipse.ui.internal.genericeditor.ExtensionBasedTextEditor"
398+
class="org.eclipse.cdt.lsp.internal.debug.ui.RetargettableActionAdapterFactory">
399+
<adapter
400+
type="org.eclipse.cdt.debug.internal.ui.actions.IMoveToLineTarget">
401+
</adapter>
402+
</factory>
381403
</extension>
382404
</plugin>
383405

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2004, 2006 QNX Software Systems and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* QNX Software Systems - Initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.cdt.lsp.internal.debug.ui;
15+
16+
import java.util.MissingResourceException;
17+
import java.util.ResourceBundle;
18+
19+
public class ActionMessages {
20+
21+
private static final String BUNDLE_NAME = "org.eclipse.cdt.lsp.internal.debug.ui.ActionMessages"; //$NON-NLS-1$
22+
23+
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
24+
25+
private ActionMessages() {
26+
}
27+
28+
public static String getString(String key) {
29+
try {
30+
return RESOURCE_BUNDLE.getString(key);
31+
} catch (MissingResourceException e) {
32+
return '!' + key + '!';
33+
}
34+
}
35+
}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
###############################################################################
2+
# Copyright (c) 2003, 2015 QNX Software Systems and others.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the Eclipse Public License 2.0
6+
# which accompanies this distribution, and is available at
7+
# https://www.eclipse.org/legal/epl-2.0/
8+
#
9+
# SPDX-License-Identifier: EPL-2.0
10+
#
11+
# Contributors:
12+
# QNX Software Systems - initial API and implementation
13+
# Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299
14+
# Marc Khouzam (Ericsson) - Added dynamic printf support (400628)
15+
# Simon Marchi (Ericsson) - Modified error messages in CastToArrayActionDelegate (437182)
16+
# Marc Dumais (Ericsson) - Bug 437692
17+
# Alvaro Sanchez-Leon (Ericsson) - Allow user to edit the register groups (Bug 235747)
18+
# Jonah Graham (Kichwa Coders) - Create "Add Line Breakpoint (C/C++)" action (Bug 464917)
19+
###############################################################################
20+
21+
LoadSymbolsActionDelegate.Unable_to_load_symbols_of_shared_library_1=Unable to load symbols of shared library.
22+
LoadSymbolsActionDelegate.Operation_failed_1=Operation failed.
23+
LoadSymbolsForAllAction.Load_Symbols_For_All_1=Load Symbols For All
24+
LoadSymbolsForAllAction.Load_symbols_for_all_shared_libraries_1=Load symbols for all shared libraries.
25+
LoadSymbolsForAllAction.Load_Symbols_For_All_2=Load Symbols For All
26+
LoadModuleSymbolsActionDelegate.0=Unable to load symbols.
27+
LoadSymbolsForAllAction.Unable_to_load_symbols_1=Unable to load symbols.
28+
SignalZeroObjectActionDelegate.0=Unable to resume ignoring the signal.
29+
SignalZeroObjectActionDelegate.1=Operation failed.
30+
RunToLineActionDelegate.Error_1=Error
31+
RunToLineActionDelegate.Operation_failed_1=Operation failed.
32+
RunToLineAdapter.Empty_editor_1=Empty editor
33+
RunToLineAdapter.0=Run to Line failed.
34+
RunToLineAdapter.Missing_document_1=Missing document
35+
ToggleBreakpointAdapter.Empty_editor_1=Empty editor
36+
ToggleBreakpointAdapter.Missing_document_1=Missing document
37+
ToggleBreakpointAdapter.Missing_resource_1=Missing resource
38+
ToggleBreakpointAdapter.Invalid_line_1=Invalid line
39+
ToggleBreakpointAdapter.Empty_editor_2=Empty editor
40+
ToggleWatchpointActionDelegate.Error_1=Error
41+
ToggleBreakpointAdapter.Missing_document_2=Missing document
42+
ToggleBreakpointAdapter.Missing_resource_2=Missing resource
43+
ToggleBreakpointAdapter.Invalid_expression_1=Invalid expression:\u0020
44+
RunToLineAdapter.Operation_is_not_supported_1=Operation is not supported.
45+
EnableDisableBreakpointRulerAction.Enable_Breakpoint_1=&Enable Breakpoint
46+
EnableDisableBreakpointRulerAction.Enabling_disabling_breakpoints_1=Enabling/disabling breakpoints
47+
EnableDisableBreakpointRulerAction.Exceptions_occurred_enabling_or_disabling_breakpoint_1=Exceptions occurred enabling or disabling the breakpoint
48+
EnableDisableBreakpointRulerAction.Disable_Breakpoint_1=&Disable Breakpoint
49+
ToggleWatchpointActionDelegate.Operation_failed_1=Operation failed.
50+
ToggleBreakpointRulerAction.Error_1=Error
51+
ToggleBreakpointRulerAction.Operation_failed_1=Operation failed
52+
CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...
53+
CBreakpointPropertiesRulerAction.Error=Unable to edit breakpoint properties.
54+
ResumeAtLineActionDelegate.Error_1=Error
55+
ResumeAtLineActionDelegate.1=Error
56+
ResumeAtLineActionDelegate.2=Resume at line failed
57+
RestoreDefaultTypeActionDelegate.0=Unable to restore the default type.
58+
RestoreDefaultRegisterGroupsActionDelegate.0=Error
59+
RestoreDefaultRegisterGroupsActionDelegate.1=Error(s) occurred restoring default register groups.
60+
MoveToLineActionDelegate.1=Error
61+
MoveToLineActionDelegate.2=Move to line failed
62+
MoveToLineAdapter.0=Empty editor
63+
MoveToLineAdapter.1=Missing document
64+
MoveToLineAdapter.2=Empty editor
65+
MoveToLineAdapter.3=Operation is not supported.
66+
MoveToLineAdapter.4=Move To Line failed.
67+
ManageFunctionBreakpointActionDelegate.Error_1=Error
68+
ManageFunctionBreakpointActionDelegate.Operation_failed_1=Operation failed.
69+
SignalActionDelegate.0=Unable to deliver the signal to the target.
70+
SignalActionDelegate.1=Operation failed.
71+
VariableFormatActionDelegate.0=Unable to set format.
72+
ExpressionDialog.0=Add Watch Expression
73+
ExpressionDialog.1=Expression to watch:
74+
CastToTypeActionDelegate.0=The 'Type' field must not be empty.
75+
CastToTypeActionDelegate.1=Cast To Type
76+
CastToTypeActionDelegate.2=Enter type:
77+
CastToTypeActionDelegate.3=Unable to cast to type.
78+
CastToArrayActionDelegate.0=Display As Array
79+
CastToArrayActionDelegate.1=Start index:
80+
CastToArrayActionDelegate.2=Length
81+
CastToArrayActionDelegate.3=The 'Start index' field must not be empty.
82+
CastToArrayActionDelegate.4=Invalid start index.
83+
CastToArrayActionDelegate.5=The 'Length' field must not be empty.
84+
CastToArrayActionDelegate.6=Invalid length.
85+
CastToArrayActionDelegate.7=The length must be greater than 0.
86+
CastToArrayActionDelegate.8=Unable to display this variable as an array.
87+
AddFunctionBreakpointActionDelegate.0=Cannot add function breakpoint.
88+
AddLineBreakpointActionDelegate.0=Cannot add line breakpoint.
89+
AddWatchpointActionDelegate.0=Cannot add watchpoint.
90+
AddWatchpointOnVariableActionDelegate.No_Element_Size=Failed to get variable/expression size
91+
AddWatchpointOnVariableActionDelegate.Error_Dlg_Title=Error
92+
ResumeAtLineAdapter.0=Empty editor
93+
ResumeAtLineAdapter.1=Missing document
94+
ResumeAtLineAdapter.2=Empty editor
95+
ResumeAtLineAdapter.3=Operation is not supported.
96+
ResumeAtLineAdapter.4=Resume At Line failed.
97+
RegisterGroupDialog.0=New Group
98+
RegisterGroupDialog.1=Select All
99+
RegisterGroupDialog.2=Deselect All
100+
RegisterGroupDialog.3=Group Name:
101+
RegisterGroupDialog.4=Choose From The List:
102+
RegisterGroupDialog.5=Register Group
103+
RegisterGroupDialog.6=Select the group registers
104+
RegisterGroupDialog.7=The group name field must not be empty.
105+
ToggleDetailPaneAction.0=Vertical View Orientation
106+
ToggleDetailPaneAction.1=Place the Detail Pane Underneath the Main Tree View
107+
ToggleDetailPaneAction.2=Place the Detail Pane Underneath the Main Tree View
108+
ToggleDetailPaneAction.3=Horizontal View Orientation
109+
ToggleDetailPaneAction.4=Place the Detail Pane on the Right of the Main Tree View
110+
ToggleDetailPaneAction.5=Place the Detail Pane on the Right of the Main Tree View
111+
ToggleDetailPaneAction.6=Hide the Detail Pane so that only the Main Tree View is Visible
112+
ToggleDetailPaneAction.7=Hide the Detail Pane so that only the Main Tree View is Visible
113+
RegisterGroupActionDelegate.0=Error
114+
AddRegisterGroupActionDelegate.1=Error(s) occurred adding register group.
115+
EditRegisterGroupActionDelegate.0=Unable to edit register group.
116+
RemoveRegisterGroupsActionDelegate.0=Unable to remove register group(s).
117+
AddEventBreakpointActionDelegate.0=Error adding Event Breakpoint
118+
AddEventBreakpointActionDelegate.2=Action is not supported by installed debuggers
119+
ToggleCBreakpointsTargetFactory.CBreakpointDescription=Standard C/C++ breakpoint type.
120+
ToggleCBreakpointsTargetFactory.CBreakpointName=C/C++ Breakpoints
121+
ToggleCBreakpointsTargetFactory.CTracepointDescription=Standard C/C++ tracepoint type.
122+
ToggleCBreakpointsTargetFactory.CTracepointName=C/C++ Tracepoints
123+
ToggleCBreakpointsTargetFactory.CDynamicPrintfDescription=Standard C/C++ Dynamic Printf type.
124+
ToggleCBreakpointsTargetFactory.CDynamicPrintfName=C/C++ Dynamic Printf
125+
RetargetAction.0=Error
126+
RetargetAction.1=Operation failed
127+
RetargetMoveToLineAction.0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
128+
RetargetResumeAtLineAction.0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
129+
CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...
130+
CAddBreakpointInteractiveRulerAction_error_title=Error
131+
CAddBreakpointInteractiveRulerAction_error_message=Unable to create breakpoint
132+
CRulerToggleBreakpointActionDelegate_label=Toggle Brea&kpoint
133+
CRulerToggleBreakpointAction_accelerator=Double Click
134+
CAddDynamicPrintfInteractiveRulerAction_label=Add &Dynamic Printf...
135+
CAddDynamicPrintfInteractiveRulerAction_error_message=Unable to create dynamic printf
136+
OpenNewViewActionText=Open New View
137+
OpenNewViewActionTooltipText=Open New View

0 commit comments

Comments
 (0)