-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce unused exports #164933
Comments
For the workbench.web.api.ts file, all those are still needed. For the other files attached to my name, I removed the |
I wenrt through the list. Removed the ones I marked with ✔️. I kept the ones I marked with 'api', as these are types that are part of an exported API and should stay available. They are also just types and interfaces, so have no impact on the built bits |
@rebornix and I were wondering if there is any dead code in the VS Code codebase, and one idea was to detect unused exports across the codebase, since unused variables are flagged by the compiler but unused exports are not.
I ran
ts-unused-exports
on our sources and generated the following list. I've already done a pass to remove some false positives but apologies if several remain.NB: The primary purpose of this issue is to identify unused functions and classes which aren't being picked up by the compiler because they're exported and which can be safely deleted from our sources to reduce our bundle size. A secondary benefit is to remove unused types and interfaces, e.g. anything which was exported at one point and then ceased to be referenced from other files (which more impacts compile time for dev workflows and pipeline runs, and maybe TS server analysis time, but has no direct impact on bundle size since types are erased).
If you export a type or interface that is not currently actively imported, but is used in the public API of a class that you expose, then it's quite likely that you want to keep that type/interface exported and need not un-export it as part of this issue.
Please feel free to remove your assignment if you find that this isn't valuable.
IHoverContent
IIconRegistry
getClassNamesArray
iconStartMarker
ExtensionVirtualWorkspaceSupport
IIconFilter
cssEscape
FoldingModelChangeEvent
ID_INDENT_PROVIDER
RangesCollector
ID_SYNTAX_PROVIDER
RangesCollector
editorMarkerNavigationError
editorMarkerNavigationErrorHeader
editorMarkerNavigationWarning
editorMarkerNavigationInfo
editorMarkerNavigationInfoHeader
editorMarkerNavigationBackground
editorHoverWidgetHighlightForeground
editorSuggestWidgetBackground
editorSuggestWidgetBorder
editorSuggestWidgetForeground
editorSuggestWidgetSelectedForeground
editorSuggestWidgetSelectedIconForeground
editorSuggestWidgetSelectedBackground
editorSuggestWidgetHighlightForeground
editorSuggestWidgetHighlightFocusForeground
editorSuggestWidgetStatusForeground
suggestMoreInfoIcon
defineTheme
setTheme
getEncodedLanguageId
IEncodedLineTokens
EncodedTokensProvider
CodeActionContext
ShutdownEvent
IIconsStyleSheet
IconIdentifier
IconDefaults
IconFontContribution
IThemingParticipant
TOKEN_TYPE_WILDCARD
TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR
CLASSIFIER_MODIFIER_SEPARATOR
TokenClassificationString
idPattern
selectorPattern
TokenSelector
TokenTypeOrModifierContribution
TokenStyleFunction
TokenStyleDefaults
SemanticTokenDefaultRule
Extensions
TestFileIconTheme
UnthemedProductIconTheme
OpenCommandPipeArgs
OpenExternalCommandPipeArgs
StatusPipeArgs
ExtensionManagementPipeArgs
debugExceptionWidgetBorder
debugExceptionWidgetBackground
settingsGroupExpandedIcon
settingsGroupCollapsedIcon
settingsAddIcon
editorGutterAddedBackground
editorGutterDeletedBackground
minimapGutterModifiedBackground
minimapGutterAddedBackground
minimapGutterDeletedBackground
overviewRulerModifiedForeground
overviewRulerAddedForeground
overviewRulerDeletedForeground
scmProviderSeparatorBorderColor
searchEditorTextInputBorder
embeddedEditorBackground
getWorkspaceIdentifier
textmateColorSettingsSchemaId
parseWithLocation
ThemeChangeEvent
IThemeData
IThemeScopedColorCustomizations
IThemeScopedTokenColorCustomizations
IThemeScopedSemanticTokenColorCustomizations
IThemeScopedExperimentalSemanticTokenColorCustomizations
IExperimentalSemanticTokenColorCustomizations
ITokenColorizationSetting
ExtensionVersion
newTerminalIcon
env
window
commands
logger
TaskDefinitionDTO
TaskPresentationOptionsDTO
ProcessExecutionOptionsDTO
ProcessExecutionDTO
ShellExecutionOptionsDTO
ShellExecutionDTO
TaskGroupDTO
TaskFilterDTO
TaskExecutionDTO
VerifiedTask
The text was updated successfully, but these errors were encountered: