microsoft / microsoft/vscode-test

Possibly misleading comment suggesting importing the extension

Open
#194 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
316
Forks
73
Avg merge
1d 6h
Merged PRs (30d)
3

Description

both example test files (sample/test/suite1/extension.test.ts, sample/test/suite2/extension.test.ts) have a comment

// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../extension';

I interpret this to mean that the activate method of the extension needs to be manually invoked. I believe this is the most natural interpretation. But that contradicts how the Extension Host starts up with the extension already.

I think what the comment is trying to say is that I can import my extension to test the supporting functions, classes, etc, I implemented and exported from the extension. Is this correct? if so, would it be reasonable to update the comment:

// as well as import your custom feature APIs from your extension for testing it

(Btw, I see the same thing in https://github.com/microsoft/vscode-extension-samples/blob/main/helloworld-test-sample/src/test/suite/extension.test.ts)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the comments in sample/test/suite1/extension.test.ts and sample/test/suite2/extension.test.ts, then compare them with the described Extension Host startup behavior. Update both comments so they clearly explain whether importing the extension is for testing exported APIs, and confirm that the wording no longer suggests manually invoking activation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, testing
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.