You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In project explorer, I created a new file with extension '.test' and wanna display a customized file icon in left side for it, is LabelProviderContribution the right way? best to show me an example.
The text was updated successfully, but these errors were encountered:
In your extension, you have to subclass the WorkspaceUriLabelProviderContribution:
@injectable()exportclassYourUriLabelProviderContributionextendsWorkspaceUriLabelProviderContribution{canHandle(element: object): number{if((elementinstanceofURI||FileStat.is(element))&&yourelement){returnNumber.MAX_SAFE_INTEGER;// Or a higher number than the default one.}returnsuper.canHandle(element);}asyncgetIcon(element: URI|FileStat): Promise<string>{if(yourelement){returnyouricon.// For instance, `fa fa-file`.}returnsuper.getIcon(element);}}// where `your element` has to check the file extension of the URI.
Then you have to bind your label provider contribution in your frontend module:
In project explorer, I created a new file with extension '.test' and wanna display a customized file icon in left side for it, is LabelProviderContribution the right way? best to show me an example.
The text was updated successfully, but these errors were encountered: