Skip to content

Customize C/C++ destructor symbol overlay icons in outline view (fix #608)#609

Merged
ghentschke merged 8 commits into
eclipse-cdt:mainfrom
travkin79:patch-destructor
May 6, 2026
Merged

Customize C/C++ destructor symbol overlay icons in outline view (fix #608)#609
ghentschke merged 8 commits into
eclipse-cdt:mainfrom
travkin79:patch-destructor

Conversation

@travkin79
Copy link
Copy Markdown
Contributor

@travkin79 travkin79 commented Apr 16, 2026

This PR should fix #608 by customizing the destructor overlay icon calculation in all relevant views. It is dependent on eclipse-lsp4e/lsp4e#1521.

We depend on the new LSP4E extension point
"org.eclipse.lsp4e.symbolIconsProvider" that was introduced in
org.eclipse.lsp4e vers. 0.19.10 (LSP4E 0.30.3).
@travkin79 travkin79 marked this pull request as ready for review April 21, 2026 09:06
@travkin79
Copy link
Copy Markdown
Contributor Author

Hello @ghentschke and @jonahgraham,
Do you have some time to review this PR? Are there concrete plans for the next CDT LSP release?

@ghentschke
Copy link
Copy Markdown
Contributor

Hi @travkin79 ,
thank you for your work. I hope that I can take a closer look at it in the next couple of days

@ghentschke
Copy link
Copy Markdown
Contributor

At least on my Windows 11 machine I see the following exception when using this patchset:

!ENTRY org.eclipse.lsp4e 2 0 2026-04-25 08:34:55.777
!MESSAGE Failed to parse file name from URI file:///C:/Users/user/cdt-main/fresh-ws-2/CountIslands/IslandMapReader.hpp
!STACK 0
java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/user/cdt-main/fresh-ws-2/CountIslands/IslandMapReader.hpp
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
	at java.base/java.nio.file.Path.of(Path.java:148)
	at org.eclipse.lsp4e.operations.symbols.internal.SymbolIconProviderRegistry.getIconProvider(SymbolIconProviderRegistry.java:111)
	at org.eclipse.lsp4e.operations.symbols.internal.SymbolIconProviderRegistry.getSymbolIconProviderFor(SymbolIconProviderRegistry.java:100)
	at org.eclipse.lsp4e.outline.SymbolsLabelProvider.getImage(SymbolsLabelProvider.java:167)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceLabelProvider.findImage(NavigatorContentServiceLabelProvider.java:209)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceLabelProvider.getColumnImage(NavigatorContentServiceLabelProvider.java:112)
	at org.eclipse.ui.internal.navigator.NavigatorContentServiceLabelProvider.getImage(NavigatorContentServiceLabelProvider.java:104)
	at org.eclipse.ui.internal.navigator.NavigatorDecoratingLabelProvider$StyledLabelProviderAdapter.getImage(NavigatorDecoratingLabelProvider.java:63)
	at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.getImage(DelegatingStyledCellLabelProvider.java:199)
	at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.getImage(DecoratingStyledCellLabelProvider.java:176)
	at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.update(DelegatingStyledCellLabelProvider.java:125)
	at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.update(DecoratingStyledCellLabelProvider.java:136)
	at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:999)
	at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:156)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:169)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1072)
	at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:426)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:169)
	at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2111)
	at org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeViewer.java:3015)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(AbstractTreeViewer.java:2032)
	at org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:683)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(AbstractTreeViewer.java:2038)
	at org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:683)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:2005)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeViewer.java:1962)
	at org.eclipse.ui.navigator.CommonViewer.internalRefresh(CommonViewer.java:554)
	at org.eclipse.jface.viewers.StructuredViewer.lambda$3(StructuredViewer.java:1489)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1395)
	at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:368)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1356)
	at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1489)
	at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:534)
	at org.eclipse.ui.navigator.CommonViewer.refresh(CommonViewer.java:376)
	at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1450)
	at org.eclipse.lsp4e.outline.CNFOutlinePage.labelProviderChanged(CNFOutlinePage.java:369)
	at org.eclipse.jface.viewers.BaseLabelProvider$1.run(BaseLabelProvider.java:74)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:169)
	at org.eclipse.jface.viewers.BaseLabelProvider.fireLabelProviderChanged(BaseLabelProvider.java:71)
	at org.eclipse.ui.internal.decorators.DecoratorManager.lambda$0(DecoratorManager.java:348)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.ui.internal.decorators.DecoratorManager.fireListener(DecoratorManager.java:348)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$3.runInUIThread(DecorationScheduler.java:551)
	at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4122)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1051)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:684)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:615)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1415)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1387)

Comment thread bundles/org.eclipse.cdt.lsp/plugin.xml Outdated
Comment thread bundles/org.eclipse.cdt.lsp/plugin.xml
Comment thread bundles/org.eclipse.cdt.lsp/src/org/eclipse/cdt/lsp/plugin/LspPlugin.java Outdated
@travkin79
Copy link
Copy Markdown
Contributor Author

travkin79 commented Apr 27, 2026

Hello @ghentschke,

Thank you for reporting this issue. I reproduced it on Windows 11 and implemented a fix and a test case for LSP4E. I've created a separate LSP4E PR for that.

When looking at the GitHub workflow / CI job for CDT LSP, I saw that it is running on Linux only. Maybe we should try to run it also on Windows and MacOS. Besides, it seems, we're using a pretty old clangd version in the CI job.

At least on my Windows 11 machine I see the following exception when using this patchset:

!ENTRY org.eclipse.lsp4e 2 0 2026-04-25 08:34:55.777
!MESSAGE Failed to parse file name from URI file:///C:/Users/user/cdt-main/fresh-ws-2/CountIslands/IslandMapReader.hpp
!STACK 0
java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/user/cdt-main/fresh-ws-2/CountIslands/IslandMapReader.hpp
	...

Copy link
Copy Markdown
Contributor

@ghentschke ghentschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with the changes. I think this can be merged when the LSP4E change has been merged as well.

Comment thread bundles/org.eclipse.cdt.lsp/META-INF/MANIFEST.MF Outdated
@ghentschke ghentschke merged commit 45ddca5 into eclipse-cdt:main May 6, 2026
2 checks passed
@ghentschke
Copy link
Copy Markdown
Contributor

Thank you for your work @travkin79

@travkin79
Copy link
Copy Markdown
Contributor Author

Thank you for reviewing, testing, and merging, @ghentschke.

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.

Destructor Icons in the outline look the same as constructor icons

2 participants