Skip to content

Commit a98be63

Browse files
tonybaloneykimadelineKartik Raj
authored
Update incorrect JSDoc annotations (#12101)
* Update incorrect JSDoc annotations * Create 12101.md * Update src/client/common/utils/cacheUtils.ts Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update src/client/datascience/jupyter/kernels/kernelSelector.ts Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update src/client/datascience/jupyter/kernels/kernelSelections.ts Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update src/test/mocks/vsc/uri.ts Co-authored-by: Kim-Adeline Miguel <[email protected]> * Update news/3 Code Health/12101.md Co-authored-by: Kim-Adeline Miguel <[email protected]> Co-authored-by: Kartik Raj <[email protected]>
1 parent d71250e commit a98be63

File tree

23 files changed

+49
-16
lines changed

23 files changed

+49
-16
lines changed

news/3 Code Health/12101.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update JSDoc annotations for many of the APIs (thanks [tonybaloney](https://github.com/tonybaloney))

src/client/common/process/pythonDaemonPool.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export class PythonDaemonExecutionServicePool extends PythonDaemonFactory implem
106106
* @private
107107
* @template T
108108
* @param {(daemon: IPythonExecutionService) => Promise<T>} cb
109+
* @param daemonLogMessage
109110
* @returns {Promise<T>}
110111
* @memberof PythonDaemonExecutionServicePool
111112
*/
@@ -130,6 +131,7 @@ export class PythonDaemonExecutionServicePool extends PythonDaemonFactory implem
130131
*
131132
* @private
132133
* @param {(daemon: IPythonExecutionService) => ObservableExecutionResult<string>} cb
134+
* @param daemonLogMessage
133135
* @returns {ObservableExecutionResult<string>}
134136
* @memberof PythonDaemonExecutionServicePool
135137
*/

src/client/common/terminal/environmentActivationProviders/condaActivationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class CondaActivationCommandProvider implements ITerminalActivationComman
129129
* This configuration is documented on Conda.
130130
* Extension will not attempt to work around issues by trying to setup shell for user.
131131
*
132-
* @param {string} envName
132+
* @param {string} condaEnv
133133
* @returns {(Promise<string[] | undefined>)}
134134
* @memberof CondaActivationCommandProvider
135135
*/

src/client/common/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ export interface ICryptoUtils {
571571
* @returns hash as number, or string
572572
* @param data The string to hash
573573
* @param hashFormat Return format of the hash, number or string
574+
* @param [algorithm]
574575
*/
575576
createHash<E extends keyof IHashFormat>(
576577
data: string,

src/client/common/utils/cacheUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const resourceSpecificCacheStores = new Map<string, Map<string, CacheData>>();
2323
* Get a cache key specific to a resource (i.e. workspace)
2424
* This key will be used to cache interpreter related data, hence the Python Path
2525
* used in a workspace will affect the cache key.
26-
* @param {String} keyPrefix
2726
* @param {Resource} resource
2827
* @param {VSCodeType} [vscode=require('vscode')]
28+
* @param serviceContainer
2929
* @returns
3030
*/
3131
function getCacheKey(
@@ -70,9 +70,9 @@ function getCacheKey(
7070
}
7171
/**
7272
* Gets the cache store for a resource that's specific to the interpreter.
73-
* @param {string} keyPrefix
7473
* @param {Resource} resource
7574
* @param {VSCodeType} [vscode=require('vscode')]
75+
* @param serviceContainer
7676
* @returns
7777
*/
7878
function getCacheStore(

src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function sortProductsInOrderForInstallation(products: Product[]) {
5757
*
5858
* @export
5959
* @param {Product[]} products
60+
* @param {string} [interpreterName]
6061
* @returns {string}
6162
*/
6263
export function getMessageForLibrariesNotInstalled(products: Product[], interpreterName?: string): string {
@@ -291,7 +292,7 @@ export class JupyterInterpreterDependencyService {
291292
*
292293
* @private
293294
* @param {PythonInterpreter} interpreter
294-
* @param {CancellationToken} [token]
295+
* @param {CancellationToken} [_token]
295296
* @returns {Promise<boolean>}
296297
* @memberof JupyterInterpreterConfigurationService
297298
*/

src/client/datascience/jupyter/jupyterDebugger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener {
243243
* (temporary to hard-code and use these in here).
244244
* The old debugger will soon go away into oblivion...
245245
* @private
246-
* @param {INotebook} notebook
246+
* @param {INotebook} _notebook
247247
* @returns {Promise<string>}
248248
* @memberof JupyterDebugger
249249
*/

src/client/datascience/jupyter/kernels/kernelSelections.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { IKernelSelectionListProvider, IKernelSpecQuickPickItem, LiveKernelModel
2323
* Given a kernel spec, this will return a quick pick item with appropriate display names and the like.
2424
*
2525
* @param {IJupyterKernelSpec} kernelSpec
26+
* @param {IPathUtils} pathUtils
2627
* @returns {IKernelSpecQuickPickItem}
2728
*/
2829
function getQuickPickItemForKernelSpec(
@@ -41,6 +42,7 @@ function getQuickPickItemForKernelSpec(
4142
* Given an active kernel, this will return a quick pick item with appropriate display names and the like.
4243
*
4344
* @param {(LiveKernelModel)} kernel
45+
* @param {IPathUtils} pathUtils
4446
* @returns {IKernelSpecQuickPickItem}
4547
*/
4648
function getQuickPickItemForActiveKernel(kernel: LiveKernelModel, pathUtils: IPathUtils): IKernelSpecQuickPickItem {
@@ -185,6 +187,7 @@ export class KernelSelectionProvider {
185187
/**
186188
* Gets a selection of kernel specs from a remote session.
187189
*
190+
* @param {Resource} resource
188191
* @param {IJupyterSessionManager} sessionManager
189192
* @param {CancellationToken} [cancelToken]
190193
* @returns {Promise<IKernelSpecQuickPickItem[]>}
@@ -222,6 +225,8 @@ export class KernelSelectionProvider {
222225
/**
223226
* Gets a selection of kernel specs for a local session.
224227
*
228+
* @param {Resource} resource
229+
* @param type
225230
* @param {IJupyterSessionManager} [sessionManager]
226231
* @param {CancellationToken} [cancelToken]
227232
* @returns {Promise<IKernelSelectionListProvider>}

src/client/datascience/jupyter/kernels/kernelSelector.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ export class KernelSelector {
8888
/**
8989
* Selects a kernel from a remote session.
9090
*
91+
* @param {Resource} resource
92+
* @param {StopWatch} stopWatch
9193
* @param {IJupyterSessionManager} session
9294
* @param {CancellationToken} [cancelToken]
95+
* @param {IJupyterKernelSpec | LiveKernelModel} [currentKernel]
9396
* @returns {Promise<KernelSpecInterpreter>}
9497
* @memberof KernelSelector
9598
*/
@@ -120,8 +123,12 @@ export class KernelSelector {
120123
/**
121124
* Select a kernel from a local session.
122125
*
126+
* @param {Resource} resource
127+
* @param type
128+
* @param {StopWatch} stopWatch
123129
* @param {IJupyterSessionManager} [session]
124130
* @param {CancellationToken} [cancelToken]
131+
* @param {IJupyterKernelSpec | LiveKernelModel} [currentKernel]
125132
* @returns {Promise<KernelSpecInterpreter>}
126133
* @memberof KernelSelector
127134
*/
@@ -155,8 +162,11 @@ export class KernelSelector {
155162
* Gets a kernel that needs to be used with a local session.
156163
* (will attempt to find the best matching kernel, or prompt user to use current interpreter or select one).
157164
*
165+
* @param {Resource} resource
166+
* @param type
158167
* @param {IJupyterSessionManager} [sessionManager]
159168
* @param {nbformat.INotebookMetadata} [notebookMetadata]
169+
* @param {boolean} [disableUI]
160170
* @param {CancellationToken} [cancelToken]
161171
* @returns {Promise<KernelSpecInterpreter>}
162172
* @memberof KernelSelector
@@ -213,6 +223,7 @@ export class KernelSelector {
213223
* Gets a kernel that needs to be used with a remote session.
214224
* (will attempt to find the best matching kernel, or prompt user to use current interpreter or select one).
215225
*
226+
* @param {Resource} resource
216227
* @param {IJupyterSessionManager} [sessionManager]
217228
* @param {nbformat.INotebookMetadata} [notebookMetadata]
218229
* @param {CancellationToken} [cancelToken]
@@ -439,9 +450,12 @@ export class KernelSelector {
439450
* Otherwise, if not provided user is changing the kernel after starting a notebook.
440451
*
441452
* @private
453+
* @param {Resource} resource
442454
* @param {PythonInterpreter} interpreter
455+
* @param type
443456
* @param {string} [displayNameOfKernelNotFound]
444457
* @param {IJupyterSessionManager} [session]
458+
* @param {boolean} [disableUI]
445459
* @param {CancellationToken} [cancelToken]
446460
* @returns {Promise<KernelSpecInterpreter>}
447461
* @memberof KernelSelector

src/client/datascience/jupyter/kernels/kernelService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export class KernelService {
276276
* - env = Will have environment variables of the activated environment.
277277
*
278278
* @param {PythonInterpreter} interpreter
279+
* @param {boolean} [disableUI]
279280
* @param {CancellationToken} [cancelToken]
280281
* @returns {Promise<IJupyterKernelSpec>}
281282
* @memberof KernelService

src/client/debugger/extension/configuration/launch.json/updaterService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ export class LaunchJsonUpdaterServiceHelper {
6868
/**
6969
* Gets the string representation of the debug config for insertion in the document.
7070
* Adds necessary leading or trailing commas (remember the text is added into an array).
71-
* @param {TextDocument} document
72-
* @param {Position} position
7371
* @param {DebugConfiguration} config
72+
* @param {PositionOfCursor} cursorPosition
73+
* @param {PositionOfComma} [commaPosition]
7474
* @returns
7575
* @memberof LaunchJsonCompletionItemProvider
7676
*/

src/client/interpreter/activation/wrapperEnvironmentActivationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class WrapperEnvironmentActivationService implements IEnvironmentActivati
9595
* If a cached entry already exists, then ignore the implementation.
9696
*
9797
* @private
98-
* @param {string} key
98+
* @param {string} cacheKey
9999
* @param {(() => Promise<NodeJS.ProcessEnv | undefined>)} implementation
100100
* @returns {(Promise<NodeJS.ProcessEnv | undefined>)}
101101
* @memberof WrapperEnvironmentActivationService

src/client/interpreter/interpreterService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export class InterpreterService implements Disposable, IInterpreterService {
216216
* The format is `Python <Version> <bitness> (<env name>: <env type>)`
217217
* E.g. `Python 3.5.1 32-bit (myenv2: virtualenv)`
218218
* @param {Partial<PythonInterpreter>} info
219+
* @param {Uri} [resource]
219220
* @returns {string}
220221
* @memberof InterpreterService
221222
*/

src/client/linters/linterAvailability.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class AvailableLinterActivator implements IAvailableLinterActivator {
9696
* Check if the linter itself is available in the workspace's Python environment or
9797
* not.
9898
*
99-
* @param linterProduct Linter to check in the current workspace environment.
99+
* @param linterInfo Linter to check in the current workspace environment.
100100
* @param resource Context information for workspace.
101101
*/
102102
public async isLinterAvailable(linterInfo: ILinterInfo, resource: Resource): Promise<boolean | undefined> {

src/client/testing/common/services/discoveredTestParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export class TestDiscoveredTestParser implements discovery.ITestDiscoveredTestPa
218218
*
219219
* @protected
220220
* @param {TestFolder} rootFolder
221+
* @param {TestFile | TestSuite} parent
221222
* @param {TestFunction} parentFunction
222223
* @param {DiscoveredTests} discoveredTests
223224
* @param {Tests} tests

src/client/testing/pytest/services/testMessageService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class TestMessageService implements ITestMessageService {
2121
* Condense the test details down to just the potentially relevant information. Messages
2222
* should only be created for tests that were actually run.
2323
*
24+
* @param rootDirectory
2425
* @param testResults Details about all known tests.
2526
*/
2627
public async getFilteredTestMessages(rootDirectory: string, testResults: Tests): Promise<IPythonTestMessage[]> {

src/client/testing/unittest/services/parserService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export class TestsParser implements ITestsParser {
5656
* Where tone_test = folder, Failing2Tests = class/suite, test_failure = method.
5757
* @private
5858
* @param {string} rootDirectory
59-
* @param {string[]} testIds
59+
* @param {string} testId
60+
* @param {TestFile[]} testFiles
6061
* @returns {Tests}
6162
* @memberof TestsParser
6263
*/

src/ipywidgets/src/embed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function moduleNameToCDNUrl(moduleName: string, moduleVersion: string): string {
5555
* Load an amd module locally and fall back to specified CDN if unavailable.
5656
*
5757
* @param moduleName The name of the module to load..
58-
* @param version The semver range for the module, if loaded from a CDN.
58+
* @param moduleVersion The semver range for the module, if loaded from a CDN.
5959
*
6060
* By default, the CDN service used is unpkg.com. However, this default can be
6161
* overriden by specifying another URL via the HTML attribute

src/ipywidgets/src/libembed.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export async function renderWidgets(
4040
*
4141
* @param element The DOM element to search for widget view state script tags
4242
* @param widgetState The widget manager state
43+
* @param managerFactory The widget manager factory
4344
*
4445
* #### Notes
4546
*

src/test/mocks/vsc/uri.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ export namespace vscUri {
311311
* `file:///usr/home`, or `scheme:with/path`.
312312
*
313313
* @param value A string which represents an URI (see `URI#toString`).
314+
* @param {boolean} [_strict=false]
314315
*/
315316
static parse(value: string, _strict: boolean = false): URI {
316317
const match = _regexp.exec(value);

src/test/testing/explorer/explorerTestData.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ export function createMockWorkspaceService(): typemoq.IMock<IWorkspaceService> {
220220
* Create a testable mocked up version of the TestExplorerViewProvider. Creates any
221221
* mocked dependencies not provided in the parameters.
222222
*
223-
* @param testStore Test storage service, provides access to the Tests structure that the view is built from.
224-
* @param unitTestMgmtService Unit test management service that provides the 'onTestStatusUpdated' event.
225-
* @param workspaceService Workspace service used to determine the current workspace that the test view is showing.
226-
* @param disposableReg Disposable registry used to dispose of items in the view.
223+
* @param {ITestCollectionStorageService} [testStore] Test storage service, provides access to the Tests structure that the view is built from.
224+
* @param {Tests} [testsData]
225+
* @param {ITestManagementService} [unitTestMgmtService] Unit test management service that provides the 'onTestStatusUpdated' event.
226+
* @param {IWorkspaceService} [workspaceService] Workspace service used to determine the current workspace that the test view is showing.
227+
* @param {ICommandManager} [commandManager]
227228
*/
228229
export function createMockTestExplorer(
229230
testStore?: ITestCollectionStorageService,

src/test/testing/pytest/pytest.run.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ function getRelevantSkippedIssuesFromTestDetailsForFile(testDetails: ITestDetail
243243
/**
244244
* Get the FlattenedTestFunction from the test results that's associated with the given testDetails object.
245245
*
246+
* @param ioc IOC Test Container
246247
* @param results Results of the test run.
247248
* @param testFileUri The Uri of the test file that was run.
248249
* @param testDetails The details of a particular test.

types/@msrvida-python-program-analysis/rewrite-magics.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface LineMagicRewriter {
3434
* Rewrite the line magic.
3535
* @param matchedText the original matched text from the program
3636
* @param magicStmt the line magic text with newlines and continuations removed
37-
* @param postion ((start_line, start_col),(end_line, end_col)) of `matchedText` within the cell
37+
* @param position ((start_line, start_col),(end_line, end_col)) of `matchedText` within the cell
3838
* @return rewrite operation. Leave text empty if you want to use default rewrites.
3939
*/
4040
rewrite(matchedText: string, magicStmt: string, position: MatchPosition): Rewrite;

0 commit comments

Comments
 (0)