-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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 #164939
Comments
Thanks @joyceerhl! For a quick review, so far all of mine were have been for types that were not being directly used outside of the defining file. They were however being referenced indirectly in the file, such as as parameter to public functions or as return types Probably still good to remove them in case a future refactoring renders them unused |
cc @andreamah for search and @rzhao271 for settings editor |
@joyceerhl thanks for thorough analysis. It's useful in quite a few scenarios but some are false positive, here is what I found It works really well with:
But it's unnecessary and sometimes potentially harmful when:
Like we discussed offline, it might require each owner to make their own judgement |
@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. From a quick sanity check, several of these are indeed not used outside of the file they are declared in and do not need to be exported. Please feel free to remove your assignment if you find that this isn't valuable.ITerminalProfileType
TaskDefinitionRegistryImpl
ITerminalDecorationData
IndexTree
IDataTransferFile
IKeyIterator
main
createFileDataTransferItemFromFile
IEditorContributionCtor
IDiffEditorContributionCtor
ProxyCommand
ResolveCodeActionKeybinding
TriggeredCodeAction
TriggerModifier
IEditorHoverParticipantCtor
SuggestTriggerContext
ICommandsMap
ICommandsMap
IDragAndDropContribution
IWebviewEditor
ICodeActionContributionAction
ICodeActionContribution
Pick
ExtHostStatusBarEntry
reviveOptions
CodeActionExtensionPointFields
DocumentationExtensionPointFields
RefactoringDocumentationExtensionPoint
CustomEditorInputInitInfo
INotebookPreloadContribution
DirtyDiffController
DirtyDiffModel
experimental
getActiveWebviewEditor
WebviewResolver
IWebviewViewResolver
TokenTypesContribution
PointerEventHandler
DecorationSubTypeOptionsProvider
DecorationTypeOptionsProvider
AverageBufferSize
createUintArray
LineStarts
NodePosition
BufferCursor
IReverseSingleEditOperation
PieceTreeTextBufferFactory
calculateSize
calculateLF
resetSentinel
leftRotate
rightRotate
recomputeTreeMetadata
FindWidgetViewZone
ISimpleButtonOpts
getRandomInt
getRandomEOLSequence
getRandomString
generateRandomChunkWithLF
INotebookEntry
ExtHostDocumentLine
createKernelId
INotebookCommentThreadChangedEvent
ICommentController
COMMENTEDITOR_DECORATION_KEY
isMouseUpEventMatchMouseDown
CommentsAsyncDataSource
ResourceWithCommentsRenderer
CommentNodeRenderer
InteractiveEditorViewState
InteractiveEditorOptions
ISerializedCell
IPYNB_VIEW_TYPE
IRenderPlainHtmlOutput
IRenderOutputViaExtension
NotebookViewCellsSplice
cellStatusIconRunning
notebookOutputContainerBorderColor
notebookOutputContainerColor
CELL_TOOLBAR_SEPERATOR
focusedCellBackground
selectedCellBackground
cellHoverBackground
selectedCellBorder
inactiveSelectedCellBorder
focusedCellBorder
inactiveFocusedCellBorder
cellStatusBarItemHover
listScrollbarSliderBackground
listScrollbarSliderHoverBackground
listScrollbarSliderActiveBackground
cellSymbolHighlight
INotebookFindFiltersChangeEvent
findFilterButton
OutputElement
NotebookCellLayoutChangedEvent
NotebookDiffViewEvent
CellDiffCommonRenderTemplate
NotebookMouseController
isNotebookKeymapExtension
NotebookOutputRendererInfoStore
WorkerManager
IWorkerClient
NotebookEditorModelManager
NotebookWorkerClient
CellOutputElement
IResizeObserver
BrowserResizeObserver
getResizesObserver
getCodeCellExecutionContextKeyService
ICachedInset
IResolvedBackLayerWebview
IViewCellEditingDelegate
JoinCellEdit
NotebookViewModelOptions
createCellViewModel
NOTEBOOK_BREAKPOINT_MARGIN_ACTIVE
ProxyKernelState
INotebookProxyKernelChangeEvent
EditorTopPaddingChangeEvent
NotebookLayoutConfiguration
PerfName
NotebookOperationManager
NotebookEventEmitter
CellSequence
ID_NOTEBOOK_EDITOR_WORKER_SERVICE
createProviderComparer
OpenEditorContext
KeyboardLayoutContribution
KeyboardLayoutContribution
KeyboardLayoutContribution
suiteRepeat
IDropdownWithPrimaryActionViewItemOptions
SelectionKeyboardEvent
runInExternalTerminal
extensionResultIsMatch
ISuggestEnabledInputStyleOverrides
IAdapterManagerDelegate
CONTEXT_BREAKPOINT_ACCESS_TYPE
cellInsertionIndicator
NotebookFindWidget
ICssClassDelegate
ICellExecutionEntry
IIndexedSetting
ISettingsTargetsWidgetOptions
ISettingChangeEvent
SettingGroupRenderer
SettingNewExtensionsRenderer
SettingComplexRenderer
SettingExcludeRenderer
SettingEnumRenderer
SettingNumberRenderer
SettingBoolRenderer
ONLINE_SERVICES_SETTING_TAG
isExcludeSetting
TOCRenderer
SingleLineInputHeight
IDataLinkClickEvent
IKeybindingsEditorSearchOptions
IInternalFileMatch
IDirectoryEntry
IDirectoryTree
IOneSearchPathPattern
ISearchPathPattern
ICommonQueryBuilderOptions
rgErrorMsgForDisplay
IFileProgressCallback
IRgGlobResult
foldersToRgExcludeGlobs
foldersToIncludeGlobs
rgErrorMsgForDisplay
buildRegexParseError
spreadGlobComponents
IRgSubmatch
IRgBytesOrText
IHoverAction
IEmmetActionOptions
SettingArrayRenderer
SettingObjectRenderer
SettingBoolObjectRenderer
SettingTextRenderer
SettingMultilineTextRenderer
panelOpensMaximizedSettingToString
The text was updated successfully, but these errors were encountered: