Skip to content

Commit 346034d

Browse files
authored
Merge branch 'main' into splendid-bobcat
2 parents 065461c + df1e567 commit 346034d

File tree

4 files changed

+122
-0
lines changed

4 files changed

+122
-0
lines changed

.github/instructions/testing_feature_area.instructions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,15 @@ The adapters in the extension don't implement test discovery/run logic themselve
173173
- Debug adapter/resolver code in the extension's debugger modules may also be used when attaching to Django or test subprocesses.
174174
- Commands and configuration
175175
- The Test Controller wires commands that appear in the Test Explorer and editor context menus (see `package.json` contributes `commands`) and listens to configuration changes filtered by `python.testing` in `src/client/testing/main.ts`.
176+
- The "Copy Test ID" command (`python.copyTestId`) can be accessed from both the Test Explorer context menu (`testing/item/context`) and the editor gutter icon context menu (`testing/item/gutter`). This command copies test identifiers to the clipboard in the appropriate format for the active test framework (pytest path format or unittest module.class.method format).
176177
- Execution factory & activated environments
177178
- Adapters use the extension `ExecutionFactory` to spawn subprocesses in an activated interpreter (so the user's venv/conda is used). This involves the extension's internal environment execution APIs and sometimes `envExt` helpers when the external environment extension is present.
178179

179180
## Learnings
180181

181182
- Never await `showErrorMessage()` calls in test execution adapters as it blocks the test UI thread and freezes the Test Explorer (1)
183+
- VS Code test-related context menus are contributed to using both `testing/item/context` and `testing/item/gutter` menu locations in package.json for full coverage (1)
184+
185+
```
186+
187+
```
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
mode: edit
3+
---
4+
5+
Analyze the specified part of the VS Code Python Extension codebase to generate or update implementation instructions in `.github/instructions/<component>.instructions.md`.
6+
7+
## Task
8+
9+
Create concise developer guidance focused on:
10+
11+
### Implementation Essentials
12+
13+
- **Core patterns**: How this component is typically implemented and extended
14+
- **Key interfaces**: Essential classes, services, and APIs with usage examples
15+
- **Integration points**: How this component interacts with other extension parts
16+
- **Common tasks**: Typical development scenarios with step-by-step guidance
17+
18+
### Content Structure
19+
20+
````markdown
21+
---
22+
description: 'Implementation guide for the <component> part of the Python Extension'
23+
---
24+
25+
# <Component> Implementation Guide
26+
27+
## Overview
28+
29+
Brief description of the component's purpose and role in VS Code Python Extension.
30+
31+
## Key Concepts
32+
33+
- Main abstractions and their responsibilities
34+
- Important interfaces and base classes
35+
36+
## Common Implementation Patterns
37+
38+
### Pattern 1: [Specific Use Case]
39+
40+
```typescript
41+
// Code example showing typical implementation
42+
```
43+
````
44+
45+
### Pattern 2: [Another Use Case]
46+
47+
```typescript
48+
// Another practical example
49+
```
50+
51+
## Integration Points
52+
53+
- How this component connects to other VS Code Python Extension systems
54+
- Required services and dependencies
55+
- Extension points and contribution models
56+
57+
## Essential APIs
58+
59+
- Key methods and interfaces developers need
60+
- Common parameters and return types
61+
62+
## Gotchas and Best Practices
63+
64+
- Non-obvious behaviors to watch for
65+
- Performance considerations
66+
- Common mistakes to avoid
67+
68+
```
69+
70+
## Guidelines
71+
- **Be specific**: Use actual class names, method signatures, and file paths
72+
- **Show examples**: Include working code snippets from the codebase
73+
- **Target implementation**: Focus on how to build with/extend this component
74+
- **Keep it actionable**: Every section should help developers accomplish tasks
75+
76+
Source conventions from existing `.github/instructions/*.instructions.md`, `CONTRIBUTING.md`, and codebase patterns.
77+
78+
If `.github/instructions/<component>.instructions.md` exists, intelligently merge new insights with existing content.
79+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
mode: edit
3+
---
4+
5+
Analyze the user requested part of the codebase (use a suitable <placeholder>) to generate or update `.github/instructions/<placeholder>.instructions.md` for guiding developers and AI coding agents.
6+
7+
Focus on practical usage patterns and essential knowledge:
8+
9+
- How to use, extend, or integrate with this code area
10+
- Key architectural patterns and conventions specific to this area
11+
- Common implementation patterns with code examples
12+
- Integration points and typical interaction patterns with other components
13+
- Essential gotchas and non-obvious behaviors
14+
15+
Source existing conventions from `.github/instructions/*.instructions.md`, `CONTRIBUTING.md`, and `README.md`.
16+
17+
Guidelines:
18+
19+
- Write concise, actionable instructions using markdown structure
20+
- Document discoverable patterns with concrete examples
21+
- If `.github/instructions/<placeholder>.instructions.md` exists, merge intelligently
22+
- Target developers who need to work with or extend this code area
23+
24+
Update `.github/instructions/<placeholder>.instructions.md` with header:
25+
26+
```
27+
---
28+
description: "How to work with the <placeholder> part of the codebase"
29+
---
30+
```

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,13 @@
12441244
"when": "controllerId == 'python-tests'"
12451245
}
12461246
],
1247+
"testing/item/gutter": [
1248+
{
1249+
"command": "python.copyTestId",
1250+
"group": "navigation",
1251+
"when": "controllerId == 'python-tests'"
1252+
}
1253+
],
12471254
"commandPalette": [
12481255
{
12491256
"category": "Python",

0 commit comments

Comments
 (0)