Skip to content
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 #164934

Closed
joyceerhl opened this issue Oct 28, 2022 · 1 comment · Fixed by #165052
Closed

Reduce unused exports #164934

joyceerhl opened this issue Oct 28, 2022 · 1 comment · Fixed by #165052
Assignees
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders
Milestone

Comments

@joyceerhl
Copy link
Contributor

@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 close if you find that this isn't valuable.

Git blame Function File
@alexdima IPointerMoveCallback src/vs/base/browser/globalPointerMoveMonitor.ts
@alexdima IOnStopCallback src/vs/base/browser/globalPointerMoveMonitor.ts
@alexdima AbstractScrollbarOptions src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts
@alexdima AbstractScrollableElement src/vs/base/browser/ui/scrollbar/scrollableElement.ts
@alexdima KeyLabelProvider src/vs/base/common/keybindingLabels.ts
@alexdima ModifierLabelProvider src/vs/base/common/keybindingLabels.ts
@alexdima ScrollState src/vs/base/common/scrollable.ts
@alexdima ISmoothScrollPosition src/vs/base/common/scrollable.ts
@alexdima IScrollableOptions src/vs/base/common/scrollable.ts
@alexdima IAnimation src/vs/base/common/scrollable.ts
@alexdima IRequestHandlerFactory src/vs/base/common/worker/simpleWorker.ts
@alexdima create src/vs/base/common/worker/simpleWorker.ts
@alexdima NodeSocketCloseEvent src/vs/base/parts/ipc/common/ipc.net.ts
@alexdima WebSocketCloseEvent src/vs/base/parts/ipc/common/ipc.net.ts
@alexdima SocketTimeoutEvent src/vs/base/parts/ipc/common/ipc.net.ts
@alexdima RequestType src/vs/base/parts/ipc/common/ipc.ts
@alexdima ResponseType src/vs/base/parts/ipc/common/ipc.ts
@alexdima IChannelServer src/vs/base/parts/ipc/common/ipc.ts
@alexdima IRoutingChannelClient src/vs/base/parts/ipc/common/ipc.ts
@alexdima RequestInitiator src/vs/base/parts/ipc/common/ipc.ts
@alexdima logWithColors src/vs/base/parts/ipc/common/ipc.ts
@alexdima IMouseWheelEvent src/vs/base/test/browser/ui/scrollbar/scrollableElement.test.ts
@alexdima Ctor src/vs/base/test/common/mock.ts
@alexdima beginTrackingDisposables src/vs/base/test/common/troubleshooting.ts
@alexdima endTrackingDisposables src/vs/base/test/common/troubleshooting.ts
@alexdima beginLoggingFS src/vs/base/test/common/troubleshooting.ts
@alexdima endLoggingFS src/vs/base/test/common/troubleshooting.ts
@alexdima testRepeat src/vs/base/test/common/utils.ts
@alexdima Token src/vs/editor/editor.main.ts
@alexdima editor src/vs/editor/editor.main.ts
@alexdima initialize src/vs/editor/editor.worker.ts
@alexdima ICommandKeybindingsOptions src/vs/editor/browser/editorExtensions.ts
@alexdima CommandImplementation src/vs/editor/browser/editorExtensions.ts
@alexdima IContributionCommandOptions src/vs/editor/browser/editorExtensions.ts
@alexdima EditorControllerCommand src/vs/editor/browser/editorExtensions.ts
@alexdima EditorActionImplementation src/vs/editor/browser/editorExtensions.ts
@alexdima ISerializedFontInfo src/vs/editor/browser/config/fontMeasurements.ts
@alexdima ISettingsReader src/vs/editor/browser/config/migrateOptions.ts
@alexdima shadowCaretRangeFromPoint src/vs/editor/browser/controller/mouseTarget.ts
@alexdima ClipboardStoredMetadata src/vs/editor/browser/controller/textAreaInput.ts
@alexdima ICompositionStartEvent src/vs/editor/browser/controller/textAreaInput.ts
@alexdima ModelTransientSettingWatcher src/vs/editor/browser/services/abstractCodeEditorService.ts
@alexdima RefCountedStyleSheet src/vs/editor/browser/services/abstractCodeEditorService.ts
@alexdima IMouseDispatchData src/vs/editor/browser/view/viewController.ts
@alexdima ViewOverlays src/vs/editor/browser/view/viewOverlays.ts
@alexdima ViewOverlayLine src/vs/editor/browser/view/viewOverlays.ts
@alexdima EventCallback src/vs/editor/browser/view/viewUserInputEvents.ts
@alexdima AbstractLineHighlightOverlay src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts
@alexdima IMinimapModel src/vs/editor/browser/viewParts/minimap/minimap.ts
@alexdima RevealTarget src/vs/editor/common/cursorCommon.ts
@alexdima CharacterMap src/vs/editor/common/cursorCommon.ts
@alexdima MultipleCharacterMap src/vs/editor/common/cursorCommon.ts
@alexdima cachedStringRepeat src/vs/editor/common/commands/shiftCommand.ts
@alexdima IEditorZoom src/vs/editor/common/config/editorZoom.ts
@alexdima CursorPosition src/vs/editor/common/cursor/cursorMoveOperations.ts
@alexdima IDiffComputerResult src/vs/editor/common/diff/smartLinesDiffComputer.ts
@alexdima Uint8Matrix src/vs/editor/common/languages/linkComputer.ts
@alexdima EditorModesRegistry src/vs/editor/common/languages/modesRegistry.ts
@alexdima IReducedTokenizationSupport src/vs/editor/common/languages/textToHtmlTokenizer.ts
@alexdima ThemeTrieElement src/vs/editor/common/languages/supports/tokenization.ts
@alexdima IGuessedIndentation src/vs/editor/common/model/indentationGuesser.ts
@alexdima LONG_LINE_BOUNDARY src/vs/editor/common/model/textModel.ts
@alexdima IDecorationsTreesHost src/vs/editor/common/model/textModel.ts
@alexdima DidChangeDecorationsEmitter src/vs/editor/common/model/textModel.ts
@alexdima DidChangeContentEmitter src/vs/editor/common/model/textModel.ts
@alexdima KeyMod src/vs/editor/common/services/editorBaseApi.ts
@alexdima IRawModelData src/vs/editor/common/services/editorSimpleWorker.ts
@alexdima MirrorModel src/vs/editor/common/services/editorSimpleWorker.ts
@alexdima IForeignModuleFactory src/vs/editor/common/services/editorSimpleWorker.ts
@alexdima create src/vs/editor/common/services/editorSimpleWorker.ts
@alexdima ID_EDITOR_WORKER_SERVICE src/vs/editor/common/services/editorWorker.ts
@alexdima DocumentSemanticTokensResult src/vs/editor/common/services/getSemanticTokens.ts
@alexdima IResolvedLanguage src/vs/editor/common/services/languagesRegistry.ts
@alexdima EditStackPastFutureElements src/vs/editor/common/services/modelService.ts
@alexdima ILineSequence src/vs/editor/common/services/modelService.ts
@alexdima ModelSemanticColoring src/vs/editor/common/services/modelService.ts
@alexdima SemanticTokensProviderStylingConstants src/vs/editor/common/services/semanticTokensProviderStyling.ts
@alexdima SparseLineTokens src/vs/editor/common/tokens/sparseMultilineTokens.ts
@alexdima RenderWhitespace src/vs/editor/common/viewLayout/viewLineRenderer.ts
@alexdima CharacterMappingConstants src/vs/editor/common/viewLayout/viewLineRenderer.ts
@alexdima RenderLineOutput src/vs/editor/common/viewLayout/viewLineRenderer.ts
@alexdima IDecorationsViewportData src/vs/editor/common/viewModel/viewModelDecorations.ts
@alexdima ColorHover src/vs/editor/contrib/colorPicker/browser/colorHoverParticipant.ts
@alexdima IPreflightDataSupported src/vs/editor/contrib/comment/browser/lineCommentCommand.ts
@alexdima IPreflightDataUnsupported src/vs/editor/contrib/comment/browser/lineCommentCommand.ts
@alexdima TestFindController src/vs/editor/contrib/find/test/browser/findController.test.ts
@alexdima ClickLinkOptions src/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.ts
@alexdima HoverResult src/vs/editor/contrib/hover/browser/hoverOperation.ts
@alexdima MarkerHover src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts
@alexdima InlineCompletionsHover src/vs/editor/contrib/inlineCompletions/browser/ghostTextHoverParticipant.ts
@alexdima IGlobalEditorOptions src/vs/editor/standalone/browser/standaloneCodeEditor.ts
@alexdima StandaloneCodeEditor src/vs/editor/standalone/browser/standaloneCodeEditor.ts
@alexdima create src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima onDidCreateEditor src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima onDidCreateDiffEditor src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima getEditors src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima getDiffEditors src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima createDiffEditor src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima IDiffNavigatorOptions src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima ICommandDescriptor src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima addCommand src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima addEditorAction src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima IKeybindingRule src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima addKeybindingRule src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima addKeybindingRules src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima createModel src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima setModelLanguage src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima setModelMarkers src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima removeAllMarkers src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima onDidChangeMarkers src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima getModels src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima onDidCreateModel src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima onWillDisposeModel src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima createWebWorker src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima colorizeElement src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima colorize src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima colorizeModelLine src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima tokenize src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima remeasureFonts src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima registerCommand src/vs/editor/standalone/browser/standaloneEditor.ts
@alexdima getLanguages src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima EncodedTokenizationSupportAdapter src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima TokensProviderFactory src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima setColorMap src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerTokensProviderFactory src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima setTokensProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima setMonarchTokensProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerReferenceProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerRenameProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerSignatureHelpProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerHoverProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentSymbolProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentHighlightProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerLinkedEditingRangeProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDefinitionProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerImplementationProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerTypeDefinitionProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerCodeLensProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerCodeActionProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentFormattingEditProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentRangeFormattingEditProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerOnTypeFormattingEditProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerLinkProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerCompletionItemProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerColorProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerFoldingRangeProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDeclarationProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerSelectionRangeProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentSemanticTokensProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerDocumentRangeSemanticTokensProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerInlineCompletionsProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima registerInlayHintsProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima CodeActionProvider src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima CodeActionProviderMetadata src/vs/editor/standalone/browser/standaloneLanguages.ts
@alexdima IKeybindingRule src/vs/editor/standalone/browser/standaloneServices.ts
@alexdima EditorScopedQuickInputService src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts
@alexdima IShortMonarchLanguageRule1 src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IShortMonarchLanguageRule2 src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IExpandedMonarchLanguageRule src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IMonarchLanguageRule src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IShortMonarchLanguageAction src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IExpandedMonarchLanguageAction src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima IMonarchLanguageAction src/vs/editor/standalone/common/monarch/monarchTypes.ts
@alexdima TestCodeEditorCreationOptions src/vs/editor/test/browser/testCodeEditor.ts
@alexdima createSingleEditOp src/vs/editor/test/browser/commands/shiftCommand.test.ts
@alexdima createSingleEditOp src/vs/editor/test/browser/commands/trimTrailingWhitespaceCommand.test.ts
@alexdima MockTextAreaWrapper src/vs/editor/test/browser/controller/textAreaState.test.ts
@alexdima testTextBufferFactory src/vs/editor/test/common/model/linesTextBuffer/linesTextBufferBuilder.test.ts
@alexdima generateRandomEdits src/vs/editor/test/common/model/linesTextBuffer/textBufferAutoTestUtils.ts
@alexdima generateSequentialInserts src/vs/editor/test/common/model/linesTextBuffer/textBufferAutoTestUtils.ts
@alexdima generateRandomReplaces src/vs/editor/test/common/model/linesTextBuffer/textBufferAutoTestUtils.ts
@alexdima IContextKeyExpression src/vs/platform/contextkey/common/contextkey.ts
@alexdima ContextKeyFalseExpr src/vs/platform/contextkey/common/contextkey.ts
@alexdima ContextKeyTrueExpr src/vs/platform/contextkey/common/contextkey.ts
@alexdima ContextKeyNotRegexExpr src/vs/platform/contextkey/common/contextkey.ts
@alexdima ITranslation src/vs/platform/extensions/common/extensions.ts
@alexdima IWindowsKeyMapping src/vs/platform/keyboardLayout/common/keyboardLayout.ts
@alexdima ILinuxKeyMapping src/vs/platform/keyboardLayout/common/keyboardLayout.ts
@alexdima ILinuxKeyboardMapping src/vs/platform/keyboardLayout/common/keyboardLayout.ts
@alexdima IMacKeyMapping src/vs/platform/keyboardLayout/common/keyboardLayout.ts
@alexdima IMacKeyboardMapping src/vs/platform/keyboardLayout/common/keyboardLayout.ts
@alexdima IWebSocketCloseEvent src/vs/platform/remote/browser/browserSocketFactory.ts
@alexdima IWebSocket src/vs/platform/remote/browser/browserSocketFactory.ts
@alexdima defaultWebSocketFactory src/vs/platform/remote/browser/browserSocketFactory.ts
@alexdima AuthRequest src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima OKMessage src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima ConnectionLostEvent src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima ReconnectionRunningEvent src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima ConnectionGainEvent src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima ReconnectionPermanentFailureEvent src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima ExtensionHostPersistentConnection src/vs/platform/remote/common/remoteAgentConnection.ts
@alexdima URIDescriptor src/vs/platform/telemetry/common/telemetryUtils.ts
@alexdima fontStylePattern src/vs/platform/theme/common/tokenClassificationRegistry.ts
@alexdima BaseTunnelService src/vs/platform/tunnel/node/tunnelService.ts
@alexdima RemoteExtensionHostAgentServer src/vs/server/node/remoteExtensionHostAgentServer.ts
@alexdima IExtensionsManagementProcessInitData src/vs/server/node/remoteExtensionManagement.ts
@alexdima printTime src/vs/server/node/remoteExtensionManagement.ts
@alexdima spawnCli src/vs/server/node/server.main.ts
@alexdima createServer src/vs/server/node/server.main.ts
@alexdima NoneServerConnectionToken src/vs/server/node/serverConnectionToken.ts
@alexdima OptionalServerConnectionToken src/vs/server/node/serverConnectionToken.ts
@alexdima MandatoryServerConnectionToken src/vs/server/node/serverConnectionToken.ts
@alexdima getWordDefinitionFor src/vs/workbench/api/common/extHostDocumentData.ts
@alexdima FailedExtension src/vs/workbench/api/common/extHostExtensionActivator.ts
@alexdima DocumentSemanticTokensAdapter src/vs/workbench/api/common/extHostLanguageFeatures.ts
@alexdima DocumentRangeSemanticTokensAdapter src/vs/workbench/api/common/extHostLanguageFeatures.ts
@alexdima startExtensionHostProcess src/vs/workbench/api/node/extensionHostProcess.ts
@alexdima create src/vs/workbench/api/worker/extensionHostWorker.ts
@alexdima create src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts
@alexdima IResourceCreator src/vs/workbench/contrib/output/common/outputLinkComputer.ts
@alexdima InsertSnippetResult src/vs/workbench/contrib/preferences/common/smartSnippetInserter.ts
@alexdima RangeHighlightDecorations src/vs/workbench/contrib/search/common/searchModel.ts
@alexdima ScrollPosition src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.ts
@alexdima ITerminalEnvironmentVariableCollections src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
@alexdima ConfigurationEditingError src/vs/workbench/services/configuration/common/configurationEditing.ts
@alexdima IExtHostNamedCustomer src/vs/workbench/services/extensions/common/extHostCustomers.ts
@alexdima IExtHostCustomerCtor src/vs/workbench/services/extensions/common/extHostCustomers.ts
@alexdima DeltaExtensionsResult src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.ts
@alexdima ExtHostConnection src/vs/workbench/services/extensions/common/extensionHostEnv.ts
@alexdima ExtensionHostStartupClassification src/vs/workbench/services/extensions/common/extensionHostManager.ts
@alexdima ExtensionHostStartupEvent src/vs/workbench/services/extensions/common/extensionHostManager.ts
@alexdima MessagePortLike src/vs/workbench/services/extensions/common/extensionHostProtocol.ts
@alexdima IResolveAuthorityOKResult src/vs/workbench/services/extensions/common/extensionHostProxy.ts
@alexdima JSONStringifyReplacer src/vs/workbench/services/extensions/common/rpcProtocol.ts
@alexdima IExtensionActivationResult src/vs/workbench/services/extensions/common/workspaceContains.ts
@alexdima NativeResolvedKeybinding src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts
@alexdima IScanCodeMapping src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts
@alexdima create src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts
@alexdima RemoteAgentConnection src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts
@alexdima IValidGrammarDefinitionDTO src/vs/workbench/services/textMate/browser/textMateWorker.ts
@alexdima ICreateData src/vs/workbench/services/textMate/browser/textMateWorker.ts
@alexdima IRawModelData src/vs/workbench/services/textMate/browser/textMateWorker.ts
@alexdima create src/vs/workbench/services/textMate/browser/textMateWorker.ts
@alexdima IEmbeddedLanguagesMap src/vs/workbench/services/textMate/common/TMGrammars.ts
@alexdima IColorTheme src/vs/workbench/services/textMate/common/TMHelper.ts
@alexdima ITokenColorizationRule src/vs/workbench/services/textMate/common/TMHelper.ts
@alexdima ITokenColorizationSetting src/vs/workbench/services/textMate/common/TMHelper.ts
@alexdima assertCleanState src/vs/workbench/test/common/utils.ts
@alexdima
Copy link
Member

alexdima commented Oct 31, 2022

Just because something isn't used by anyone, it doesn't mean it should not be exported, since someone might need to import it. Especially types that are referenced in exported public methods should IMHO remain exported. Not so long ago, TS would even give a compile error if a public exported member was referencing a non-exported type.

For example, IPointerMoveCallback is referenced in GlobalPointerMoveMonitor.startMonitoring which is a public method. Most likely all current users of this class inline their callback so they don't need to name the type:

// callback is inlined, there's no need to name its type
monitor.startMonitoring(..., (event: PointerEvent) => { /* do something */ }, ...);

But a user of this class might want to write this kind of code:

// callback is not inlined, maybe its type needs to be referred explicitly
const moveCallback: IPointerMoveCallback = (event: PointerEvent) => { /* do something */ };
monitor.startMonitoring(..., moveCallback, ...);

Another example, ICompositionStartEvent is referenced in TextAreaInput.onCompositionStart which is a public method. Again, most likely all current users of this class inline the event handler so they don't need to name the type:

this._register(textArea.onCompositionStart((e) => { /* do something */ }));

But a user might want to extract the event handler to a method:

this._register(textArea.onCompositionStart((e) => this._onCompositionStart(e)));
// ...
private _onCompositionStart(e: ICompositionStartEvent) { /* do something */ }

A third example, IGuessedIndentation is the return type of guessIndentation which is export and used. Most likely all current users don't name the type they receive e.g.:

const guessedIndentation = guessIndentation(textBuffer, options.tabSize, options.insertSpaces);

But a user might want to extract the code to a method and they would want to use the type.

@alexdima alexdima added the debt Code quality issues label Oct 31, 2022
@alexdima alexdima added this to the November 2022 milestone Oct 31, 2022
alexdima added a commit that referenced this issue Oct 31, 2022
* Fixes #164934: Only export symbols that are needed

* `KeyMod` is referenced by `monaco.d.ts`
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Oct 31, 2022
@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants