Home » Newcomers » Newcomers » Code responsible for QuickFix
|
Re: Code responsible for QuickFix [message #1785798 is a reply to message #1785794] |
Fri, 20 April 2018 05:47 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
I don't know the answer. But there are some techniques that will help. First, to make it easier to find source for any class available in the target platform, type "add all" in the quick search field in the upper right, just to the left of the perspective control toolbar, to invoke All Plug-ins to Java Search. This will ensure that Ctrl-Shift-T will be able to find any class in any plugin even if no plugin in your workspace depends on it.
Then Alt-Shift-F1 and Alt-Shift-F2 are useful for invoking the plugin spy and the menu spy so you can find out which things are active and which classes implement those things.
The debugger is your best friend too. Launch a runtime instance of Eclipse (via Run -> Debug Configurations... to create a new Eclipse Application to launch). In the debugger you can always pause the main thread to see what it's doing.
Ctrl-1 brings up a shell, so using Ctrl-Shift-T to open the Shell class and set a breakpoint on org.eclipse.swt.widgets.Shell.Shell(Display, Shell, int, long, boolean) or which ever constructor all the other constructors delegate to on the Mac.
Doing that and then using Ctrl-1 in the Java editor in the runtime Eclipse instance you're debugging, you'll see stuff like this on the stack:Shell.<init>(Display, Shell, int, long, boolean) line: 280
Shell.<init>(Shell, int) line: 378
CompletionProposalPopup.createProposalSelector() line: 591
CompletionProposalPopup$2.run() line: 500
BusyIndicator.showWhile(Display, Runnable) line: 71
CompletionProposalPopup.showProposals(boolean) line: 483
QuickAssistAssistant$QuickAssistAssistantImpl(ContentAssistant).showPossibleCompletions() line: 1829
JavaCorrectionAssistant(QuickAssistAssistant).showPossibleQuickAssists() line: 109
JavaCorrectionAssistant.showPossibleQuickAssists() line: 198
CompilationUnitEditor$AdaptedSourceViewer.doOperation(int) line: 197
TextOperationAction$1.run() line: 130
BusyIndicator.showWhile(Display, Runnable) line: 71
TextOperationAction.run() line: 127
TextOperationAction(Action).runWithEvent(Event) line: 473
ActionHandler.execute(ExecutionEvent) line: 118
E4HandlerProxy.execute(IEclipseContext, Map, Event, IEvaluationContext) line: 93
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
MethodRequestor.execute() line: 55
InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean, boolean, boolean) line: 318
InjectorImpl.invoke(Object, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 252
ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext, IEclipseContext, Object) line: 161
WorkbenchHandlerServiceHandler(HandlerServiceHandler).execute(ExecutionEvent) line: 152
Command.executeWithChecks(ExecutionEvent) line: 494
ParameterizedCommand.executeWithChecks(Object, Object) line: 487
HandlerServiceImpl.executeHandler(ParameterizedCommand, IEclipseContext) line: 210
KeyBindingDispatcher.executeCommand(ParameterizedCommand, Event) line: 287
KeyBindingDispatcher.press(List<KeyStroke>, Event) line: 523
KeyBindingDispatcher.processKeyEvent(List<KeyStroke>, Event) line: 573
KeyBindingDispatcher.filterKeySequenceBindings(Event) line: 385
KeyBindingDispatcher.access$0(KeyBindingDispatcher, Event) line: 331
KeyBindingDispatcher$KeyDownFilter.handleEvent(Event) line: 88
Now you know which code is involved in the process of populating the quick fix and can further investigate in the debugger how the various parts are working together.
Googling for reference information, e.g., "eclipse implement a quick fix" should help you find links such as this:
https://wiki.eclipse.org/FAQ_How_do_I_implement_Quick_Fixes_for_my_own_language%3F
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Sat Jan 25 10:36:42 GMT 2025
Powered by FUDForum. Page generated in 0.06055 seconds
|