Skip to content

Commit 08b17e9

Browse files
committed
fixes #105
1 parent 143070c commit 08b17e9

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/src/cc/codechecker/plugin/config/CodeCheckerContext.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,34 @@ public void refreshAfterBuild(final IProject project) {
264264
*
265265
* @param partRef the IEditorPart which the user has switched.
266266
*/
267-
public void refreshChangeEditorPart(IEditorPart partRef) {
267+
public void refreshChangeEditorPart(IEditorPart partRef) {
268+
if (partRef.getEditorInput() instanceof IFileEditorInput){
269+
//could be FileStoreEditorInput
270+
//for files which are not part of the
271+
//current workspace
272+
activeEditorPart = partRef;
273+
IFile file = ((IFileEditorInput) partRef.getEditorInput()).getFile();
274+
IProject project = file.getProject();
268275

269-
activeEditorPart = partRef;
270-
IFile file = ((IFileEditorInput) partRef.getEditorInput()).getFile();
271-
IProject project = file.getProject();
276+
CcConfiguration config = new CcConfiguration(project);
277+
if (!config.isConfigured()) {
278+
return;
279+
}
272280

273-
CcConfiguration config = new CcConfiguration(project);
274-
if (!config.isConfigured()) {
275-
return;
276-
}
281+
String filename = config.convertFilenameToServer(file.getProjectRelativePath().toString());
277282

278-
String filename = config.convertFilenameToServer(file.getProjectRelativePath().toString());
283+
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
284+
if(activeWindow == null) {
285+
Logger.log(IStatus.ERROR, " Error activeWindow is null!");
286+
return;
287+
}
288+
IWorkbenchPage[] pages = activeWindow.getPages();
279289

280-
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
281-
if(activeWindow == null) {
282-
Logger.log(IStatus.ERROR, " Error activeWindow is null!");
283-
return;
290+
this.refreshProject(pages, project, true);
291+
this.refreshCurrent(pages, project, filename, true);
292+
this.refreshCustom(pages, project, "", true);
293+
this.activeProject = project;
284294
}
285-
IWorkbenchPage[] pages = activeWindow.getPages();
286-
287-
this.refreshProject(pages, project, true);
288-
this.refreshCurrent(pages, project, filename, true);
289-
this.refreshCustom(pages, project, "", true);
290-
this.activeProject = project;
291295
}
292296

293297
/**

0 commit comments

Comments
 (0)