初始化上传
Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
This commit is contained in:
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
**/dist/**
|
||||
**/out/**
|
||||
**/node_modules/**
|
||||
**/tests/fourslash/**
|
||||
128
.eslintrc.json
Normal file
128
.eslintrc.json
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"prettier",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
"simple-import-sort"
|
||||
],
|
||||
"root": true,
|
||||
"ignorePatterns": ["**/rspack*.config.js"],
|
||||
"rules": {
|
||||
"eqeqeq": "error",
|
||||
"no-constant-condition": 0,
|
||||
"no-inner-declarations": 0,
|
||||
"no-unused-vars": "off",
|
||||
"no-undef": 0,
|
||||
"simple-import-sort/exports": "error",
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"@typescript-eslint/ban-types": 0,
|
||||
"@typescript-eslint/camelcase": 0,
|
||||
"@typescript-eslint/member-ordering": [
|
||||
"error",
|
||||
{
|
||||
"classes": ["field", "constructor", ["public-get", "public-set"], "public-method", ["protected-get", "protected-set"], "protected-method", ["private-get", "private-set"], "private-method"],
|
||||
"interfaces": [],
|
||||
"typeLiterals": "never"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-empty-interface": 0,
|
||||
"@typescript-eslint/no-empty-object-type": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-namespace": 0,
|
||||
"@typescript-eslint/no-non-null-assertion": 0,
|
||||
"@typescript-eslint/no-require-imports": 0,
|
||||
"@typescript-eslint/no-this-alias": 0,
|
||||
"@typescript-eslint/no-unsafe-function-type": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none",
|
||||
"caughtErrors": "none"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-unused-expressions": [
|
||||
"error",
|
||||
{
|
||||
"allowShortCircuit": true,
|
||||
"allowTernary": true
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-use-before-define": 0,
|
||||
"@typescript-eslint/no-wrapper-object-types": 0,
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"error",
|
||||
{
|
||||
"selector": [
|
||||
"classProperty",
|
||||
"typeProperty",
|
||||
"parameterProperty",
|
||||
"classMethod",
|
||||
"typeMethod",
|
||||
"accessor"
|
||||
],
|
||||
"modifiers": ["private"],
|
||||
"leadingUnderscore": "require",
|
||||
"format": ["camelCase"],
|
||||
"filter": {
|
||||
"regex": "^(test_| )",
|
||||
"match": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"selector": [
|
||||
"classProperty",
|
||||
"typeProperty",
|
||||
"parameterProperty",
|
||||
"classMethod",
|
||||
"typeMethod",
|
||||
"accessor"
|
||||
],
|
||||
"modifiers": ["protected"],
|
||||
"leadingUnderscore": "forbid",
|
||||
"format": ["camelCase"],
|
||||
"filter": {
|
||||
"regex": "^(test_| )",
|
||||
"match": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"selector": [
|
||||
"classProperty",
|
||||
"typeProperty",
|
||||
"parameterProperty",
|
||||
"classMethod",
|
||||
"typeMethod",
|
||||
"accessor"
|
||||
],
|
||||
"modifiers": ["public"],
|
||||
"leadingUnderscore": "forbid",
|
||||
"format": ["camelCase"],
|
||||
"filter": {
|
||||
"regex": "^(test_| )",
|
||||
"match": false
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.js"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.json linguist-language=JSON-with-Comments
|
||||
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report incorrect or unintended behaviors
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues.
|
||||
|
||||
If you have a question about typing or a behavior that you’re seeing in Pyright (as opposed to a bug report or enhancement request), consider posting to the [Pyright discussion forum](https://github.com/microsoft/pyright/discussions).
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of the behavior you are seeing and the expected behavior along with steps to reproduce it.
|
||||
|
||||
**Code or Screenshots**
|
||||
If possible, provide a minimal, self-contained code sample (surrounded by triple back ticks) to demonstrate the issue. The code should define or import all referenced symbols.
|
||||
|
||||
```python
|
||||
def foo(self) -> str:
|
||||
return 3
|
||||
```
|
||||
|
||||
If your code relies on symbols that are imported from a third-party library, include the associated import statements and specify which versions of those libraries you have installed.
|
||||
|
||||
**VS Code extension or command-line**
|
||||
Are you running pyright as a VS Code extension, a language server in another editor, integrated into Pylance, or the command-line tool? Which version?
|
||||
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea or improvement
|
||||
title: ''
|
||||
labels: enhancement request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
If you have a question about a behavior that you’re seeing in pyright, consider posting to the [Pyright discussion forum](https://github.com/microsoft/pyright/discussions).
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of the problem.
|
||||
|
||||
**Describe the solution you’d like**
|
||||
A clear and concise description of the solution you would like to see.
|
||||
|
||||
33
.github/actions/cfs-npm-authenticate/action.yml
vendored
Normal file
33
.github/actions/cfs-npm-authenticate/action.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Add auth token to .npmrc
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
inputs:
|
||||
working-directory:
|
||||
description: The directory whose .npmrc file should be modified
|
||||
required: true
|
||||
type: string
|
||||
token:
|
||||
description: The auth token to add to the .npmrc file
|
||||
required: true
|
||||
type: string
|
||||
feed-url:
|
||||
description: The URL of the Azure Artifacts feed to authenticate with
|
||||
required: false
|
||||
default: //devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Generate .npmrc
|
||||
shell: bash
|
||||
run: |
|
||||
echo "registry=https:${{ inputs.feed-url }}/npm/registry/" > ${{ inputs.working-directory }}/.npmrc
|
||||
echo "" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm/registry/:username=github-actions" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm/registry/:_authToken=${{ inputs.token }}" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm/registry/:email=actions@github.com" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm:username=github-actions" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm:_authToken=${{ inputs.token }}" >> ${{ inputs.working-directory }}/.npmrc
|
||||
echo "${{ inputs.feed-url }}/npm:email=actions@github.com" >> ${{ inputs.working-directory }}/.npmrc
|
||||
11
.github/actions/cfs-npm-cache/action.yml
vendored
Normal file
11
.github/actions/cfs-npm-cache/action.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
name: Setup npm cache caching
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
with:
|
||||
include-npmrc-hash: 'true'
|
||||
56
.github/actions/cfs-npm-install/action.yml
vendored
Normal file
56
.github/actions/cfs-npm-install/action.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Does an npm install using our private Azure Artifacts registry which requires OIDC authentication.
|
||||
# Workflows that use this action must add the id-token: write permission.
|
||||
|
||||
name: npm install (CFS)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Azure OIDC Login
|
||||
uses: azure/login@v2
|
||||
with:
|
||||
# These are not secret values and are safe to commit to the repository
|
||||
client-id: 92c669e8-02ad-4ce6-ad73-f222fc7177e2
|
||||
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
|
||||
allow-no-subscriptions: true
|
||||
|
||||
- name: Setup CFS Credentials
|
||||
shell: bash
|
||||
id: npm-auth
|
||||
# The resource guid is the app id of Azure DevOps
|
||||
run: |
|
||||
echo "token=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 | jq -r .accessToken)" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: ./.github/actions/cfs-npm-authenticate
|
||||
with:
|
||||
working-directory: .
|
||||
token: ${{ steps.npm-auth.outputs.token }}
|
||||
|
||||
- uses: ./.github/actions/cfs-npm-authenticate
|
||||
with:
|
||||
working-directory: packages/pyright
|
||||
token: ${{ steps.npm-auth.outputs.token }}
|
||||
|
||||
- uses: ./.github/actions/cfs-npm-authenticate
|
||||
with:
|
||||
working-directory: packages/pyright-internal
|
||||
token: ${{ steps.npm-auth.outputs.token }}
|
||||
|
||||
- uses: ./.github/actions/cfs-npm-authenticate
|
||||
with:
|
||||
working-directory: packages/vscode-pyright
|
||||
token: ${{ steps.npm-auth.outputs.token }}
|
||||
|
||||
- uses: ./.github/actions/cfs-npm-cache
|
||||
|
||||
- run: npm run install:all
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
|
||||
- name: Cleanup .npmrc
|
||||
shell: bash
|
||||
run: rm .npmrc
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
19
.github/actions/choose-npm-install/action.yml
vendored
Normal file
19
.github/actions/choose-npm-install/action.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Accessing the CFS feed requires OIDC authentication which is not allowed on branches from forks.
|
||||
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
|
||||
# This action decides whether to use CFS based on the source of the branch in play.
|
||||
|
||||
name: npm install (consider using CFS)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: CFS npm install
|
||||
if: github.event.pull_request.head.repo.fork != true
|
||||
uses: ./.github/actions/cfs-npm-install
|
||||
|
||||
- name: Standard npm install
|
||||
if: github.event.pull_request.head.repo.fork == true
|
||||
uses: ./.github/actions/standard-npm-install
|
||||
49
.github/actions/npm-cache-dir/action.yml
vendored
Normal file
49
.github/actions/npm-cache-dir/action.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Cache npm download directory
|
||||
description: Cache npm's download cache directory (npm config get cache) using actions/cache
|
||||
|
||||
inputs:
|
||||
cache-dependency-path:
|
||||
description: Glob(s) passed to hashFiles to generate the cache key
|
||||
default: '**/package-lock.json'
|
||||
required: false
|
||||
include-npmrc-hash:
|
||||
description: Include hashFiles('**/.npmrc') in the key (useful when registry settings affect cache safety)
|
||||
default: 'false'
|
||||
required: false
|
||||
key-prefix:
|
||||
description: Prefix for the generated key
|
||||
default: 'node'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Get npm cache directory (non-Windows)
|
||||
id: npm-cache-dir-bash
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
run: echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Get npm cache directory (Windows)
|
||||
id: npm-cache-dir-pwsh
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$dir = npm config get cache
|
||||
"dir=$dir" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
|
||||
|
||||
- name: Cache npm cache directory (with .npmrc)
|
||||
if: inputs.include-npmrc-hash == 'true'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.npm-cache-dir-bash.outputs.dir || steps.npm-cache-dir-pwsh.outputs.dir }}
|
||||
key: ${{ runner.os }}-${{ inputs.key-prefix }}-${{ hashFiles('**/.npmrc') }}-${{ hashFiles(inputs.cache-dependency-path) }}
|
||||
restore-keys: ${{ runner.os }}-${{ inputs.key-prefix }}-${{ hashFiles('**/.npmrc') }}-
|
||||
|
||||
- name: Cache npm cache directory
|
||||
if: inputs.include-npmrc-hash != 'true'
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.npm-cache-dir-bash.outputs.dir || steps.npm-cache-dir-pwsh.outputs.dir }}
|
||||
key: ${{ runner.os }}-${{ inputs.key-prefix }}-${{ hashFiles(inputs.cache-dependency-path) }}
|
||||
restore-keys: ${{ runner.os }}-${{ inputs.key-prefix }}-
|
||||
15
.github/actions/standard-npm-install/action.yml
vendored
Normal file
15
.github/actions/standard-npm-install/action.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Standard npm install using the public npm registry.
|
||||
|
||||
name: npm install (public registry)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- name: Standard npm install
|
||||
shell: bash
|
||||
run: npm run install:all
|
||||
118
.github/agents/pyright-test-policy.md
vendored
Normal file
118
.github/agents/pyright-test-policy.md
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
name: pyright-test-policy
|
||||
description: Enforces Pyright test policy, preserving type precision and requiring justification for test changes.
|
||||
---
|
||||
|
||||
# Pyright Test Policy
|
||||
|
||||
Tests are the specification for Pyright behavior.
|
||||
|
||||
Agents must **not modify tests simply to make CI pass**.
|
||||
|
||||
The goal is to **preserve or improve type precision** unless a justified upstream change requires otherwise.
|
||||
|
||||
---
|
||||
|
||||
# Allowed Changes
|
||||
|
||||
Agents may modify tests only when one of the following is true:
|
||||
|
||||
1. A **typeshed stub change** legitimately alters the expected type.
|
||||
2. A **Pyright diagnostic message format** changed but the semantic meaning is the same.
|
||||
3. A test relied on unstable formatting or ordering.
|
||||
|
||||
---
|
||||
|
||||
# Precision Regression Rule (Default)
|
||||
|
||||
Any change that makes types less precise is considered a **regression by default**.
|
||||
|
||||
Examples:
|
||||
|
||||
- `T → Unknown`
|
||||
- `T → Any`
|
||||
- container precision loss
|
||||
`list[int] → list[Any]`
|
||||
- literal widening
|
||||
`Literal["x"] → str`
|
||||
|
||||
These regressions are **allowed only with justification**.
|
||||
|
||||
---
|
||||
|
||||
# Allowed Regression With Evidence
|
||||
|
||||
`Unknown` or `Any` changes may be accepted **only if the PR includes**:
|
||||
|
||||
1. **Evidence**
|
||||
- the relevant typeshed stub diff
|
||||
- or an upstream typing change
|
||||
|
||||
2. **Reasoning**
|
||||
- why Pyright cannot infer the previous precision
|
||||
|
||||
3. **Classification**
|
||||
- A) typeshed became less precise
|
||||
- B) Pyright limitation
|
||||
- C) test fragility
|
||||
- D) harness issue
|
||||
|
||||
4. **Mitigation**
|
||||
When possible:
|
||||
- open a typeshed issue/PR
|
||||
- or add a TODO referencing the issue
|
||||
|
||||
---
|
||||
|
||||
# Forbidden Changes
|
||||
|
||||
Agents must NOT:
|
||||
|
||||
- blindly replace expected types with `Unknown` or `Any`
|
||||
- remove diagnostics
|
||||
- delete `reveal_type` checks
|
||||
- suppress errors to make tests pass
|
||||
|
||||
without the justification process above.
|
||||
|
||||
---
|
||||
|
||||
# Preferred Fix Order
|
||||
|
||||
Agents must attempt fixes in this order:
|
||||
|
||||
1. **Fix Pyright behavior**
|
||||
2. **Fix incorrect typeshed stub**
|
||||
3. **Adjust tests (last resort)**
|
||||
|
||||
---
|
||||
|
||||
# Precision Regression Reporting
|
||||
|
||||
If a regression is introduced, the agent must include a report in the PR:
|
||||
|
||||
Example:
|
||||
|
||||
Precision Regression Report
|
||||
|
||||
Test | Before | After | Reason
|
||||
---- | ---- | ---- | ----
|
||||
test_numpy_array | ndarray[int] | ndarray[Any] | typeshed change in numpy/__init__.pyi
|
||||
|
||||
This ensures reviewers can quickly understand the impact.
|
||||
|
||||
---
|
||||
|
||||
# Review Gate
|
||||
|
||||
If more than **2 precision regressions** occur in a single PR, the agent must stop and request human review.
|
||||
|
||||
---
|
||||
|
||||
# Commit Message Requirements
|
||||
|
||||
Each fix must include:
|
||||
|
||||
- failure classification (A/B/C/D)
|
||||
- relevant typeshed commit (if applicable)
|
||||
- explanation of how the change preserves or justifies type precision
|
||||
206
.github/agents/typeshed-update-agent.md
vendored
Normal file
206
.github/agents/typeshed-update-agent.md
vendored
Normal file
@@ -0,0 +1,206 @@
|
||||
---
|
||||
name: typeshed-update-agent
|
||||
description: Updates Pyright bundled typeshed fallback and triages resulting test changes while preserving type precision.
|
||||
---
|
||||
|
||||
# Typeshed Update Agent
|
||||
|
||||
This agent updates the typeshed version used by Pyright and ensures tests remain correct and precise.
|
||||
|
||||
The agent must follow the **Pyright Test Policy**.
|
||||
|
||||
---
|
||||
|
||||
# Phase 1 — Update Typeshed
|
||||
|
||||
1. Update the pinned typeshed commit or submodule.
|
||||
2. Run the full Pyright test suite.
|
||||
3. If all tests pass, create a PR titled:
|
||||
|
||||
Update typeshed to <commit>
|
||||
|
||||
Include the typeshed commit hash and summary.
|
||||
The PR must target the upstream Pyright repository (`microsoft/pyright`), not the fork repository.
|
||||
Use the fork branch as the PR head if needed, and verify the reported PR URL is under `github.com/microsoft/pyright`.
|
||||
|
||||
## Running The Update Script
|
||||
|
||||
Use the repo script (from the Pyright repo root):
|
||||
|
||||
```bash
|
||||
python build/updateTypeshed.py
|
||||
```
|
||||
|
||||
Useful options:
|
||||
|
||||
- specific commit: `python build/updateTypeshed.py --commit <typeshed_commit>`
|
||||
- dry run: `python build/updateTypeshed.py --dry-run`
|
||||
|
||||
Notes:
|
||||
|
||||
- The script clones `https://github.com/python/typeshed.git` into a temporary directory.
|
||||
- A local checkout of typeshed is not required to run the update.
|
||||
- It updates `packages/pyright-internal/typeshed-fallback/` and writes the selected SHA to `packages/pyright-internal/typeshed-fallback/commit.txt`.
|
||||
- Do not spend token budget reviewing or summarizing the full generated `typeshed-fallback` diff; it is expected to be large and noisy. Use the pinned SHA, upstream compare links, and targeted file inspection only when tests fail or a specific behavior change needs triage.
|
||||
|
||||
## Upstream Investigation Guidance
|
||||
|
||||
When behavior changes are suspected, inspect upstream typeshed directly:
|
||||
|
||||
- typeshed repo: `https://github.com/python/typeshed`
|
||||
- compare SHAs: `https://github.com/python/typeshed/compare/<old_sha>...<new_sha>`
|
||||
- specific PRs linked from changed files or commit history (for example dict constructor positional-only changes in `python/typeshed#15262`)
|
||||
|
||||
Always tie Pyright test changes to a concrete upstream typeshed commit or PR.
|
||||
|
||||
---
|
||||
|
||||
# Phase 2 — Failure Triage
|
||||
|
||||
If tests fail, the agent must classify each failure.
|
||||
|
||||
Possible categories:
|
||||
|
||||
A) Legitimate typeshed behavior change
|
||||
B) Pyright bug revealed by new stubs
|
||||
C) Test fragility (formatting / ordering)
|
||||
D) Test harness or environment issue
|
||||
|
||||
The agent must inspect:
|
||||
|
||||
- failing test
|
||||
- relevant stub definitions
|
||||
- typeshed commit diff
|
||||
- diagnostic output
|
||||
|
||||
## Known High-Risk Change Patterns
|
||||
|
||||
Pay extra attention when the typeshed diff includes:
|
||||
|
||||
- positional-only separators (`/`) added or moved in `__new__`/`__init__`
|
||||
- overload reordering or overload narrowing/widening
|
||||
- `Self` return type changes in constructors or metaclass `__call__`
|
||||
- `contextmanager` / generator return annotation changes
|
||||
- stdlib constructor stubs for `dict`, `defaultdict`, `set`, `frozenset`, `slice`
|
||||
|
||||
These often surface Category B regressions in constructor synthesis, overload matching, and callable conversion.
|
||||
|
||||
---
|
||||
|
||||
# Phase 3 — Diagnostic Diff
|
||||
|
||||
For each failing test:
|
||||
|
||||
1. Capture baseline diagnostics
|
||||
2. Capture new diagnostics
|
||||
3. Compute a diff
|
||||
|
||||
Track changes including:
|
||||
|
||||
- removed diagnostics
|
||||
- added diagnostics
|
||||
- `reveal_type` output changes
|
||||
- type precision changes
|
||||
|
||||
## Targeted Test Matrix (Run Early)
|
||||
|
||||
Run these focused tests before full-suite reruns when related files change.
|
||||
|
||||
- constructor callable and default constructor behavior:
|
||||
- `cd packages/pyright-internal && npm run test:norebuild -- typeEvaluator6.test.ts -t "ConstructorCallable1|ConstructorCallable2|Constructor28" --runInBand`
|
||||
- contextmanager / generator behavior:
|
||||
- `cd packages/pyright-internal && npm run test:norebuild -- typeEvaluator2.test.ts -t Solver7 --runInBand`
|
||||
- positional-only parameter behavior:
|
||||
- `cd packages/pyright-internal && npm run test:norebuild -- typeEvaluator1.test.ts -t Call3 --runInBand`
|
||||
|
||||
---
|
||||
|
||||
# Phase 4 — Fix Strategy
|
||||
|
||||
Preferred order:
|
||||
|
||||
1. Fix Pyright implementation
|
||||
2. Patch incorrect typeshed stub
|
||||
3. Update expected outputs (last resort)
|
||||
|
||||
Test updates must follow the **Precision Regression Rule**.
|
||||
|
||||
---
|
||||
|
||||
# Handling Precision Regressions
|
||||
|
||||
If type precision is reduced (e.g. `T → Unknown`):
|
||||
|
||||
1. Check whether a stub change caused the regression.
|
||||
2. Attempt to restore precision via Pyright improvements.
|
||||
3. If unavoidable, update tests **with justification**.
|
||||
|
||||
A regression report must be added to the PR.
|
||||
|
||||
## Regression Guardrails
|
||||
|
||||
- Do not accept `T -> Unknown` precision drops without root-cause analysis.
|
||||
- Do not update reveal expectations until checking whether a Pyright implementation fix can preserve precision.
|
||||
- If a reveal text changes due to upstream behavior, include the upstream commit/PR reference in the test update commit message or PR description.
|
||||
|
||||
---
|
||||
|
||||
# Pull Request Requirements
|
||||
|
||||
PR must include:
|
||||
|
||||
- typeshed commit bump
|
||||
- Pyright fixes if needed
|
||||
- minimal test updates
|
||||
- precision regression report (if applicable)
|
||||
- explanation for each change
|
||||
|
||||
## PR Output Template
|
||||
|
||||
Include the following sections in the PR description:
|
||||
|
||||
1. Upstream typeshed update
|
||||
- old SHA -> new SHA
|
||||
- compare URL
|
||||
2. Failure classification summary
|
||||
- categories A/B/C/D with counts
|
||||
3. Pyright fixes
|
||||
- files changed
|
||||
- behavior restored
|
||||
4. Test updates
|
||||
- which files changed and why
|
||||
5. Precision report
|
||||
- any `reveal_type` deltas and justification
|
||||
6. Validation
|
||||
- targeted tests run
|
||||
- full suite result
|
||||
|
||||
---
|
||||
|
||||
# Commit Structure
|
||||
|
||||
Preferred commits:
|
||||
|
||||
1. typeshed update
|
||||
2. pyright fixes
|
||||
3. justified test updates
|
||||
|
||||
Keeping these separate simplifies review.
|
||||
|
||||
---
|
||||
|
||||
# Safety Rules
|
||||
|
||||
The agent must stop and request human review if:
|
||||
|
||||
- more than 2 precision regressions occur
|
||||
- a change affects core typing behavior
|
||||
- tests require large-scale updates
|
||||
|
||||
## Escalation Checklist
|
||||
|
||||
Escalate early when any of these occur:
|
||||
|
||||
- constructor synthesis behavior changes in multiple unrelated samples
|
||||
- new failures in both evaluator and language service suites from one stub change
|
||||
- uncertainty about whether a fix belongs in Pyright versus upstream typeshed
|
||||
108
.github/copilot-instructions.md
vendored
Normal file
108
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
# Copilot Instructions for Pyright
|
||||
|
||||
Pyright is a static type checker for Python, written in TypeScript. It ships as an npm CLI (`pyright`), an LSP language server (`pyright-langserver`), and a VS Code extension (`vscode-pyright`).
|
||||
|
||||
## Build and Test
|
||||
|
||||
```bash
|
||||
# Install all packages (from repo root)
|
||||
npm install
|
||||
|
||||
# Build the core library
|
||||
cd packages/pyright-internal && npm run build
|
||||
|
||||
# Run all tests (builds test server first)
|
||||
cd packages/pyright-internal && npm test
|
||||
|
||||
# Run all tests without rebuilding the test server (faster iteration)
|
||||
cd packages/pyright-internal && npm run test:norebuild
|
||||
|
||||
# Run a single test file
|
||||
cd packages/pyright-internal && npx jest typeEvaluator1.test --forceExit
|
||||
|
||||
# Run a single test by name
|
||||
cd packages/pyright-internal && npx jest -t "Generic1" --forceExit
|
||||
|
||||
# Build the CLI (webpack bundle)
|
||||
npm run build:cli:dev
|
||||
|
||||
# Build the VS Code extension (webpack bundle)
|
||||
npm run build:extension:dev
|
||||
```
|
||||
|
||||
### Linting
|
||||
|
||||
```bash
|
||||
# Run all checks (syncpack + eslint + prettier)
|
||||
npm run check
|
||||
|
||||
# Individual checks
|
||||
npm run check:eslint
|
||||
npm run check:prettier
|
||||
|
||||
# Auto-fix
|
||||
npm run fix:eslint
|
||||
npm run fix:prettier
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Package Structure
|
||||
|
||||
- **`packages/pyright-internal`** — Core library: parser, binder, type evaluator, checker, language service. All logic lives here. This is the only package with tests.
|
||||
- **`packages/pyright`** — CLI wrapper. Webpack-bundles `pyright-internal` into a distributable npm package with `pyright` and `pyright-langserver` entry points.
|
||||
- **`packages/vscode-pyright`** — VS Code extension client that communicates with the language server.
|
||||
|
||||
### Analysis Pipeline
|
||||
|
||||
Source files are processed through these phases in order:
|
||||
|
||||
1. **Tokenizer** (`parser/tokenizer.ts`) — text → token stream
|
||||
2. **Parser** (`parser/parser.ts`) — tokens → parse tree (AST)
|
||||
3. **Binder** (`analyzer/binder.ts`) — builds scopes, symbol tables, and reverse code flow graphs
|
||||
4. **Checker** (`analyzer/checker.ts`) — walks every node, triggering type evaluation and reporting diagnostics
|
||||
5. **Type Evaluator** (`analyzer/typeEvaluator.ts`) — performs type inference, constraint solving, type narrowing, and overload resolution
|
||||
|
||||
### Key Design Patterns
|
||||
|
||||
**Type Evaluator closure pattern**: `typeEvaluator.ts` uses a single large `createTypeEvaluator()` factory function. Internal methods access the full closure for performance (same approach as the TypeScript compiler). The public API is defined as the `TypeEvaluator` interface in `typeEvaluatorTypes.ts`.
|
||||
|
||||
**Service → Program → SourceFile**: A `Service` manages a `Program`, which tracks `SourceFile` instances. The `Program` coordinates analysis ordering, prioritizing open editor files and their dependencies.
|
||||
|
||||
**Typeshed fallback**: `packages/pyright-internal/typeshed-fallback/` contains a bundled copy of typeshed stubs. This provides the Python stdlib type stubs when no external typeshed is available.
|
||||
|
||||
**Localized diagnostics**: All user-facing diagnostic messages come from `localization/localize.ts`, not inline strings.
|
||||
|
||||
## Test Conventions
|
||||
|
||||
### Test Structure
|
||||
|
||||
Tests live in `packages/pyright-internal/src/tests/`. There are two main patterns:
|
||||
|
||||
**Sample-based tests** (`typeEvaluator*.test.ts`, `checker.test.ts`):
|
||||
- Each test calls `TestUtils.typeAnalyzeSampleFiles(['sampleName.py'])` to analyze a Python file from `src/tests/samples/`.
|
||||
- Results are validated with `TestUtils.validateResults(results, errorCount, warningCount, infoCount, unusedCode, unreachableCode, deprecated)`.
|
||||
- Sample `.py` files use comments like `# This should generate an error` to document expected diagnostics, but the actual assertion is the count passed to `validateResults`.
|
||||
|
||||
**Fourslash tests** (`src/tests/fourslash/`):
|
||||
- Simulate LSP interactions (completions, hover, go-to-definition, rename, etc.).
|
||||
- Use `// @filename:` markers to define virtual files and `///` prefix for embedded Python content.
|
||||
|
||||
### Adding a Test
|
||||
|
||||
1. Create a `.py` sample file in `src/tests/samples/` following the naming pattern (e.g., `newFeature1.py`).
|
||||
2. Add a test case in the appropriate `*.test.ts` file calling `typeAnalyzeSampleFiles` and `validateResults`.
|
||||
3. Test files are split across `typeEvaluator1.test.ts` through `typeEvaluator8.test.ts` for parallel execution.
|
||||
|
||||
### Test Policy
|
||||
|
||||
Tests are the specification for Pyright behavior. Never modify tests just to make CI pass. Any change that makes types less precise (e.g., `T → Unknown`, `list[int] → list[Any]`, `Literal["x"] → str`) is a regression by default and requires explicit justification. See `.github/agents/pyright-test-policy.md` for details.
|
||||
|
||||
## Code Style
|
||||
|
||||
- **Formatting**: Prettier with 4-space indentation, single quotes, 120-char print width.
|
||||
- **Private members**: Must have leading underscore (`_privateMethod`). Protected and public must not.
|
||||
- **Class member order**: fields → constructor → public getters/setters → public methods → protected → private (enforced by ESLint).
|
||||
- **Imports**: Sorted by `simple-import-sort` ESLint plugin.
|
||||
- **No explicit `public`**: The `public` keyword is forbidden on class members (use implicit public).
|
||||
- **Strict TypeScript**: `strict: true`, `noImplicitReturns`, `noImplicitOverride`, target ES2020.
|
||||
126
.github/plans/archived/FIX_11453_QUALNAME_INSTANCE_ACCESS_PLAN.md
vendored
Normal file
126
.github/plans/archived/FIX_11453_QUALNAME_INSTANCE_ACCESS_PLAN.md
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# FIX 11453 — No error on accessing `__qualname__` of an instance
|
||||
## Status: ✅ Complete
|
||||
|
||||
Status: 🟢 Active — fix implemented, verified & reviewed; ready to commit (PR/archival pipeline-deferred)
|
||||
Owner: PylanceFix/PylanceCode (fix-loop)
|
||||
Branch: `fix11453`
|
||||
Worktree: `C:\Users\rchiodo\.fix_loop\repos\microsoft__pyright\.worktrees_8765\fix11453`
|
||||
|
||||
## Context
|
||||
|
||||
- Issue: https://github.com/microsoft/pyright/issues/11453
|
||||
- Title: "no error on accessing `__qualname__` of instance"
|
||||
- Kind: bugfix
|
||||
- User impact: Pyright/Pylance fails to report the expected "cannot access attribute" diagnostic when `__qualname__` is accessed on an **instance** (e.g. `SomeClass().__qualname__`). `__qualname__` is a class-level attribute (defined on `type`), not an instance attribute, so instance access should be flagged.
|
||||
- Triage (PylanceTriage handoff): Verified defect. The binder injects an implicit `__qualname__` class member (including on `object`), so instance access resolves it and skips the expected "cannot access attribute" diagnostic.
|
||||
|
||||
### Non-goals
|
||||
|
||||
- Do not change behavior for **class-level** access (`SomeClass.__qualname__` must remain valid).
|
||||
- Do not change `__name__`/`__doc__`/other dunder handling beyond what is strictly required for parity with the fix (verify before touching).
|
||||
- No broad refactors of the binder or type evaluator.
|
||||
|
||||
## Constraints & policies
|
||||
|
||||
- This is a `microsoft/pyright` issue (worktree is the pyright repo). PR convention: "Fixes <full URL>".
|
||||
- Keep diffs surgical; pyright core is upstream-owned.
|
||||
- Test placement: add a pyright-internal regression test under `packages/pyright-internal/src/tests/` (sample `.py` + `validateResults` count, or fourslash if interaction-based). Follow existing `typeEvaluator*`/`checker` sample-test conventions.
|
||||
- Do not reduce type precision elsewhere; the change must be narrowly scoped to instance access of `__qualname__`.
|
||||
- Test policy: tests are the spec; new test must encode the expected diagnostic.
|
||||
|
||||
## Strategy
|
||||
|
||||
Phases (high level — verify file/function names before editing; these are hypotheses, not directives):
|
||||
|
||||
1. **Reproduce**: Write a minimal sample showing `instance.__qualname__` should error and `Class.__qualname__` should not. Confirm current behavior produces no diagnostic on the instance access.
|
||||
2. **Locate root cause**: Per triage, an implicit `__qualname__` member is injected as a class member (hypothesis: in the binder, alongside other synthesized dunders, possibly applied to `object`/all classes). Verify where `__qualname__` becomes accessible on instances. Confirm whether it is the binder injection or member-access resolution that fails to treat it as class-only.
|
||||
3. **Minimal fix**: Make `__qualname__` resolve only for class-object access, not instance access — mirroring how Python exposes it via `type` (class) rather than instances. Prefer the approach that keeps `Class.__qualname__` valid and only suppresses instance access.
|
||||
4. **Validate**: Run the new regression test plus the relevant existing suites (`typeEvaluator*`, `checker`) to ensure no precision regressions.
|
||||
|
||||
Verification approach: sample-based test with `validateResults` expected error count; confirm class access stays clean.
|
||||
|
||||
## Acceptance Contract
|
||||
|
||||
1. **Observable change**: Accessing `__qualname__` on an instance is flagged with the expected "cannot access attribute" (reportAttributeAccessIssue) diagnostic, matching runtime behavior where instances do not expose `__qualname__`.
|
||||
2. **Success criteria**:
|
||||
- [ ] `instance.__qualname__` (e.g. `MyClass().__qualname__`) → reports an attribute-access error.
|
||||
- [ ] `MyClass.__qualname__` (class-object access) → no error, type `str`.
|
||||
3. **Regression guard**:
|
||||
- [ ] Existing `__name__`/class dunder behavior unchanged.
|
||||
- [ ] No new false positives in `typeEvaluator*` / `checker` suites.
|
||||
4. **Scope boundary**: Only `__qualname__` instance-vs-class access semantics. No changes to unrelated dunders or to the binder's broader synthesized-member logic unless proven required.
|
||||
|
||||
## Work items
|
||||
|
||||
| # | Work item | Status | Owner | Exit criteria |
|
||||
|---|-----------|--------|-------|---------------|
|
||||
| 1 | Reproduce no-error-on-instance behavior | ✅ Done | impl | Confirmed current build emits no diagnostic for `instance.__qualname__` |
|
||||
| 2 | Verify root cause (binder implicit `__qualname__` injection) | ✅ Done | impl | Located exact injection/resolution site; confirmed root cause |
|
||||
| 3 | Implement minimal fix (class-only access) | ✅ Done | impl | `instance.__qualname__` errors; `Class.__qualname__` valid |
|
||||
| 4 | Add regression test (pyright-internal) | ✅ Done | impl | New sample + `validateResults` asserts expected error/no-error counts |
|
||||
| 5 | Run targeted + relevant existing suites | ✅ Done | impl | New test passes; no regressions in `typeEvaluator*`/`checker` |
|
||||
| 6 | Format & lint | ✅ Done | impl | `npm run check` clean for changed files |
|
||||
| 7 | Debugger verification | ✅ Done | impl | Breakpoint confirms changed code path exercised (or waiver recorded) |
|
||||
| 8 | Impact follow-through | ✅ Done | impl | Blast-radius of `__qualname__` injection change assessed; no orphaned call sites |
|
||||
| 9 | Test coverage sufficiency | ✅ Done | impl | Coverage verified against Acceptance Contract (instance error + class-access clean) |
|
||||
| 10 | Full review freshness gate (code review loop) | ✅ Done | impl | Local adversarial_review (4-reviewer panel) on worktree: zero Critical/High defects; no code changes required |
|
||||
| 11 | Create/update PR | ⏸️ Pipeline-deferred | pipeline | PR/push gated by pipeline permissions (fix-loop boundary) |
|
||||
|
||||
## Investigation log
|
||||
|
||||
- 2026-06-15: **Work item 1 (Reproduce) — DONE.** Updated existing sample `packages/pyright-internal/src/tests/samples/classes3.py` (which already documents this exact bug at the `instance.__qualname__` line) and bumped expected error count in `typeEvaluator3.test.ts` `Classes3` test 3 → 4. Test run RED as expected: "Expected 4 errors, got 3"; `instance.__qualname__` not flagged. Other 3 errors (`__dummy__`, `instance.__name__`, `self.__name__`) unchanged.
|
||||
- 2026-06-15: **Work item 2 (Root cause) — DONE.** Verified via static analysis + CPython runtime check + in-repo test documentation.
|
||||
- Injection site: `binder.ts` ~line 510 `this._addImplicitSymbolToCurrentScope('__qualname__', node, 'str')` injects `__qualname__` into every class scope's symbol table.
|
||||
- Because the scope is a Class scope, `_addSymbolToCurrentScope` sets `SymbolFlags.ClassMember`. `getClassMemberIterator` (`typeUtils.ts` ~line 1880) yields any symbol with `isClassMember()`, so instance member access finds `__qualname__` and skips the expected "cannot access attribute" diagnostic.
|
||||
- Why injected at all: `__qualname__` must be name-resolvable inside a class body (`print(__qualname__)`), like `__doc__`/`__module__`. Unlike those, `__qualname__` is NOT a valid instance/class-dict attribute at runtime.
|
||||
- CPython evidence: `A().__qualname__` → AttributeError even when `__qualname__='custom'` is assigned in the class body; `__qualname__` never in `B.__dict__`. Metaclass `type` defines `__qualname__: str` and `__name__: str`, so `Class.__qualname__` resolves via the metaclass regardless of the binder injection.
|
||||
- 2026-06-15: **Work item 7 (Debugger verification) — DONE** via `_DebuggerInvestigation`. Confirmed at runtime the implicit `__qualname__` symbol in `TestClass` has `isClassMember()=true`, `isInstanceMember()=false` (raw flags 68 = ClassMember|IgnoredForProtocolMatch), single Intrinsic("str") decl; `__name__` is absent from the class symbol table. Confirmed `getClassMemberIterator` (`typeUtils.ts` ~L1883) yields it on instance access, suppressing the error. Root cause confirmed exactly as hypothesized.
|
||||
- 2026-06-15: **Work items 3–6, 8 — DONE.**
|
||||
- **Fix (item 3)** in `binder.ts`: `_addImplicitSymbolToCurrentScope(name, node, type, isClassMember = true)` threads a new optional param to `_addSymbolToCurrentScope(name, isInitiallyUnbound, isClassMember = true)`, which now only sets `SymbolFlags.ClassMember` when scope is Class AND `isClassMember`. The `__qualname__` class-scope injection passes `/* isClassMember */ false` (with explanatory comment); `__doc__`/`__module__` unchanged.
|
||||
- **Regression test (item 4)**: `classes3.py` marks `instance.__qualname__` as expected error; `typeEvaluator3` `Classes3` count 3→4. Added `reveal_type(qualname, expected_text="str")` precision guard, plus new `completions.qualname.fourslash.ts` (instance excludes `__qualname__`, includes `__doc__`/`__module__`; class includes `__qualname__`).
|
||||
- **Tests (item 5)**: Classes3 green; full `typeEvaluator1-8` + `checker.test` = 9 suites / 1234 tests pass; new fourslash test passes; fourslash completions/hover 333/333 pass.
|
||||
- **Format & lint (item 6)**: prettier --check clean on changed TS; eslint (ESLINT_USE_FLAT_CONFIG=false) exit 0, no errors.
|
||||
- **Impact follow-through (item 8)** via `_PylanceImpactFollowThrough`: gaps-fixed; H1–H7 processed (instance error, class precision str, instance/class completion surfaces tested; protocol/function/metaclass paths waived with evidence). No remaining actionable gaps.
|
||||
- 2026-06-15: **Work item 9 (Test coverage sufficiency) — DONE** via `_PylanceTestCoverage` adversarial panel. Filled high/medium gaps in `classes3.py`:
|
||||
- Subclass: `Sub(TestClass)` — `Sub.__qualname__` reveals `str`; `Sub().__qualname__` errors (MRO does not surface base's non-member `__qualname__`).
|
||||
- Nested/inner class: `Outer.Inner` body `print(__qualname__)` resolves; `Inner.__qualname__` reveals `str`; `Outer.Inner().__qualname__` errors.
|
||||
- Generic class-object: in `func1(cls: type[_T])`, `cls.__qualname__` reveals `str`.
|
||||
- Bumped `typeEvaluator3` `Classes3` expected error count 4 → 6; re-ran PASS (all 6 errors + `reveal_type` str guards). Low-priority metaclass/dataclass case deemed sufficiently covered by the general member-access mechanism.
|
||||
|
||||
- 2026-06-15: **Work item 10 (Code review loop) — DONE.** Review Center (`_PylanceChangeReview`) is bound to the pyrx repo and cannot review this standalone pyright worktree, so ran the local `adversarial_review` tool (advocate/skeptic/architect/rules panel) on the worktree.
|
||||
- **Outcome: zero Critical/High code defects.** All four reviewers endorsed the fix as a precise, root-cause fix (binder injection) with strong test coverage. No code changes required.
|
||||
- Findings (all non-actionable for code):
|
||||
- [issue] "Plan still active in `.github/plans/` — archive before merge." NOT actionable here: per fix-loop pipeline boundary, the pipeline owns plan archival/PR; impl must not archive or push. Pipeline-deferred.
|
||||
- [warning] "post-archive `npm run fix:files`" — tied to archival; pipeline-handled.
|
||||
- [info] Obscure edge: `self.__qualname__ = x` / `cls.__qualname__ = x` member-assignment in a method can re-stamp ClassMember via `_getMemberAccessInfo`. Out of scope — and `self.__qualname__ = x` SETS a real instance attribute at runtime, so resolving is correct there. Left as-is.
|
||||
- [info] Comment could mention `getClassMemberIterator` gates on `isClassMember()` — existing comment already explains the why; acceptable.
|
||||
- [info] Could add in-class-body completion marker — already covered by `print(__qualname__)` resolution in the nested-class sample.
|
||||
- [info] Audit direct symbol-table iterators — covered by green typeEvaluator1-8 + checker (1234 tests) and fourslash completions/hover (333 tests); repo-wide grep shows only `classes3.py` references instance `__qualname__`.
|
||||
- Verified binder.ts change is present (line 517 `__qualname__` injected with `isClassMember=false`); reviewer's "pre-fix" note was confusion with a separate pyrx mirror checkout. `git diff --stat` confirms `binder.ts` + `classes3.py` + `typeEvaluator3.test.ts` modified (+ new untracked fourslash test).
|
||||
- Decision: No code changes required from review. Proceeding to commit (AUTO_DRIVE_GIT=true). Push/PR (item 11) + plan archival remain pipeline-gated per fix-loop boundary.
|
||||
|
||||
## Root cause (verified)
|
||||
|
||||
The binder unconditionally injects an implicit `__qualname__` symbol into each class scope's symbol table (`binder.ts` ~L510). In a Class scope, `_addSymbolToCurrentScope` stamps it with `SymbolFlags.ClassMember`. Instance member-access resolution (`getClassMemberIterator`, `typeUtils.ts` ~L1880) treats any `isClassMember()` symbol as accessible, so `instance.__qualname__` resolves to `str` and the expected "cannot access attribute" diagnostic is suppressed. At runtime, `__qualname__` is exposed only via the metaclass `type` (so `Class.__qualname__` works) and never as an instance attribute.
|
||||
|
||||
## Decisions
|
||||
|
||||
- 2026-06-15: Adopt class-only access semantics for `__qualname__` (instance access should error), consistent with CPython where `__qualname__` is exposed via `type`, not instances.
|
||||
- 2026-06-15: **Planned fix** — make the binder's implicit `__qualname__` symbol scope-only by omitting the `ClassMember` flag, so it remains name-resolvable inside the class body but is not exposed as a class/instance member. `Class.__qualname__` still resolves via metaclass `type.__qualname__: str`; `instance.__qualname__` now errors like `__name__`. Implement via an optional param on `_addImplicitSymbolToCurrentScope` / `_addSymbolToCurrentScope` to suppress the `ClassMember` flag. Change isolated to `__qualname__` only — NOT `__doc__`/`__module__` (which are legitimately instance-accessible).
|
||||
|
||||
## Risks / unknowns
|
||||
|
||||
- Risk: `__qualname__` may be needed on class objects in some synthesized contexts (e.g. functions/methods also have `__qualname__`). Ensure the fix does not break `function.__qualname__` or `Class.__qualname__`.
|
||||
- Unknown: exact location and mechanism of the implicit injection (binder vs synthesized-type members vs `object` stub). Verify before editing.
|
||||
- Risk: Over-broad fix could newly flag legitimate dunder access elsewhere → mitigate with focused test + full suite run.
|
||||
|
||||
## Learnings
|
||||
|
||||
- (to capture) Where pyright synthesizes/injects class-only dunders and how instance-vs-class member access is distinguished.
|
||||
- 2026-06-15: Implicit class-scope dunders that are metaclass-only (e.g. `__qualname__`) must be injected WITHOUT `SymbolFlags.ClassMember` so they stay name-resolvable in the class body while being excluded from instance/class member access and completions. `__doc__`/`__module__` are legitimately instance-accessible and keep the flag.
|
||||
|
||||
## Next steps
|
||||
|
||||
1. impl: Commit the change on branch `fix11453` (AUTO_DRIVE_GIT=true).
|
||||
2. pipeline: Create/update PR (work item 11) — gated on push/PR permissions.
|
||||
3. pipeline: Archive plan + run `npm run fix:files` post-archival per fix-loop boundary.
|
||||
69
.github/workflows/build.yml
vendored
Normal file
69
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: 'Build'
|
||||
|
||||
env:
|
||||
NODE_VERSION: '22.x' # Shipped with VS Code.
|
||||
ARTIFACT_NAME_VSIX: vsix
|
||||
VSIX_NAME: vscode-pyright.vsix
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '1.1.[0-9][0-9][0-9]'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- name: Build VSIX
|
||||
working-directory: packages/vscode-pyright
|
||||
run: |
|
||||
npm run package
|
||||
mv pyright-*.vsix ${{ env.VSIX_NAME }}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.ARTIFACT_NAME_VSIX }}
|
||||
path: packages/vscode-pyright/${{ env.VSIX_NAME }}
|
||||
|
||||
create_release:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Create release
|
||||
needs: [build]
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
# TODO: If the release already exists (tag created via the GUI), reuse it.
|
||||
- name: Create release
|
||||
id: create_release
|
||||
uses: ncipollo/release-action@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
name: Published ${{ github.ref_name }}
|
||||
draft: true
|
||||
artifacts: ./artifacts/${{ env.ARTIFACT_NAME_VSIX }}/${{ env.VSIX_NAME }}
|
||||
artifactContentType: application/zip
|
||||
104
.github/workflows/mypy_primer_comment.yaml
vendored
Normal file
104
.github/workflows/mypy_primer_comment.yaml
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# This workflow runs when the "Run mypy_primer on PR" workflow completes.
|
||||
# It downloads the diff from the other workflow instances and creates
|
||||
# a summary comment in the PR.
|
||||
name: Comment with mypy_primer diff
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Run mypy_primer on PR
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
name: Comment PR from mypy_primer
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- name: Download diffs
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: ${{ github.event.workflow_run.id }},
|
||||
});
|
||||
const matchedArtifacts = artifacts.data.artifacts.filter((artifact) =>
|
||||
artifact.name.startsWith("mypy_primer_diffs"));
|
||||
|
||||
for (let i = 0; i < matchedArtifacts.length; i++) {
|
||||
const matchArtifact = matchedArtifacts[i];
|
||||
const download = await github.rest.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: matchArtifact.id,
|
||||
archive_format: "zip",
|
||||
});
|
||||
fs.writeFileSync(`diff_${i}.zip`, Buffer.from(download.data));
|
||||
}
|
||||
|
||||
- run: unzip diff_\*.zip
|
||||
- run: |
|
||||
cat diff_*.txt | tee fulldiff.txt
|
||||
|
||||
- name: Post comment
|
||||
id: post-comment
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const MAX_CHARACTERS = 30000
|
||||
const MAX_CHARACTERS_PER_PROJECT = MAX_CHARACTERS / 3
|
||||
|
||||
const fs = require('fs')
|
||||
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
|
||||
|
||||
function truncateIfNeeded(original, maxLength) {
|
||||
if (original.length <= maxLength) {
|
||||
return original
|
||||
}
|
||||
let truncated = original.substring(0, maxLength)
|
||||
// further, remove last line that might be truncated
|
||||
truncated = truncated.substring(0, truncated.lastIndexOf('\n'))
|
||||
let lines_truncated = original.split('\n').length - truncated.split('\n').length
|
||||
return `${truncated}\n\n... (truncated ${lines_truncated} lines) ...`
|
||||
}
|
||||
|
||||
const projects = data.split('\n\n')
|
||||
// don't let one project dominate
|
||||
data = projects.map(project => truncateIfNeeded(project, MAX_CHARACTERS_PER_PROJECT)).join('\n\n')
|
||||
// posting comment fails if too long, so truncate
|
||||
data = truncateIfNeeded(data, MAX_CHARACTERS)
|
||||
|
||||
console.log("Diff from mypy_primer:")
|
||||
console.log(data)
|
||||
|
||||
let body
|
||||
if (data.trim()) {
|
||||
body = 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```'
|
||||
} else {
|
||||
body = "According to [mypy_primer](https://github.com/hauntsaninja/mypy_primer), this change doesn't affect type check results on a corpus of open source code. ✅"
|
||||
}
|
||||
const prNumber = parseInt(fs.readFileSync("pr_number.txt", { encoding: "utf8" }))
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: prNumber,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body
|
||||
})
|
||||
return prNumber
|
||||
|
||||
- name: Hide old comments
|
||||
# v0.4.0
|
||||
uses: kanga333/comment-hider@c12bb20b48aeb8fc098e35967de8d4f8018fffdf
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
leave_visible: 1
|
||||
issue_number: ${{ steps.post-comment.outputs.result }}
|
||||
122
.github/workflows/mypy_primer_pr.yaml
vendored
Normal file
122
.github/workflows/mypy_primer_pr.yaml
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
# This workflow runs mypy_primer, a tool that runs pyright on a variety
|
||||
# of open-source Python projects that are known to type check with pyright.
|
||||
# It builds pyright from the latest PR commit and the merge base of the PR
|
||||
# and compares the output of both. It uploads the diffs as an artifact and
|
||||
# creates a PR comment with the results (with the help of the
|
||||
# mypy_primer_comment action).
|
||||
|
||||
# This workflow definition borrows liberally from the mypy repo. The original
|
||||
# workflow was designed to work in a sharded manner where n copies of
|
||||
# mypy_primer are started in parallel. Each instance runs 1/n of the projects.
|
||||
# For now, we run only one instance because pyright is fast, and the number
|
||||
# of projects that use pyright for type checking is small. To change this in
|
||||
# the future, change the 'shard_index' matrix to [0, 1, ..., n-1] and set
|
||||
# 'num-shards' to n.
|
||||
|
||||
name: Run mypy_primer on PR
|
||||
|
||||
env:
|
||||
NODE_VERSION: '22.x' # Shipped with VS Code.
|
||||
|
||||
on:
|
||||
# Run on the creation or update of a PR.
|
||||
pull_request:
|
||||
paths:
|
||||
- 'packages/pyright/**'
|
||||
- 'packages/pyright-internal/src/**'
|
||||
- 'packages/pyright-internal/typeshed-fallback/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
mypy_primer:
|
||||
name: Run mypy_primer on PR
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
matrix:
|
||||
shard-index: [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: pyright_to_test
|
||||
fetch-depth: 2
|
||||
fetch-tags: false
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: 'pyright_to_test/**/package-lock.json'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
pip install git+https://github.com/hauntsaninja/mypy_primer.git
|
||||
- name: Run mypy_primer
|
||||
shell: bash
|
||||
env:
|
||||
# mypy_primer installs both the PR and base commits. The base commit can contain
|
||||
# historical peer dependency conflicts that should not block primer comparisons.
|
||||
NPM_CONFIG_LEGACY_PEER_DEPS: 'true'
|
||||
run: |
|
||||
cd pyright_to_test
|
||||
echo "new commit"
|
||||
git rev-list --format=%s --max-count=1 $GITHUB_SHA
|
||||
git branch new_commit $GITHUB_SHA
|
||||
|
||||
MERGE_BASE=$(git rev-parse "$GITHUB_SHA^1")
|
||||
git checkout -b base_commit $MERGE_BASE
|
||||
echo "base commit"
|
||||
git rev-list --format=%s --max-count=1 base_commit
|
||||
# Keep the old checker source at the merge base, but use this PR's
|
||||
# dependency and bundler metadata so the old checkout can install and build.
|
||||
mapfile -t BASE_BUILD_FILES < <(
|
||||
git ls-tree -r --name-only "$GITHUB_SHA" |
|
||||
grep -E '^(package(-lock)?\.json|packages/[^/]+/package(-lock)?\.json|packages/[^/]+/rspack\.config\.js)$'
|
||||
)
|
||||
echo "Using build metadata for mypy_primer base:"
|
||||
printf '%s\n' "${BASE_BUILD_FILES[@]}"
|
||||
git checkout $GITHUB_SHA -- "${BASE_BUILD_FILES[@]}"
|
||||
printf 'legacy-peer-deps=true\n' > .npmrc
|
||||
git add .npmrc "${BASE_BUILD_FILES[@]}"
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
git commit -m "Configure build dependencies for mypy_primer base"
|
||||
echo "Prepared mypy_primer base_commit with generated package and rspack build metadata."
|
||||
|
||||
echo ''
|
||||
cd ..
|
||||
npm config set legacy-peer-deps true --location=user
|
||||
npm config get legacy-peer-deps
|
||||
# fail action if exit code isn't zero or one
|
||||
(
|
||||
mypy_primer \
|
||||
--repo pyright_to_test \
|
||||
--type-checker pyright \
|
||||
--new new_commit --old base_commit \
|
||||
--num-shards 8 --shard-index ${{ matrix.shard-index }} \
|
||||
--debug \
|
||||
--output concise \
|
||||
| tee diff_${{ matrix.shard-index }}.txt
|
||||
) || [ $? -eq 1 ]
|
||||
- name: Upload mypy_primer diff
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mypy_primer_diffs_${{ matrix.shard-index }}
|
||||
path: diff_${{ matrix.shard-index }}.txt
|
||||
- if: ${{ matrix.shard-index == 0 }}
|
||||
name: Save PR number
|
||||
run: |
|
||||
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
|
||||
- if: ${{ matrix.shard-index == 0 }}
|
||||
name: Upload PR number
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mypy_primer_diffs_pr_number
|
||||
path: pr_number.txt
|
||||
79
.github/workflows/mypy_primer_push.yaml
vendored
Normal file
79
.github/workflows/mypy_primer_push.yaml
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# This workflow runs mypy_primer, a tool that runs pyright on a variety
|
||||
# of open-source Python projects that are known to type check with pyright.
|
||||
# It builds pyright from the latest commit and the last release tag and
|
||||
# compares the output of both. It uploads the diffs as an artifact.
|
||||
name: Run mypy_primer on push
|
||||
|
||||
env:
|
||||
NODE_VERSION: '22.x' # Shipped with VS Code.
|
||||
|
||||
on:
|
||||
# Run on all pushes to main.
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'packages/pyright/**'
|
||||
- 'packages/pyright-internal/src/**'
|
||||
- 'packages/pyright-internal/typeshed-fallback/**'
|
||||
# Also run manually if requested.
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
mypy_primer:
|
||||
name: Run mypy_primer on push
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: pyright_to_test
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: 'pyright_to_test/**/package-lock.json'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install -U pip
|
||||
pip install git+https://github.com/hauntsaninja/mypy_primer.git
|
||||
- name: Run mypy_primer
|
||||
shell: bash
|
||||
env:
|
||||
# mypy_primer installs both the new and old commits. The old commit can contain
|
||||
# historical peer dependency conflicts that should not block primer comparisons.
|
||||
NPM_CONFIG_LEGACY_PEER_DEPS: 'true'
|
||||
run: |
|
||||
cd pyright_to_test
|
||||
echo "new commit"
|
||||
git rev-list --format=%s --max-count=1 $GITHUB_SHA
|
||||
|
||||
cd ..
|
||||
npm config set legacy-peer-deps true --location=user
|
||||
npm config get legacy-peer-deps
|
||||
# fail action if exit code isn't zero or one
|
||||
(
|
||||
mypy_primer \
|
||||
--repo pyright_to_test \
|
||||
--type-checker pyright \
|
||||
--new $GITHUB_SHA \
|
||||
--debug \
|
||||
--output concise \
|
||||
| tee diff.txt
|
||||
) || [ $? -eq 1 ]
|
||||
- name: Upload mypy_primer diff
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mypy_primer_diffs
|
||||
path: diff.txt
|
||||
166
.github/workflows/validation.yml
vendored
Normal file
166
.github/workflows/validation.yml
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
name: 'Validation'
|
||||
|
||||
env:
|
||||
NODE_VERSION: '22.x' # Shipped with VS Code.
|
||||
PYTHON_VERSION: 3.11
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
typecheck:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Typecheck
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- run: npx lerna exec --stream --no-bail -- "tsc --noEmit"
|
||||
|
||||
style:
|
||||
if: github.repository == 'microsoft/pyright'
|
||||
runs-on: ubuntu-latest
|
||||
name: Style
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- name: Check diff after npm install
|
||||
run: git diff --exit-code --name-only
|
||||
|
||||
- run: npm run check
|
||||
|
||||
test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
|
||||
name: Test ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: typecheck
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/npm-cache-dir
|
||||
|
||||
- run: npm run install:all
|
||||
|
||||
- name: npm test (pyright-internal)
|
||||
run: npm test
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
# Install python so we can create a VENV for tests
|
||||
- name: Use Python ${{env.PYTHON_VERSION}}
|
||||
uses: actions/setup-python@v5
|
||||
id: install_python
|
||||
with:
|
||||
python-version: ${{env.PYTHON_VERSION}}
|
||||
|
||||
- name: Create Venv
|
||||
run: |
|
||||
${{ steps.install_python.outputs.python-path }} -m venv .venv
|
||||
|
||||
- name: Activate and install pytest (linux)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
python -m pip install pytest
|
||||
python -c "import sys;print('python_venv_path=' + sys.executable)" >> $GITHUB_ENV
|
||||
|
||||
- name: Activate and install pytest (windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
.venv\scripts\activate
|
||||
python -m pip install pytest
|
||||
python -c "import sys;print('python_venv_path=' + sys.executable)" | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
|
||||
- name: Echo python_venv_path
|
||||
run: |
|
||||
echo python_venv_path=${{env.python_venv_path}}
|
||||
|
||||
- name: Run import tests with venv
|
||||
env:
|
||||
CI_IMPORT_TEST_VENVPATH: '../../'
|
||||
CI_IMPORT_TEST_VENV: '.venv'
|
||||
run: npm run test:imports
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
- name: Run import tests with pythonpath
|
||||
env:
|
||||
CI_IMPORT_TEST_PYTHONPATH: ${{env.python_venv_path}}
|
||||
run: npm run test:imports
|
||||
working-directory: packages/pyright-internal
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
needs: typecheck
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: ./.github/actions/choose-npm-install
|
||||
|
||||
- run: npm publish --dry-run
|
||||
working-directory: packages/pyright
|
||||
|
||||
- run: npm publish --dry-run
|
||||
working-directory: packages/pyright-typeserver
|
||||
|
||||
- run: npm run package
|
||||
working-directory: packages/vscode-pyright
|
||||
|
||||
required:
|
||||
runs-on: ubuntu-latest
|
||||
name: Required
|
||||
needs:
|
||||
- typecheck
|
||||
- style
|
||||
- test
|
||||
- build
|
||||
|
||||
steps:
|
||||
- run: echo All required jobs succeeded.
|
||||
140
.gitignore
vendored
Normal file
140
.gitignore
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Microbundle cache
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
*.vsix
|
||||
junit.xml
|
||||
|
||||
.webpack_cache/
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Potential venv
|
||||
.venv
|
||||
|
||||
# Agent files
|
||||
serena/
|
||||
.beads/
|
||||
AGENTS.md
|
||||
|
||||
# Generated benchmark output
|
||||
packages/pyright-internal/src/tests/benchmarks/.generated/
|
||||
|
||||
# perfCompare.py cached commit bundles
|
||||
/build/perfCompare/
|
||||
|
||||
8
.prettierignore
Normal file
8
.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
||||
**/package-lock.json
|
||||
**/dist/**
|
||||
**/out/**
|
||||
**/typeshed-fallback/**
|
||||
|
||||
*.json
|
||||
*.md
|
||||
**/.github/ISSUE_TEMPLATE/**
|
||||
15
.prettierrc
Normal file
15
.prettierrc
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"printWidth": 120,
|
||||
"endOfLine": "auto",
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.yml", "*.yaml"],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
16
.rpg/.gitignore
vendored
Normal file
16
.rpg/.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Local-only artifacts (encoder logs, intermediate cache).
|
||||
# The committed source-of-truth files are listed explicitly below.
|
||||
*.log
|
||||
cache/
|
||||
tmp/
|
||||
|
||||
# Local LLM credentials — never commit.
|
||||
llm-config.local.yaml
|
||||
|
||||
|
||||
# Allow the canonical graph + manifest + last-parsed sha.
|
||||
!rpg_encoder.json
|
||||
!rpg_encoder.json.gz
|
||||
!last_parsed_sha.txt
|
||||
!eval/
|
||||
!overrides.yml
|
||||
1
.rpg/last_parsed_sha.txt
Normal file
1
.rpg/last_parsed_sha.txt
Normal file
@@ -0,0 +1 @@
|
||||
784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
80947
.rpg/rpg_encoder.json
Normal file
80947
.rpg/rpg_encoder.json
Normal file
File diff suppressed because it is too large
Load Diff
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
136
.vscode/launch.json
vendored
Normal file
136
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Pyright CLI",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/packages/pyright/index.js",
|
||||
"preLaunchTask": "npm: build:cli:dev",
|
||||
"args": [
|
||||
"--verifytypes",
|
||||
"pandas.core.reshape.concat",
|
||||
],
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/packages/pyright/dist/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pyright CLI (pyright-internal)",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/packages/pyright-internal/debug.js",
|
||||
"args": [
|
||||
"--typeshedpath",
|
||||
"${workspaceRoot}/packages/pyright-internal/typeshed-fallback",
|
||||
"--version",
|
||||
],
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/packages/pyright-internal/out/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pyright tests",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--runInBand"
|
||||
],
|
||||
"cwd": "${workspaceRoot}/packages/pyright-internal",
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"program": "${workspaceFolder}/packages/pyright-internal/node_modules/jest/bin/jest"
|
||||
},
|
||||
{
|
||||
"name": "Pyright extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${workspaceRoot}/packages/vscode-pyright/dist/extension.js",
|
||||
"preLaunchTask": "npm: build:extension:dev",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-pyright",
|
||||
// The published extension is named "ms-pyright.pyright", but in debug mode it's "ms-pyright.vscode-pyright"
|
||||
// to allow the extension code to participate in the lerna monorepo. Make sure that the published extension
|
||||
// isn't enabled, otherwise both are loaded and conflict.
|
||||
"--disable-extension=ms-pyright.pyright"
|
||||
],
|
||||
"smartStep": true,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pyright extension (watch)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${workspaceRoot}/packages/vscode-pyright/dist/extension.js",
|
||||
"preLaunchTask": "Watch extension",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-pyright",
|
||||
// The published extension is named "ms-pyright.pyright", but in debug mode it's "ms-pyright.vscode-pyright"
|
||||
// to allow the extension code to participate in the lerna monorepo. Make sure that the published extension
|
||||
// isn't enabled, otherwise both are loaded and conflict.
|
||||
"--disable-extension=ms-pyright.pyright"
|
||||
],
|
||||
"smartStep": true,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pyright attach server",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 6600,
|
||||
"smartStep": true,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Pyright jest current file",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${fileBasenameNoExtension}",
|
||||
"--runInBand",
|
||||
"--detectOpenHandles",
|
||||
"--forceExit",
|
||||
"--testTimeout=180000"
|
||||
],
|
||||
"cwd": "${workspaceRoot}/packages/pyright-internal",
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"program": "${workspaceFolder}/packages/pyright-internal/node_modules/jest/bin/jest"
|
||||
},
|
||||
{
|
||||
"name": "Pyright jest selected test",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": ["${fileBasenameNoExtension}", "--runInBand", "-t", "${selectedText}", "--forceExit", "--testTimeout=180000"],
|
||||
"cwd": "${workspaceRoot}/packages/pyright-internal",
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"program": "${workspaceFolder}/packages/pyright-internal/node_modules/jest/bin/jest"
|
||||
},
|
||||
{
|
||||
"name": "Pyright fourslash current file",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"fourSlashRunner.test.ts",
|
||||
"-t ${fileBasenameNoExtension}",
|
||||
"--runInBand",
|
||||
],
|
||||
"cwd": "${workspaceRoot}/packages/pyright-internal",
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"program": "${workspaceFolder}/packages/pyright-internal/node_modules/jest/bin/jest"
|
||||
}
|
||||
]
|
||||
}
|
||||
16
.vscode/settings.json
vendored
Normal file
16
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"python.languageServer": "None",
|
||||
}
|
||||
79
.vscode/tasks.json
vendored
Normal file
79
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": false,
|
||||
"panel": "shared"
|
||||
},
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Watch extension",
|
||||
"type": "npm",
|
||||
"script": "watch:extension",
|
||||
"isBackground": true,
|
||||
// From vscode-tsl-problem-matcher.
|
||||
"problemMatcher": {
|
||||
"owner": "custom",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)",
|
||||
"severity": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
{
|
||||
"regexp": "\\s*TS(\\d+):\\s*(.*)$",
|
||||
"code": 1,
|
||||
"message": 2
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "PublicPath: .*?"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "webpack compiled in .*? ms"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Watch test server",
|
||||
"type": "npm",
|
||||
"script": "watch:testserver",
|
||||
"isBackground": true,
|
||||
// From vscode-tsl-problem-matcher.
|
||||
"problemMatcher": {
|
||||
"owner": "custom",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)",
|
||||
"severity": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
{
|
||||
"regexp": "\\s*TS(\\d+):\\s*(.*)$",
|
||||
"code": 1,
|
||||
"message": 2
|
||||
}
|
||||
],
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": {
|
||||
"regexp": "PublicPath: .*?"
|
||||
},
|
||||
"endsPattern": {
|
||||
"regexp": "webpack compiled in .*? ms"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
19
CONTRIBUTING.md
Normal file
19
CONTRIBUTING.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
||||
|
||||
If you are considering adding a new feature, it is recommended that you start by submitting an enhancement request so project maintainers can discuss, determine whether such an enhancement would be accepted, and provide input on the best way to implement the enhancement.
|
||||
|
||||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Measuring performance changes
|
||||
|
||||
To check whether a change affects type-checking performance, use `build/perfCompare.py`. It builds the production CLI bundle at each of two or more commits and times repeated runs over a fixed corpus, reporting robust paired deltas. Example:
|
||||
|
||||
```
|
||||
python build/perfCompare.py --metric cpu --num-runs 50 --corpus <path-to-python-project> main HEAD
|
||||
```
|
||||
|
||||
See the script's `--help` and module docstring for options and methodology.
|
||||
22
LICENSE.txt
Normal file
22
LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Pyright - A static type checker for the Python language
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
||||

|
||||
|
||||
# Static Type Checker for Python
|
||||
|
||||
Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.
|
||||
|
||||
Pyright includes both a [command-line tool](https://microsoft.github.io/pyright/#/command-line) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright).
|
||||
|
||||
|
||||
## Pyright Playground
|
||||
|
||||
Try Pyright in your browser using the [Pyright Playground](https://pyright-play.net/?code=MQAgKgFglgziMEMC2AHANgUxAEw0g9gHYwAuATgiRnBPgO4gDG%2BSBhIGZZ%2BZcjC7AEZZcVRlWzwSlKPzRoAniEFKUCslADmEEgDoAUPtwAzEAmzYAFAA8AXCGNp8lADQgF9x85IBKW-pBAkDIMEgBXMnZrEABqd0NQAAUEGBgoQk0zKTIQdNIBRiwUkBIILBgMZkJJBDJNMKQMQhJg6jC0Ejh0rLIw5qhGjmtClBIoIgNzKwBGNwAiOZ99IA).
|
||||
|
||||
|
||||
## Documentation
|
||||
|
||||
Refer to [the documentation](https://microsoft.github.io/pyright) for installation, configuration, and usage details.
|
||||
|
||||
|
||||
## Environment variables
|
||||
|
||||
If Pyright fails to create a temporary directory (for example in remote/server environments where the OS temp directory doesn't exist or isn't writable), you can override the temp directory root:
|
||||
|
||||
- `PYRIGHT_TMPDIR`: Absolute path to a directory that Pyright can use for temporary files/directories. Pyright will create it if needed.
|
||||
|
||||
Pyright otherwise relies on the platform temp directory (for example `TMPDIR`, `TMP`, `TEMP`, or the OS default).
|
||||
|
||||
|
||||
## Community
|
||||
Do you have questions about Pyright or Python type annotations in general? Post your questions in [the discussion section](https://github.com/microsoft/pyright/discussions).
|
||||
|
||||
If you would like to report a bug or request an enhancement, file a new issue in either the [pyright](https://github.com/microsoft/pyright/issues) or [pylance-release](https://github.com/microsoft/pylance-release/issues) issue tracker. In general, core type checking functionality is associated with Pyright while language service functionality is associated with Pylance, but the same contributors monitor both repos. For best results, provide the information requested in the issue template.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. For feature and complex bug fix contributions, it is recommended that you first discuss the proposed change with Pyright’s maintainers before submitting the pull request. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
||||
|
||||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
41
SECURITY.md
Normal file
41
SECURITY.md
Normal file
@@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
||||
6
architecture/generated/.pages
Normal file
6
architecture/generated/.pages
Normal file
@@ -0,0 +1,6 @@
|
||||
title: Generated
|
||||
nav:
|
||||
- Pyright Engineering Map: pyright-engineering-map.md
|
||||
- Semantic feature graph: feature-map.md
|
||||
- Files by analyzer area: subsystems
|
||||
- ... | README.md
|
||||
18
architecture/generated/README.md
Normal file
18
architecture/generated/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Generated content
|
||||
|
||||
Every file in this directory is regenerated by
|
||||
the pyrx RPG docs pipeline on every refresh.
|
||||
|
||||
**Do not edit any file here by hand.** `validate_rpg_docs.py` fails CI
|
||||
if a file's hash drifts from `doc-manifest.json`.
|
||||
|
||||
Start with the developer map when you know the behavior or protocol request
|
||||
but not the owning files: [Pyright Engineering Map](pyright-engineering-map.md).
|
||||
|
||||
Regenerate this root through the scheduled RPG graph refresh workflow.
|
||||
112
architecture/generated/doc-manifest.json
Normal file
112
architecture/generated/doc-manifest.json
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"graph_path": "packages/pyright/.rpg/rpg_encoder.json",
|
||||
"graph_repo_sha": "784698179a5627072df39bbe0fcadb55bb7dd408",
|
||||
"graph_generated_at": "2026-06-10T00:19:36.841Z",
|
||||
"renderer_version": 1,
|
||||
"files": [
|
||||
{
|
||||
"path": ".pages",
|
||||
"sha256": "c0537b4f54b0131b658628dcd74c13f3fe9386f8f3f9e17d2fef17868f7775ad"
|
||||
},
|
||||
{
|
||||
"path": "README.md",
|
||||
"sha256": "ffa9ff493bfa33e6e131257f0bd048cf61dc218e8d3df5f2f09ab0dff40e0106"
|
||||
},
|
||||
{
|
||||
"path": "feature-map.md",
|
||||
"sha256": "19135790a9c00c2ae5e1f9ad827435b079ca5d8cb66b317ada91aa709b293588"
|
||||
},
|
||||
{
|
||||
"path": "features/.pages",
|
||||
"sha256": "3fcee5050993206e91df815e4927033cecee1205e6defa8835e45670993cad20"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-cli-and-vs-code-extension.md",
|
||||
"sha256": "a92363dda288954eeabe8e41c4cc502b82d223b212dd6aa2bf8750b243d6ba85"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-constraint-solving-and-type-variables.md",
|
||||
"sha256": "8dc28dc76d39923ef77d0a645028221a2ce1a98a61af65324d7a7dec96d1c7b1"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-diagnostics-and-configuration.md",
|
||||
"sha256": "7e8f871112d2bb6902d9dfb14e99dd21371705bc7a2b0351df131e62771cd1b7"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-documentation-and-comments.md",
|
||||
"sha256": "f48c9a59ba90934b000c87ea8935e88725aa0c87b5bcc56621463b777f99bedd"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-flow-narrowing-and-type-guards.md",
|
||||
"sha256": "d9a000e6a05b2e13e083b69daea457063ca1a073b3420e252364014164dde4fd"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-import-resolution-and-packaging.md",
|
||||
"sha256": "9d04fee47761bacc9add2271c2858a8fa7afd25e35bd5ba096b64a104928abe0"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-language-service-providers.md",
|
||||
"sha256": "ffb36c2f19f41d8a41490366ffaca9e4b05b6cafbd713f1cbb9a3b437234cac6"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-parser-binder-and-symbols.md",
|
||||
"sha256": "80c6960fd9acd6cfe642919ae5d8faa590abb7a862afed2333f2e312bafb1ba1"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-program-analysis-and-scheduling.md",
|
||||
"sha256": "aa5b896b214967b54452a425d3a1df5859b6540d6d8cc4bb7bf9ed33f16ab763"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-shared-runtime-infrastructure.md",
|
||||
"sha256": "bb19b544e3bbd8752fa54b48214c74574b633fc4c1e02f8e9db6eaea2ff6c764"
|
||||
},
|
||||
{
|
||||
"path": "features/feat-type-evaluation.md",
|
||||
"sha256": "2f9c04cf04d34be2a6e1e97efe063414dc3cfcdf3fbc73b9b8d69b50cba4b14d"
|
||||
},
|
||||
{
|
||||
"path": "pyright-engineering-map.md",
|
||||
"sha256": "b2d0e52d1f779e4da7fd97e8fdc3ad748733fcf281370d904acec59ce22341a7"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/.pages",
|
||||
"sha256": "1446864c9b25f8403c7a04a5c3d918698c547496aa3eb3c5e1a9bdc7417e3843"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/analyzer.md",
|
||||
"sha256": "4e6cc4053515929f675e61b335c34674ebc44788b4116a3964da717e8308719f"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/commands.md",
|
||||
"sha256": "c67599e54c00d030219f3ad712f760f5e6fae1e631447abc28469f118379e18b"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/common.md",
|
||||
"sha256": "784c5bf8f57022aabc514036b927519106b0384a7206de9c988638aceb0b8f8c"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/languageservice.md",
|
||||
"sha256": "863a82c5c3772a0a7e14694ed87d3b712f96f4a30186220a896606981881e889"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/localization.md",
|
||||
"sha256": "cd1710ee91d762f8181bc22988500e016319f2dae061202d11ec9d19cb972ef7"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/parser.md",
|
||||
"sha256": "549bc6705be50b68460336c05e81d16eaf523063013f46d96a609d7451687616"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/pprof.md",
|
||||
"sha256": "f3fd0fbcde370db1e5d37471d735932f475765b0558a96e63e77a6f4b3f6dc29"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/src.md",
|
||||
"sha256": "8db9c336049d24c0062c9c33c5d94d5ec65a2e0a6793461c60da43cbd66a8c95"
|
||||
},
|
||||
{
|
||||
"path": "subsystems/uri.md",
|
||||
"sha256": "c57e8b453cc83f377018021ac91d5c97dba6e1ce16f0e9692f06aba4f1d213b2"
|
||||
}
|
||||
]
|
||||
}
|
||||
37
architecture/generated/feature-map.md
Normal file
37
architecture/generated/feature-map.md
Normal file
@@ -0,0 +1,37 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Pyright Whole Repo Semantic Feature Graph
|
||||
|
||||
Whole-repo Pyright graph covering everything under the vendored packages/pyright subrepo.
|
||||
|
||||
## Graph provenance
|
||||
|
||||
- **Profile:** `pyright-whole-repo`
|
||||
- **Graph:** `../../.rpg/rpg_encoder.json`
|
||||
- **Source commit:** `784698179a5627072df39bbe0fcadb55bb7dd408`
|
||||
- **Generated:** `2026-06-10T00:19:36.841Z`
|
||||
- **Hierarchy:** `semantic clustering`
|
||||
- **Coverage:** 202 files, 3241 symbols, 12 feature nodes
|
||||
|
||||
## Find a starting point
|
||||
|
||||
- Use the site search for a specific symbol, file, or narrower capability.
|
||||
- Browse the outline below when you know the analyzer concept but not the owning files.
|
||||
|
||||
## Semantic areas
|
||||
|
||||
- [CLI and VS Code Extension](features/feat-cli-and-vs-code-extension.md)
|
||||
- [Constraint Solving and Type Variables](features/feat-constraint-solving-and-type-variables.md)
|
||||
- [Diagnostics and Configuration](features/feat-diagnostics-and-configuration.md)
|
||||
- [Documentation and Comments](features/feat-documentation-and-comments.md)
|
||||
- [Flow Narrowing and Type Guards](features/feat-flow-narrowing-and-type-guards.md)
|
||||
- [Import Resolution and Packaging](features/feat-import-resolution-and-packaging.md)
|
||||
- [Language Service Providers](features/feat-language-service-providers.md)
|
||||
- [Parser, Binder, and Symbols](features/feat-parser-binder-and-symbols.md)
|
||||
- [Program Analysis and Scheduling](features/feat-program-analysis-and-scheduling.md)
|
||||
- [Shared Runtime Infrastructure](features/feat-shared-runtime-infrastructure.md)
|
||||
- [Type Evaluation](features/feat-type-evaluation.md)
|
||||
24
architecture/generated/features/.pages
Normal file
24
architecture/generated/features/.pages
Normal file
@@ -0,0 +1,24 @@
|
||||
title: Semantic graph nodes
|
||||
nav:
|
||||
- CLI and VS Code Extension:
|
||||
- Overview: feat-cli-and-vs-code-extension.md
|
||||
- Constraint Solving and Type Variables:
|
||||
- Overview: feat-constraint-solving-and-type-variables.md
|
||||
- Diagnostics and Configuration:
|
||||
- Overview: feat-diagnostics-and-configuration.md
|
||||
- Documentation and Comments:
|
||||
- Overview: feat-documentation-and-comments.md
|
||||
- Flow Narrowing and Type Guards:
|
||||
- Overview: feat-flow-narrowing-and-type-guards.md
|
||||
- Import Resolution and Packaging:
|
||||
- Overview: feat-import-resolution-and-packaging.md
|
||||
- Language Service Providers:
|
||||
- Overview: feat-language-service-providers.md
|
||||
- Parser, Binder, and Symbols:
|
||||
- Overview: feat-parser-binder-and-symbols.md
|
||||
- Program Analysis and Scheduling:
|
||||
- Overview: feat-program-analysis-and-scheduling.md
|
||||
- Shared Runtime Infrastructure:
|
||||
- Overview: feat-shared-runtime-infrastructure.md
|
||||
- Type Evaluation:
|
||||
- Overview: feat-type-evaluation.md
|
||||
@@ -0,0 +1,141 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# CLI and VS Code Extension
|
||||
|
||||
**Feature path:** `CLI and VS Code Extension`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 11
|
||||
- **Symbols:** 78
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/nodeMain.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeMain.ts#L1-L23) | Entrypoint that starts the Pyright Node server and its background analysis runner |
|
||||
| [packages/pyright/packages/pyright-internal/src/nodeServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeServer.ts#L1-L29) | Starts and configures the Pyright language server in Node, initializing deps and handling main vs worker threads |
|
||||
| [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1-L1400) | Command-line entry point for the Pyright type checker, handling CLI args, diagnostics, and running analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L1-L50) | FileSystem wrapper that remaps URIs and delegates mutable file operations to an underlying real filesystem |
|
||||
| [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L1-L333) | Implements the Pyright language server, handling workspace settings, background analysis, commands, and code actions |
|
||||
| [packages/pyright/packages/pyright-internal/src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts#L1-L457) | Manages creation, initialization, and lifecycle of language server workspaces for the Pyright analyzer |
|
||||
| [packages/pyright/packages/pyright/src/langserver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright/src/langserver.ts#L1-L5) | Starts the Pyright command-line entrypoint with zero worker threads |
|
||||
| [packages/pyright/packages/pyright/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright/src/pyright.ts#L1-L4) | Starts the Pyright CLI |
|
||||
| [packages/pyright/packages/vscode-pyright/src/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/cancellationUtils.ts#L1-L99) | Provides a file-based cancellation strategy for the language server protocol |
|
||||
| [packages/pyright/packages/vscode-pyright/src/extension.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/extension.ts#L1-L407) | Registers and manages the Pyright language server client and related VS Code commands and configuration |
|
||||
| [packages/pyright/packages/vscode-pyright/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/server.ts#L1-L7) | Starts the Pyright VS Code language server with one background worker |
|
||||
|
||||
### Symbol preview (40 of 78)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `main` | function | [packages/pyright/packages/pyright-internal/src/nodeMain.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeMain.ts#L14-L22) |
|
||||
| `run` | function | [packages/pyright/packages/pyright-internal/src/nodeServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeServer.ts#L16-L24) |
|
||||
| `getConnectionOptions` | function | [packages/pyright/packages/pyright-internal/src/nodeServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeServer.ts#L26-L28) |
|
||||
| `processArgs` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L150-L452) |
|
||||
| `runSingleThreaded` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L454-L571) |
|
||||
| `runMultiThreaded` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L573-L777) |
|
||||
| `runWorkerMessageLoop` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L781-L871) |
|
||||
| `verifyPackageTypes` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L873-L909) |
|
||||
| `accumulateReportDiagnosticStats` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L911-L919) |
|
||||
| `buildTypeCompletenessReport` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L921-L1043) |
|
||||
| `printTypeCompletenessReportText` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1045-L1147) |
|
||||
| `printUsage` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1149-L1177) |
|
||||
| `getVersionString` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1179-L1183) |
|
||||
| `printVersion` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1185-L1187) |
|
||||
| `reportDiagnosticsAsJson` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1189-L1237) |
|
||||
| `isDiagnosticIncluded` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1239-L1252) |
|
||||
| `convertDiagnosticCategoryToSeverity` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1254-L1268) |
|
||||
| `convertDiagnosticToJson` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1270-L1278) |
|
||||
| `reportDiagnosticsAsText` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1280-L1329) |
|
||||
| `logDiagnosticToConsole` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1331-L1364) |
|
||||
| `parseThreadsArgValue` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1366-L1377) |
|
||||
| `main` | function | [packages/pyright/packages/pyright-internal/src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1383-L1399) |
|
||||
| `PyrightFileSystem` | class | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L17-L49) |
|
||||
| `PyrightFileSystem.mkdirSync` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L22-L24) |
|
||||
| `PyrightFileSystem.chdir` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L26-L28) |
|
||||
| `PyrightFileSystem.writeFileSync` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L30-L32) |
|
||||
| `PyrightFileSystem.rmdirSync` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L34-L36) |
|
||||
| `PyrightFileSystem.unlinkSync` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L38-L40) |
|
||||
| `PyrightFileSystem.createWriteStream` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L42-L44) |
|
||||
| `PyrightFileSystem.copyFileSync` | method | [packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L46-L48) |
|
||||
| `PyrightServer` | class | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L49-L332) |
|
||||
| `PyrightServer.getSettings` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L95-L224) |
|
||||
| `PyrightServer.createBackgroundAnalysis` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L226-L234) |
|
||||
| `PyrightServer.createHost` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L236-L238) |
|
||||
| `PyrightServer.createImportResolver` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L240-L252) |
|
||||
| `PyrightServer.executeCommand` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L254-L256) |
|
||||
| `PyrightServer.isLongRunningCommand` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L258-L260) |
|
||||
| `PyrightServer.isRefactoringCommand` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L262-L264) |
|
||||
| `PyrightServer.executeCodeAction` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L266-L275) |
|
||||
| `PyrightServer.createProgressReporter` | method | [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L277-L323) |
|
||||
| _38 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commandController.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/asyncInitialization.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/chokidarFileWatcherProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/deferred.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/progressReporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/streamUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/timing.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/partialStubService.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts`
|
||||
@@ -0,0 +1,98 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Constraint Solving and Type Variables
|
||||
|
||||
**Feature path:** `Constraint Solving and Type Variables`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 3
|
||||
- **Symbols:** 57
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L1-L90) | Holds mappings from type variables to resolved types and manages multiple constraint solution sets |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1-L1450) | Solves TypeVar, TypeVarTuple, and ParamSpec constraints to infer concrete types based on collected constraints |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L1-L288) | Tracks and manages constraint sets and bounds for type variables used by the constraint solver |
|
||||
|
||||
### Symbol preview (40 of 57)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `ConstraintSolutionSet` | class | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L15-L51) |
|
||||
| `ConstraintSolutionSet.isEmpty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L23-L25) |
|
||||
| `ConstraintSolutionSet.getType` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L29-L32) |
|
||||
| `ConstraintSolutionSet.setType` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L34-L37) |
|
||||
| `ConstraintSolutionSet.hasType` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L39-L42) |
|
||||
| `ConstraintSolutionSet.doForEachTypeVar` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L44-L50) |
|
||||
| `ConstraintSolution` | class | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L53-L89) |
|
||||
| `ConstraintSolution.isEmpty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L61-L63) |
|
||||
| `ConstraintSolution.setType` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L65-L69) |
|
||||
| `ConstraintSolution.getMainSolutionSet` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L71-L73) |
|
||||
| `ConstraintSolution.getSolutionSets` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L75-L77) |
|
||||
| `ConstraintSolution.doForEachSolutionSet` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L79-L83) |
|
||||
| `ConstraintSolution.getSolutionSet` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L85-L88) |
|
||||
| `assignTypeVar` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L90-L215) |
|
||||
| `solveConstraints` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L218-L231) |
|
||||
| `applySourceSolutionToConstraints` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L234-L249) |
|
||||
| `solveConstraintSet` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L251-L264) |
|
||||
| `solveTypeVarRecursive` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L266-L327) |
|
||||
| `addConstraintsForExpectedType` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L335-L512) |
|
||||
| `stripLiteralsForLowerBound` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L514-L518) |
|
||||
| `getTypeVarType` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L520-L574) |
|
||||
| `assignBoundTypeVar` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L579-L618) |
|
||||
| `assignUnconstrainedTypeVar` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L622-L1005) |
|
||||
| `assignConstrainedTypeVar` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1008-L1198) |
|
||||
| `assignParamSpec` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1201-L1309) |
|
||||
| `typeVarOccursIn` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1317-L1342) |
|
||||
| `widenTypeForTypeVarTuple` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1347-L1375) |
|
||||
| `stripLiteralValueForUnpackedTuple` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1379-L1404) |
|
||||
| `logConstraints` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1408-L1420) |
|
||||
| `logTypeVarConstraintSet` | function | [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1422-L1449) |
|
||||
| `ConstraintSet` | class | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L40-L183) |
|
||||
| `ConstraintSet.clone` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L57-L69) |
|
||||
| `ConstraintSet.isSame` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L71-L97) |
|
||||
| `ConstraintSet.isEmpty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L99-L101) |
|
||||
| `ConstraintSet.getScore` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L105-L123) |
|
||||
| `ConstraintSet.setBounds` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L125-L133) |
|
||||
| `ConstraintSet.doForEachTypeVar` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L135-L137) |
|
||||
| `ConstraintSet.getTypeVar` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L139-L142) |
|
||||
| `ConstraintSet.getTypeVars` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L144-L152) |
|
||||
| `ConstraintSet.addScopeId` | method | [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L154-L160) |
|
||||
| _17 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/properties.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeComplexity.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
@@ -0,0 +1,170 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Diagnostics and Configuration
|
||||
|
||||
**Feature path:** `Diagnostics and Configuration`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 15
|
||||
- **Symbols:** 117
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts#L1-L316) | Maps implicitly deprecated typing and collection symbols to the Python version and suggested replacement |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L1-L74) | Dispatches language-server commands to their specific handlers and indicates long-running/refactoring commands |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/commandResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandResult.ts#L1-L22) | Defines CommandResult interface representing command output with label, edits, optional data, and a type guard |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/commands.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commands.ts#L1-L22) | Exports an enum of Pyright command identifier strings used by the extension |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L1-L119) | Creates a language-server command to generate Python type stubs for a specified import and notify the user |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L1-L121) | Dumps tokens, syntax nodes, type info (including cached) and code-flow graph for a given file |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts#L1-L39) | Handles quick action commands for the language server and returns corresponding workspace edits |
|
||||
| [packages/pyright/packages/pyright-internal/src/commands/restartServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/restartServer.ts#L1-L21) | Provides a command to restart the language server |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L1-L182) | Defines command-line and language-server configuration option types for Pyright including config and server settings |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/commandUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandUtils.ts#L1-L22) | Helpers to create LSP Command objects with URI arguments converted to string form |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L1-L1799) | Defines ExecutionEnvironment and ConfigOptions along with helpers for diagnostic rule sets and file-spec matching |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts#L1-L341) | Defines Diagnostic types, serialization, comparison, and addendum helpers for building and formatting diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts#L1-L107) | Enumerates string identifiers for configurable diagnostic rules used by the type checker |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts#L1-L202) | Collects and deduplicates file diagnostics and provides a TextRange-aware sink that converts offsets to position ranges |
|
||||
| [packages/pyright/packages/pyright-internal/src/localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts#L1-L1704) | Localization utilities and parameterized string formatting for retrieving locale-specific message strings |
|
||||
|
||||
### Symbol preview (40 of 117)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `CommandController` | class | [packages/pyright/packages/pyright-internal/src/commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L22-L73) |
|
||||
| `CommandController.execute` | method | [packages/pyright/packages/pyright-internal/src/commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L35-L57) |
|
||||
| `CommandController.isLongRunningCommand` | method | [packages/pyright/packages/pyright-internal/src/commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L59-L68) |
|
||||
| `CommandController.isRefactoringCommand` | method | [packages/pyright/packages/pyright-internal/src/commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L70-L72) |
|
||||
| `BaseCreateTypeStubCommand` | class | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L19-L99) |
|
||||
| `BaseCreateTypeStubCommand.createTypeStub` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L24-L58) |
|
||||
| `BaseCreateTypeStubCommand.getCloneOptions` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L60-L65) |
|
||||
| `BaseCreateTypeStubCommand.onTypeStubCreated` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L67-L69) |
|
||||
| `BaseCreateTypeStubCommand.writeTypeStub` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L71-L86) |
|
||||
| `BaseCreateTypeStubCommand.getSuccessMessage` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L88-L90) |
|
||||
| `BaseCreateTypeStubCommand.getCancellationMessage` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L92-L94) |
|
||||
| `BaseCreateTypeStubCommand.getErrorPrefix` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L96-L98) |
|
||||
| `CreateTypeStubCommand` | class | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L101-L118) |
|
||||
| `CreateTypeStubCommand.execute` | method | [packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L106-L117) |
|
||||
| `DumpFileDebugInfoCommand` | class | [packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L19-L34) |
|
||||
| `DumpFileDebugInfoCommand.execute` | method | [packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L22-L33) |
|
||||
| `DumpFileDebugInfo` | class | [packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L36-L120) |
|
||||
| `DumpFileDebugInfo.dump` | method | [packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L37-L119) |
|
||||
| `QuickActionCommand` | class | [packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts#L18-L38) |
|
||||
| `QuickActionCommand.execute` | method | [packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts#L21-L37) |
|
||||
| `RestartServerCommand` | class | [packages/pyright/packages/pyright-internal/src/commands/restartServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/restartServer.ts#L14-L20) |
|
||||
| `RestartServerCommand.execute` | method | [packages/pyright/packages/pyright-internal/src/commands/restartServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/restartServer.ts#L17-L19) |
|
||||
| `getDiagnosticSeverityOverrides` | function | [packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L23-L30) |
|
||||
| `CommandLineConfigOptions` | class | [packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L37-L106) |
|
||||
| `CommandLineLanguageServerOptions` | class | [packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L109-L152) |
|
||||
| `CommandLineOptions` | class | [packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L158-L181) |
|
||||
| `createCommand` | function | [packages/pyright/packages/pyright-internal/src/common/commandUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandUtils.ts#L12-L21) |
|
||||
| `ExecutionEnvironment` | class | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L42-L86) |
|
||||
| `cloneDiagnosticRuleSet` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L403-L406) |
|
||||
| `getBooleanDiagnosticRules` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L410-L431) |
|
||||
| `getDiagLevelDiagnosticRules` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L435-L519) |
|
||||
| `getStrictModeNotOverriddenRules` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L521-L525) |
|
||||
| `getOffDiagnosticRuleSet` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L527-L628) |
|
||||
| `getBasicDiagnosticRuleSet` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L630-L731) |
|
||||
| `getStandardDiagnosticRuleSet` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L733-L834) |
|
||||
| `getStrictDiagnosticRuleSet` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L836-L937) |
|
||||
| `matchFileSpecs` | function | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L939-L947) |
|
||||
| `ConfigOptions` | class | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L951-L1777) |
|
||||
| `ConfigOptions.getDiagnosticRuleSet` | method | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L1091-L1105) |
|
||||
| `ConfigOptions.getDefaultExecEnvironment` | method | [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L1107-L1117) |
|
||||
| _77 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/operations.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/properties.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/partialStubService.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/pyright.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/server.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathConsts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/stringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/workspaceFactory.ts`
|
||||
@@ -0,0 +1,90 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Documentation and Comments
|
||||
|
||||
**Feature path:** `Documentation and Comments`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 3
|
||||
- **Symbols:** 58
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L1-L318) | Parses pyright-specific comments to adjust diagnostic rule settings and collect comment diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L1-L873) | Converts Python docstrings into Markdown or cleaned plaintext for documentation and display |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/docStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringUtils.ts#L1-L153) | Parses Python docstrings and extracts parameter and attribute docs in Epytext, reST, and Google styles |
|
||||
|
||||
### Symbol preview (40 of 58)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `getFileLevelDirectives` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L40-L77) |
|
||||
| `_applyStrictRules` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L79-L81) |
|
||||
| `_applyStandardRules` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L83-L85) |
|
||||
| `_applyBasicRules` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L87-L89) |
|
||||
| `_overrideRules` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L91-L127) |
|
||||
| `_overwriteRules` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L129-L140) |
|
||||
| `_parsePyrightComment` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L142-L195) |
|
||||
| `_parsePyrightOperand` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L197-L264) |
|
||||
| `_parseDiagLevel` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L266-L285) |
|
||||
| `_parseBoolSetting` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L287-L295) |
|
||||
| `_trimTextWithRange` | function | [packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L299-L317) |
|
||||
| `convertDocStringToMarkdown` | function | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L22-L24) |
|
||||
| `convertDocStringToPlainText` | function | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L29-L43) |
|
||||
| `DocStringConverter` | class | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L111-L860) |
|
||||
| `DocStringConverter.convert` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L135-L167) |
|
||||
| `DocStringConverter._eatLine` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L169-L171) |
|
||||
| `DocStringConverter._currentLineOrUndefined` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L173-L175) |
|
||||
| `DocStringConverter._currentLine` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L177-L179) |
|
||||
| `DocStringConverter._currentIndent` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L181-L183) |
|
||||
| `DocStringConverter._prevIndent` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L185-L187) |
|
||||
| `DocStringConverter._lineAt` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L189-L191) |
|
||||
| `DocStringConverter._nextBlockIndent` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L193-L197) |
|
||||
| `DocStringConverter._currentLineIsOutsideBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L199-L201) |
|
||||
| `DocStringConverter._currentLineWithinBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L203-L205) |
|
||||
| `DocStringConverter._pushAndSetState` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L207-L214) |
|
||||
| `DocStringConverter._popState` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L216-L223) |
|
||||
| `DocStringConverter._parseText` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L225-L263) |
|
||||
| `DocStringConverter._formatPlainTextIndent` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L265-L295) |
|
||||
| `DocStringConverter._convertIndent` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L297-L300) |
|
||||
| `DocStringConverter._escapeHtml` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L302-L308) |
|
||||
| `DocStringConverter._appendTextLine` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L310-L398) |
|
||||
| `DocStringConverter._preprocessTextLine` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L400-L410) |
|
||||
| `DocStringConverter._parseEmpty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L412-L420) |
|
||||
| `DocStringConverter._beginMinIndentCodeBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L422-L426) |
|
||||
| `DocStringConverter._beginBacktickBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L428-L442) |
|
||||
| `DocStringConverter._parseBacktickBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L444-L457) |
|
||||
| `DocStringConverter._beginDocTest` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L459-L468) |
|
||||
| `DocStringConverter._parseDocTest` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L470-L480) |
|
||||
| `DocStringConverter._beginLiteralBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L482-L520) |
|
||||
| `DocStringConverter._parseLiteralBlock` | method | [packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L522-L540) |
|
||||
| _18 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/docStringService.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
@@ -0,0 +1,116 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Flow Narrowing and Type Guards
|
||||
|
||||
**Feature path:** `Flow Narrowing and Type Guards`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 6
|
||||
- **Symbols:** 67
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts#L1-L2061) | Determines narrowed types for variables and expressions and computes statement reachability via the code flow graph |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L1-L286) | Types and helpers for tracking code-flow nodes and reference keys used in Pyright's code flow analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts#L1-L446) | Generates an ASCII diagram of a control flow graph from FlowNode structures |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1-L2254) | Type evaluation and narrowing utilities for Python structural pattern matching (PEP 634) in Pyright |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L1-L377) | Evaluates parse-node expressions to determine static boolean, version, and platform string outcomes |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L1-L2814) | Narrow types based on conditional expressions, isinstance checks, and user-defined type guards |
|
||||
|
||||
### Symbol preview (40 of 67)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `isIncompleteType` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts#L162-L164) |
|
||||
| `getCodeFlowEngine` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts#L201-L2060) |
|
||||
| `getUniqueFlowNodeId` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L61-L63) |
|
||||
| `isCodeFlowSupportedForReference` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L170-L221) |
|
||||
| `createKeyForReference` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L223-L256) |
|
||||
| `createKeysForReferenceSubexpressions` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L258-L282) |
|
||||
| `formatControlFlowGraph` | function | [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts#L28-L445) |
|
||||
| `narrowTypeBasedOnPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L137-L177) |
|
||||
| `checkForUnusedPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L181-L207) |
|
||||
| `narrowTypeBasedOnSequencePattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L209-L422) |
|
||||
| `narrowTypeBasedOnAsPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L424-L450) |
|
||||
| `narrowTypeBasedOnMappingPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L452-L637) |
|
||||
| `getPositionalMatchArgNames` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L641-L666) |
|
||||
| `narrowTypeBasedOnLiteralPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L668-L744) |
|
||||
| `narrowTypeBasedOnClassPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L746-L1067) |
|
||||
| `isClassSpecialCaseForClassPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1071-L1090) |
|
||||
| `narrowTypeOfClassPatternArg` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1093-L1171) |
|
||||
| `narrowTypeBasedOnValuePattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1173-L1270) |
|
||||
| `getMappingPatternInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1274-L1354) |
|
||||
| `getSequencePatternInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1359-L1681) |
|
||||
| `getTypeOfPatternSequenceEntry` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1683-L1738) |
|
||||
| `assignTypeToPatternTargets` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1742-L1981) |
|
||||
| `wrapTypeInList` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1983-L1998) |
|
||||
| `validateClassPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L2000-L2082) |
|
||||
| `getPatternSubtypeNarrowingCallback` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L2087-L2235) |
|
||||
| `reportUnnecessaryPattern` | function | [packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L2237-L2253) |
|
||||
| `evaluateStaticBoolExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L18-L174) |
|
||||
| `evaluateStaticBoolLikeExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L179-L193) |
|
||||
| `_convertTupleToVersion` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L195-L251) |
|
||||
| `_evaluateVersionBinaryOperation` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L253-L285) |
|
||||
| `_evaluateStringBinaryOperation` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L287-L301) |
|
||||
| `_isSysVersionInfoExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L303-L313) |
|
||||
| `_isSysPlatformInfoExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L315-L325) |
|
||||
| `_isOsNameInfoExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L327-L339) |
|
||||
| `_getExpectedPlatformNameFromPlatform` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L341-L360) |
|
||||
| `_getExpectedOsNameFromPlatform` | function | [packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L362-L376) |
|
||||
| `getTypeNarrowingCallback` | function | [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L117-L861) |
|
||||
| `getTypeNarrowingCallbackForAliasedCondition` | function | [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L863-L927) |
|
||||
| `getDeclsForLocalVar` | function | [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L932-L980) |
|
||||
| `getTypeNarrowingCallbackForAssignmentExpression` | function | [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L982-L993) |
|
||||
| _27 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/enums.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/operations.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/enums.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
@@ -0,0 +1,165 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Import Resolution and Packaging
|
||||
|
||||
**Feature path:** `Import Resolution and Packaging`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 16
|
||||
- **Symbols:** 267
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts#L1-L21) | Provides a simple logger for collecting and retrieving import resolution messages |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1-L2576) | Resolves Python imports to filesystem modules, packages, typeshed and stub sources for static type analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts#L1-L203) | Cached file-system adapter for import resolution, exposing directory/file queries and resolvable name lookups |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts#L1-L62) | Type declarations for import resolver helpers including typeshed info provider and a minimal cached filesystem facade |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts#L1-L109) | Represents Python import resolution results with metadata, resolved URIs, and implicit import info |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts#L1-L1016) | Summarizes and manipulates Python import statements and generates edits for auto-imports and formatting |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts#L1-L113) | Defines types and a factory for package type verification reports, symbols, modules, and diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts#L1-L1582) | Validates public exports of a package to ensure exported types are complete and reports problems |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts#L1-L66) | Determines whether a py.typed file exists and if it marks the package as partially typed |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts#L1-L251) | Resolves Python interpreter and typeshed search paths, site-packages locations, and .pth-derived paths |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts#L1-L234) | Enumerates Python source files with include/exclude rules, tracking symlinked directories and auto-excluding virtualenvs |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts#L1-L1137) | Maps .pyi stub files to corresponding .py implementation files and provides binding utilities |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts#L1-L64) | Finds an import chain between two Uri nodes and returns the sequence of Uris |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts#L1-L925) | Emit Python .pyi type stub files from parsed and analyzed Python source files |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts#L1-L253) | Provides typeshed root/subdirectory lookup, third-party package mapping, and stdlib version info |
|
||||
| [packages/pyright/packages/pyright-internal/src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts#L1-L181) | Maps partially typed stub packages into corresponding installed library directories and provides a no-op alternative |
|
||||
|
||||
### Symbol preview (40 of 267)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `ImportLogger` | class | [packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts#L10-L20) |
|
||||
| `ImportLogger.log` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts#L13-L15) |
|
||||
| `ImportLogger.getLogs` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts#L17-L19) |
|
||||
| `createImportedModuleDescriptor` | function | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L59-L79) |
|
||||
| `ImportResolver` | class | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L94-L2480) |
|
||||
| `ImportResolver.isSupportedImportSourceFile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L131-L134) |
|
||||
| `ImportResolver.isSupportedImportFile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L136-L139) |
|
||||
| `ImportResolver.invalidateCache` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L141-L150) |
|
||||
| `ImportResolver.resolveImport` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L154-L162) |
|
||||
| `ImportResolver.getCompletionSuggestions` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L164-L194) |
|
||||
| `ImportResolver.getConfigOptions` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L196-L198) |
|
||||
| `ImportResolver.setConfigOptions` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L200-L203) |
|
||||
| `ImportResolver.getSourceFilesFromStub` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L206-L302) |
|
||||
| `ImportResolver.getModuleNameForImport` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L307-L323) |
|
||||
| `ImportResolver.getTypeshedStdLibPath` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L325-L332) |
|
||||
| `ImportResolver.getTypeshedThirdPartyPath` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L334-L336) |
|
||||
| `ImportResolver.isStdlibModule` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L338-L344) |
|
||||
| `ImportResolver.getImportRoots` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L346-L393) |
|
||||
| `ImportResolver.ensurePartialStubPackages` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L395-L427) |
|
||||
| `ImportResolver.getPythonSearchPaths` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L429-L442) |
|
||||
| `ImportResolver.getTypeshedStdlibExcludeList` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L444-L501) |
|
||||
| `ImportResolver.getTypeshedPathEx` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L505-L507) |
|
||||
| `ImportResolver.resolveImportInternal` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L511-L588) |
|
||||
| `ImportResolver.fileExistsCached` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L590-L592) |
|
||||
| `ImportResolver.dirExistsCached` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L594-L596) |
|
||||
| `ImportResolver.addResultsToCache` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L598-L615) |
|
||||
| `ImportResolver.resolveAbsoluteImport` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L619-L677) |
|
||||
| `ImportResolver.resolveImportEx` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L682-L691) |
|
||||
| `ImportResolver.resolveNativeImportEx` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L696-L702) |
|
||||
| `ImportResolver.getNativeModuleName` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L704-L710) |
|
||||
| `ImportResolver.filterImplicitImports` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L714-L746) |
|
||||
| `ImportResolver.findImplicitImports` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L748-L840) |
|
||||
| `ImportResolver._isPossibleImportDir` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L842-L862) |
|
||||
| `ImportResolver._resolveImportStrict` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L864-L988) |
|
||||
| `ImportResolver._getCompletionSuggestionsStrict` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L990-L1055) |
|
||||
| `ImportResolver._getModuleNameForImport` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1057-L1259) |
|
||||
| `ImportResolver._invalidateFileSystemCache` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1261-L1263) |
|
||||
| `ImportResolver._resolveAbsoluteImport` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1265-L1454) |
|
||||
| `ImportResolver._getImportCacheKey` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1456-L1458) |
|
||||
| `ImportResolver._lookUpResultsInCache` | method | [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1460-L1484) |
|
||||
| _227 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/pyright.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/server.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/editAction.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathConsts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/stringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
@@ -0,0 +1,180 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Language Service Providers
|
||||
|
||||
**Feature path:** `Language Service Providers`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 24
|
||||
- **Symbols:** 354
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L1-L1620) | Provides core language server functionality and LSP handlers for Pyright |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts#L1-L166) | Runs and clones AnalyzerService and builds command-line options from server settings |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts#L1-L859) | Provides auto-import completion logic and utilities for finding module symbols and generating import edits |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts#L1-L628) | Provides call hierarchy items (callers and callees) for a code position across the workspace |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts#L1-L78) | Provides quick-fix code actions for diagnostics, including a create-type-stub action |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts#L1-L3698) | Provides Python language completion items for a source position using type and symbol analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts#L1-L252) | Helper utilities for completion items: type details, formatted documentation, and trailing overlap detection |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts#L1-L348) | Maps positions to symbol and type declarations for go-to-definition and type-definition features |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts#L1-L76) | Provides document highlights for a name at a given position, classifying occurrences as read or write |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts#L1-L622) | Collects and resolves symbol declarations and references within a parse tree for document-level symbol occurrences |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts#L1-L147) | Provides document symbol extraction and conversion to hierarchical or flat LSP SymbolInformation for a source file |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts#L1-L75) | Manages dynamic LSP features with register/update/dispose logic and a registry for multiple features |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts#L1-L79) | Registers LSP file-watcher notifications for workspace config files and Python search paths |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts#L1-L682) | Generates editor hover tooltips for Python symbols with type info, signatures, and documentation |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts#L1-L197) | Sorts and formats top-level Python import statements and produces TextEditAction replacements |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts#L1-L33) | Provides helpers to check file navigability and convert DocumentRange objects to LSP Location values |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts#L1-L52) | Registers and manages pull-mode diagnostics and workspace support with the language server |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts#L1-L45) | Provides quick action handlers for source files such as ordering imports |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts#L1-L528) | Finds symbol references in files and returns DocumentRange/LSP locations |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts#L1-L204) | Provides rename support: checks rename eligibility and produces workspace edits for a symbol and its references |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts#L1-L488) | Provides signature help for Python call sites by mapping a cursor position to callable signatures and parameter info |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts#L1-L219) | Indexes all externally visible symbols and aliases in a source file into structured metadata |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts#L1-L846) | Formats and generates hover/completion tooltips and documentation text for types, functions, classes, and symbols |
|
||||
| [packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts#L1-L162) | Provides workspace symbol search for the language server across user code |
|
||||
|
||||
### Symbol preview (40 of 354)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `wrapProgressReporter` | function | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L145-L166) |
|
||||
| `LanguageServerBase` | class | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L168-L1619) |
|
||||
| `LanguageServerBase.dispose` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L277-L283) |
|
||||
| `LanguageServerBase.createBackgroundAnalysis` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L285) |
|
||||
| `LanguageServerBase.getSettings` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L287) |
|
||||
| `LanguageServerBase.createAnalyzerService` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L291-L334) |
|
||||
| `LanguageServerBase.getWorkspaces` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L336-L343) |
|
||||
| `LanguageServerBase.getWorkspaceForFile` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L345-L347) |
|
||||
| `LanguageServerBase.getContainingWorkspacesForFile` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L349-L351) |
|
||||
| `LanguageServerBase.reanalyze` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L353-L357) |
|
||||
| `LanguageServerBase.restart` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L359-L363) |
|
||||
| `LanguageServerBase.updateSettingsForAllWorkspaces` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L365-L379) |
|
||||
| `LanguageServerBase.updateSettingsForWorkspace` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L381-L414) |
|
||||
| `LanguageServerBase.updateOptionsAndRestartService` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L416-L423) |
|
||||
| `LanguageServerBase.executeCommand` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L428) |
|
||||
| `LanguageServerBase.isLongRunningCommand` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L430) |
|
||||
| `LanguageServerBase.isRefactoringCommand` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L431) |
|
||||
| `LanguageServerBase.executeCodeAction` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L433-L436) |
|
||||
| `LanguageServerBase.getConfiguration` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L438-L455) |
|
||||
| `LanguageServerBase.isOpenFilesOnly` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L457-L459) |
|
||||
| `LanguageServerBase.getSeverityOverrides` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L461-L471) |
|
||||
| `LanguageServerBase.getDiagnosticRuleName` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L473-L480) |
|
||||
| `LanguageServerBase.createHost` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L482) |
|
||||
| `LanguageServerBase.createImportResolver` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L483-L487) |
|
||||
| `LanguageServerBase.createBackgroundAnalysisProgram` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L489-L506) |
|
||||
| `LanguageServerBase.createWorkspaceFactory` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L508-L516) |
|
||||
| `LanguageServerBase.setupConnection` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L518-L572) |
|
||||
| `LanguageServerBase.initialize` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L574-L698) |
|
||||
| `LanguageServerBase.onInitialized` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L700-L705) |
|
||||
| `LanguageServerBase.handleInitialized` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L707-L719) |
|
||||
| `LanguageServerBase.onDidChangeConfiguration` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L721-L727) |
|
||||
| `LanguageServerBase.onDefinition` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L729-L742) |
|
||||
| `LanguageServerBase.onDeclaration` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L744-L757) |
|
||||
| `LanguageServerBase.onTypeDefinition` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L759-L768) |
|
||||
| `LanguageServerBase.getDefinitions` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L770-L798) |
|
||||
| `LanguageServerBase.onReferences` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L800-L845) |
|
||||
| `LanguageServerBase.onDocumentSymbol` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L847-L868) |
|
||||
| `LanguageServerBase.onWorkspaceSymbol` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L870-L883) |
|
||||
| `LanguageServerBase.onHover` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L885-L895) |
|
||||
| `LanguageServerBase.onDocumentHighlight` | method | [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L897-L907) |
|
||||
| _314 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/server.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/enums.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commandResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commands.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/docRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/docStringService.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/editAction.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/lspUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathConsts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/progressReporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/stringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/emptyUri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/workspaceFactory.ts`
|
||||
@@ -0,0 +1,186 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Parser, Binder, and Symbols
|
||||
|
||||
**Feature path:** `Parser, Binder, and Symbols`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 22
|
||||
- **Symbols:** 633
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L1-L234) | Stores and manages analysis metadata (scopes, declarations, control-flow, imports, and __all__) for parse nodes |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1-L4741) | Performs Python parse-tree name binding and creates scopes and symbol tables for static analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts#L1-L304) | Describes declaration kinds and interfaces that record symbol locations, nodes, and import/alias resolution metadata |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts#L1-L421) | Utilities for inspecting, comparing, and resolving declarations and alias references in the analyzer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/parseTreeCleaner.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeCleaner.ts#L1-L36) | Walks a Module parse tree and clears analyzer-specific analysis info from each parse node |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts#L1-L2748) | Utilities for traversing, querying, and printing Python parse tree nodes and their evaluation ranges |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts#L1-L936) | Traverses a Python parse tree and provides visitor/walker classes to visit and process parse nodes |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/scope.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scope.ts#L1-L268) | Models evaluation scopes and provides symbol table, binding info, and recursive lookup for Python analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts#L1-L97) | Utilities for locating and inspecting analysis scopes and scope hierarchies for parse tree nodes |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts#L1-L312) | Represents program symbols, tracking their flags, declarations, and synthesized type information |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts#L1-L51) | Classify Python symbol names (private, protected, dunder, constant, type alias, public constant/type alias) |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts#L1-L53) | Helpers for Symbol declaration queries, visibility checks, TypedDict index access, and class-var/final semantics |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts#L1-L123) | Validates parse-tree node parent/range invariants and evaluates NameNode types using a TypeEvaluator |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/characterStream.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characterStream.ts#L1-L167) | Provides a character stream for inspecting and advancing through text used by parsers and tokenizers |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/characters.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characters.ts#L1-L285) | Classifies Unicode characters and provides fast lookup helpers for identifier tokenization |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/parseNodeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodeUtils.ts#L1-L162) | Maps parse node and operator string names to their enum values and provides reverse lookup maps |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts#L1-L2864) | Parse node types, enums, and helper functions for representing and manipulating Python AST nodes |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts#L1-L5465) | Parses Python source tokens into an abstract syntax tree and reports diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts#L1-L384) | Unescapes escaped string tokens and returns the unescaped value, escape errors, and non-ASCII/bytes info |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts#L1-L2246) | Converts Python source into a stream of lexed tokens for parsing and analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts#L1-L619) | Defines enums, interfaces, and factory creators for Python tokenizer tokens and comments |
|
||||
| [packages/pyright/packages/pyright-internal/src/parser/unicode.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/unicode.ts#L1-L3649) | Unicode character range tables used by the Python language specification |
|
||||
|
||||
### Symbol preview (40 of 633)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `cleanNodeAnalysisInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L79-L112) |
|
||||
| `getImportInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L114-L117) |
|
||||
| `setImportInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L119-L122) |
|
||||
| `getScope` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L124-L127) |
|
||||
| `setScope` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L129-L132) |
|
||||
| `getDeclaration` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L134-L137) |
|
||||
| `setDeclaration` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L139-L142) |
|
||||
| `getFlowNode` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L144-L147) |
|
||||
| `setFlowNode` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L149-L152) |
|
||||
| `getAfterFlowNode` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L154-L157) |
|
||||
| `setAfterFlowNode` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L159-L162) |
|
||||
| `getFileInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L164-L170) |
|
||||
| `setFileInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L172-L175) |
|
||||
| `getCodeFlowExpressions` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L177-L180) |
|
||||
| `setCodeFlowExpressions` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L182-L185) |
|
||||
| `getCodeFlowComplexity` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L187-L190) |
|
||||
| `setCodeFlowComplexity` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L192-L195) |
|
||||
| `getDunderAllInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L197-L200) |
|
||||
| `setDunderAllInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L202-L205) |
|
||||
| `isCodeUnreachable` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L207-L221) |
|
||||
| `getAnalyzerInfo` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L223-L225) |
|
||||
| `getAnalyzerInfoForWrite` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L227-L233) |
|
||||
| `Binder` | class | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L173-L4658) |
|
||||
| `Binder.bindModule` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L291-L395) |
|
||||
| `Binder.visitModule` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L397-L402) |
|
||||
| `Binder.visitSuite` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L404-L407) |
|
||||
| `Binder.visitModuleName` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L409-L471) |
|
||||
| `Binder.visitClass` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L473-L529) |
|
||||
| `Binder.visitFunction` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L531-L661) |
|
||||
| `Binder.visitLambda` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L663-L720) |
|
||||
| `Binder.visitCall` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L722-L837) |
|
||||
| `Binder.visitTypeParameterList` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L839-L884) |
|
||||
| `Binder.visitTypeAlias` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L886-L923) |
|
||||
| `Binder.visitAssignment` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L925-L1092) |
|
||||
| `Binder.visitAssignmentExpression` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1094-L1136) |
|
||||
| `Binder.visitAugmentedAssignment` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1138-L1199) |
|
||||
| `Binder.visitDel` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1201-L1209) |
|
||||
| `Binder.visitTypeAnnotation` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1211-L1250) |
|
||||
| `Binder.visitFor` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1252-L1344) |
|
||||
| `Binder.visitContinue` | method | [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1346-L1354) |
|
||||
| _593 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/enums.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/operations.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/properties.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/lspUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commands.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/charCodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/stringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/timing.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
@@ -0,0 +1,180 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Program Analysis and Scheduling
|
||||
|
||||
**Feature path:** `Program Analysis and Scheduling`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 14
|
||||
- **Symbols:** 300
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts#L1-L106) | Exports types and analyzeProgram to run a Program analysis, gather diagnostics, and invoke a completion callback |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts#L1-L88) | Provides interfaces and utilities for storing per-source-file analysis metadata and import lookup in the analyzer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L1-L313) | Manages a Program with optional background analysis, syncing config, imports, file state and diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L1-L200) | Tracks cache owners and heap usage to trigger cache eviction when memory usage approaches the heap limit |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts#L1-L155) | Provides a lazily-built index mapping notebook CellDocs cells to their chain tails for fast later-cell lookups |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/circularDependency.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/circularDependency.ts#L1-L55) | Represents circular import chains as ordered lists of file URIs, normalizing start and comparing equality |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts#L1-L88) | Cache for storing parent-directory import lookup results to avoid repeated folder searches |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts#L1-L2302) | Tracks and manages the project's source files, imports, and analysis state for Pyright's type checker |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts#L1-L33) | Defines ISourceFileFactory interface and a type guard for creating SourceFile instances |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts#L1-L1946) | Analyzes Python files and manages background analysis, programs, configuration, and import resolution |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts#L1-L30) | Helpers to locate pyproject.toml and project config files starting from a given Uri |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts#L1-L1598) | Represents a single Python source or stub file and manages its parsing, analysis, and diagnostics |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts#L1-L259) | Holds per-file metadata and mutable program relations like imports, diagnostics, and edit-mode snapshots |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts#L1-L109) | Utilities for SourceFileInfo: import/chain relationships, cycle checks, and parsing open IPython notebook cells |
|
||||
|
||||
### Symbol preview (40 of 300)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `nullCallback` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts#L19-L21) |
|
||||
| `analyzeProgram` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts#L42-L105) |
|
||||
| `isAnnotationEvaluationPostponed` | function | [packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts#L68-L87) |
|
||||
| `BackgroundAnalysisProgram` | class | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L32-L303) |
|
||||
| `BackgroundAnalysisProgram.hasSourceFile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L85-L87) |
|
||||
| `BackgroundAnalysisProgram.setConfigOptions` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L89-L93) |
|
||||
| `BackgroundAnalysisProgram.setImportResolver` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L95-L101) |
|
||||
| `BackgroundAnalysisProgram.setTrackedFiles` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L103-L107) |
|
||||
| `BackgroundAnalysisProgram.setAllowedThirdPartyImports` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L109-L112) |
|
||||
| `BackgroundAnalysisProgram.setFileOpened` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L114-L117) |
|
||||
| `BackgroundAnalysisProgram.getChainedUri` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L119-L121) |
|
||||
| `BackgroundAnalysisProgram.updateChainedUri` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L123-L126) |
|
||||
| `BackgroundAnalysisProgram.updateOpenFileContents` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L128-L132) |
|
||||
| `BackgroundAnalysisProgram.setFileClosed` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L134-L138) |
|
||||
| `BackgroundAnalysisProgram.addInterimFile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L140-L143) |
|
||||
| `BackgroundAnalysisProgram.markAllFilesDirty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L145-L148) |
|
||||
| `BackgroundAnalysisProgram.markFilesDirty` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L150-L153) |
|
||||
| `BackgroundAnalysisProgram.setCompletionCallback` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L155-L158) |
|
||||
| `BackgroundAnalysisProgram.startAnalysis` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L160-L174) |
|
||||
| `BackgroundAnalysisProgram.analyzeFile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L176-L182) |
|
||||
| `BackgroundAnalysisProgram.analyzeFileAndGetDiagnostics` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L184-L190) |
|
||||
| `BackgroundAnalysisProgram.libraryUpdated` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L192-L194) |
|
||||
| `BackgroundAnalysisProgram.getDiagnosticsForRange` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L196-L202) |
|
||||
| `BackgroundAnalysisProgram.writeTypeStub` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L204-L222) |
|
||||
| `BackgroundAnalysisProgram.invalidateAndForceReanalysis` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L224-L245) |
|
||||
| `BackgroundAnalysisProgram.restart` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L247-L249) |
|
||||
| `BackgroundAnalysisProgram.dispose` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L251-L260) |
|
||||
| `BackgroundAnalysisProgram.enterEditMode` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L262-L269) |
|
||||
| `BackgroundAnalysisProgram.exitEditMode` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L271-L275) |
|
||||
| `BackgroundAnalysisProgram._ensurePartialStubPackages` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L277-L280) |
|
||||
| `BackgroundAnalysisProgram._reportDiagnosticsForRemovedFiles` | method | [packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L282-L302) |
|
||||
| `CacheManager` | class | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L26-L186) |
|
||||
| `CacheManager.registerCacheOwner` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L37-L39) |
|
||||
| `CacheManager.addWorker` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L41-L54) |
|
||||
| `CacheManager.handleCachedUsageBufferMessage` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L56-L71) |
|
||||
| `CacheManager.unregisterCacheOwner` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L73-L80) |
|
||||
| `CacheManager.pauseTracking` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L82-L90) |
|
||||
| `CacheManager.getCacheUsage` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L92-L104) |
|
||||
| `CacheManager.emptyCache` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L106-L120) |
|
||||
| `CacheManager.getUsedHeapRatio` | method | [packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L123-L154) |
|
||||
| _260 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/pyright.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/server.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/workspaceFactory.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeCleaner.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/editAction.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/host.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/logTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/memUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathConsts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/stringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/timing.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/tomlUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
@@ -0,0 +1,289 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Shared Runtime Infrastructure
|
||||
|
||||
**Feature path:** `Shared Runtime Infrastructure`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 63
|
||||
- **Symbols:** 775
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts#L1-L85) | Produces a PEP 661 Sentinel class instance type for sentinel declarations during type evaluation |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts#L1-L273) | Converts AST nodes, declarations, symbols, and types into concise string representations |
|
||||
| [packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L1-L66) | Provides classes to spawn and coordinate Pyright background analysis workers and runners |
|
||||
| [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L1-L898) | Runs the analyzer in a background worker and manages program views, diagnostics, and result serialization |
|
||||
| [packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts#L1-L287) | Provides background thread classes and helpers for message serialization, logging, and cancellation |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/asyncInitialization.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/asyncInitialization.ts#L1-L20) | Initializes runtime dependencies for Pyright, including TOML support and production source-map support |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts#L1-L298) | Cancellation utilities: combining tokens, file-based tokens, throttling, timeouts, and cancellation-aware racing |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts#L1-L18) | Determines whether a given URI should be treated as case-sensitive |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/charCodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/charCodes.ts#L1-L163) | Defines Char enum mapping descriptive names to numeric character codes for ASCII and select Unicode spaces |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/chokidarFileWatcherProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/chokidarFileWatcherProvider.ts#L1-L71) | Chokidar-based FileWatcherProvider that watches filesystem paths and emits file events |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts#L1-L413) | Provides utility helpers for arrays and maps, including searching, sorting, transforming, and mutating collections |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/console.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/console.ts#L1-L312) | Provides a logging abstraction with levels, multiple console implementations, chaining, cloning, and disposable support |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts#L1-L222) | Utility helpers and type guards for core operations like comparisons, type checks, cloning, and promise detection |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/crypto.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/crypto.ts#L1-L72) | Generates cryptographically secure random hex strings using Node or Web Crypto, failing if unavailable |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts#L1-L152) | Assertion and debugging utilities: assertions, error/enum formatting, function name and serializable-error helpers |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/deferred.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/deferred.ts#L1-L79) | Provides Deferred promise utilities with resolve/reject/completion state and helpers to create from promises |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/docRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docRange.ts#L1-L16) | Represents a document's URI together with a text range inside that document |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/docStringService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docStringService.ts#L1-L65) | Provides an interface and Pyright implementation to convert docstrings and extract parameter and attribute docs |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/editAction.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/editAction.ts#L1-L69) | Defines interfaces and helpers for text and file edit actions and file create/delete/rename operations |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts#L1-L94) | Expands VS Code-style path variables and resolves the result to a Uri using workspace roots and environment variables |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts#L1-L175) | Defines interfaces for program views, mutators, symbol providers, and other language service extensibility APIs |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/extensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensions.ts#L1-L17) | Adds a Promise.ignoreErrors extension that logs and ignores promise rejections |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts#L1-L214) | File-based cancellation utilities and a provider for creating filesystem-backed cancellation tokens |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts#L1-L150) | File system provider interfaces and a virtual Dirent class for pluggable real or virtual file systems |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts#L1-L58) | File watcher types, null implementations, and a helper to filter ignored filesystem watch events |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts#L1-L380) | Host for executing Python interpreters and external processes to get search paths, versions, and run code |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts#L1-L140) | Provides host environment abstractions: Host interface, HostKind, script/process types, and NoAccessHost implementation |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts#L1-L1304) | Provides utilities to dump and format token syntax and type information for debugging and MCP tools |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts#L1-L134) | Language server interfaces and types for settings, window/command services, workspace and background analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/logTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/logTracker.ts#L1-L213) | Tracks nested logging blocks, measures durations and parsing stats, and emits conditional formatted console logs |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/lspUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/lspUtils.ts#L1-L74) | Helper utilities for LSP: convert LSPAny, map declarations to SymbolKind, and detect null progress reporters |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/memUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/memUtils.ts#L1-L49) | Exports helpers for V8 heap statistics and total/free system memory |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/pathConsts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathConsts.ts#L1-L22) | Exports string constants for common Python filesystem paths and filenames |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts#L1-L698) | Utilities for manipulating, normalizing, and matching filesystem paths, filenames, and wildcard file specs |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts#L1-L96) | Converts between file offsets and line/column positions, ranges, and line end locations |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/processUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/processUtils.ts#L1-L56) | Terminates processes and their child process trees across platforms |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/progressReporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/progressReporter.ts#L1-L62) | Provides an interface and a tracker that manages and delegates progress reporting for a language server client |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts#L1-L221) | Defines PythonVersion type with parsing, stringifying, comparison helpers and predefined Python 3.x version constants |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts#L1-L650) | Provides real filesystem access, temp file handling, ZIP/egg archive support, and file watching integration for Pyright |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts#L1-L48) | Provides ServiceKey and GroupServiceKey constants for registering core analyzer and language-server services |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts#L1-L166) | Registry for singleton and group services with add, remove, get, clone, and dispose operations |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts#L1-L146) | ServiceProvider extensions offering accessors and a default SourceFileFactory for common services |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/streamUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/streamUtils.ts#L1-L31) | Provides helpers to read all stdin as a Buffer or as a string |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/stringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/stringUtils.ts#L1-L128) | Utility functions for string comparison, hashing, searching, counting, truncation, and escaping |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts#L1-L449) | Tracks and manages per-file text edits, merging overlapping edits and recording node removals |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts#L1-L208) | Defines types and utilities for text ranges, positions, and document ranges |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts#L1-L173) | Maintains an ordered collection of text ranges and provides fast index and lookup utilities |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/timing.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/timing.ts#L1-L106) | Duration and timing utilities that record, aggregate, and print operation runtimes |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/tomlUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/tomlUtils.ts#L1-L37) | Provides TOML parsing utilities to convert TOML strings into JavaScript primitive objects |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/baseUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/baseUri.ts#L1-L307) | Defines an abstract BaseUri class representing URIs and providing common path and extension utilities |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/constantUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/constantUri.ts#L1-L142) | Immutable marker URI type with no filesystem semantics and identity-based equality |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/emptyUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/emptyUri.ts#L1-L43) | Defines a singleton EmptyUri class representing an empty URI value |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/fileUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/fileUri.ts#L1-L302) | Represents file-schemed URIs for filesystem paths and provides path, query, fragment, and resolution utilities |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/memoization.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/memoization.ts#L1-L86) | Provides decorators to memoize property getters, no-arg instance methods, and static methods with LRU caching |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts#L1-L227) | Manages URI creation, parsing, normalization, and helpers for file, web, constant, and empty URI types |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/uriInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriInterface.ts#L1-L102) | Uri interface for representing and manipulating URIs, including path, fragment, query, and extension helpers |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts#L1-L81) | Map keyed by Uri for storing and iterating Uri-to-value mappings |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts#L1-L459) | Utilities for URI and filesystem operations, including wildcard file specs, directory entries, and path helpers |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/uri/webUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/webUri.ts#L1-L295) | Implements a WebUri class representing non-file URIs and exposing path, query, fragment, and manipulation methods |
|
||||
| [packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts#L1-L299) | Converts Pyright file edit actions to LSP WorkspaceEdit objects and applies edits to an EditableProgram |
|
||||
| [packages/pyright/packages/pyright-internal/src/pprof/profiler.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pprof/profiler.ts#L1-L64) | Starts and stops Datadog pprof CPU profiling and saves encoded profiles to disk |
|
||||
| [packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts#L1-L271) | Provides a read-only augmented FileSystem that overlays mapped directories onto a backing FileSystem |
|
||||
| [packages/pyright/packages/pyright-internal/src/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/types.ts#L1-L40) | Exports types describing language server client capabilities and initialization options |
|
||||
|
||||
### Symbol preview (40 of 775)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `createSentinelType` | function | [packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts#L19-L84) |
|
||||
| `createTracePrinter` | function | [packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts#L31-L272) |
|
||||
| `BackgroundAnalysis` | class | [packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L23-L47) |
|
||||
| `BackgroundAnalysisRunner` | class | [packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L49-L65) |
|
||||
| `BackgroundAnalysisRunner.createHost` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L54-L56) |
|
||||
| `BackgroundAnalysisRunner.createImportResolver` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L58-L64) |
|
||||
| `BackgroundAnalysisBase` | class | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L80-L377) |
|
||||
| `BackgroundAnalysisBase.dispose` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L100-L108) |
|
||||
| `BackgroundAnalysisBase.setProgramView` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L110-L112) |
|
||||
| `BackgroundAnalysisBase.setCompletionCallback` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L114-L116) |
|
||||
| `BackgroundAnalysisBase.setImportResolver` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L118-L120) |
|
||||
| `BackgroundAnalysisBase.setConfigOptions` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L122-L124) |
|
||||
| `BackgroundAnalysisBase.setTrackedFiles` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L126-L128) |
|
||||
| `BackgroundAnalysisBase.setAllowedThirdPartyImports` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L130-L132) |
|
||||
| `BackgroundAnalysisBase.ensurePartialStubPackages` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L134-L136) |
|
||||
| `BackgroundAnalysisBase.setFileOpened` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L138-L143) |
|
||||
| `BackgroundAnalysisBase.updateChainedUri` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L145-L150) |
|
||||
| `BackgroundAnalysisBase.setFileClosed` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L152-L154) |
|
||||
| `BackgroundAnalysisBase.addInterimFile` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L156-L158) |
|
||||
| `BackgroundAnalysisBase.markAllFilesDirty` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L160-L162) |
|
||||
| `BackgroundAnalysisBase.markFilesDirty` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L164-L169) |
|
||||
| `BackgroundAnalysisBase.startAnalysis` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L171-L181) |
|
||||
| `BackgroundAnalysisBase.analyzeFile` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L183-L202) |
|
||||
| `BackgroundAnalysisBase.analyzeFileAndGetDiagnostics` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L204-L223) |
|
||||
| `BackgroundAnalysisBase.getDiagnosticsForRange` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L225-L244) |
|
||||
| `BackgroundAnalysisBase.writeTypeStub` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L246-L273) |
|
||||
| `BackgroundAnalysisBase.invalidateAndForceReanalysis` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L275-L277) |
|
||||
| `BackgroundAnalysisBase.restart` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L279-L281) |
|
||||
| `BackgroundAnalysisBase.shutdown` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L283-L287) |
|
||||
| `BackgroundAnalysisBase.setup` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L289-L308) |
|
||||
| `BackgroundAnalysisBase.onMessage` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L310-L328) |
|
||||
| `BackgroundAnalysisBase.enqueueRequest` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L330-L334) |
|
||||
| `BackgroundAnalysisBase.log` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L336-L338) |
|
||||
| `BackgroundAnalysisBase.handleBackgroundResponse` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L340-L376) |
|
||||
| `BackgroundAnalysisRunnerBase` | class | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L379-L814) |
|
||||
| `BackgroundAnalysisRunnerBase.start` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L418-L429) |
|
||||
| `BackgroundAnalysisRunnerBase.onMessage` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L431-L579) |
|
||||
| `BackgroundAnalysisRunnerBase.createHost` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L581) |
|
||||
| `BackgroundAnalysisRunnerBase.createImportResolver` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L583-L587) |
|
||||
| `BackgroundAnalysisRunnerBase.handleAnalyze` | method | [packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L589-L605) |
|
||||
| _735 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/binder.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/checker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/circularDependency.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/enums.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/operations.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commandController.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/restartServer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageServerBase.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/nodeMain.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/nodeServer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/characterStream.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/characters.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/partialStubService.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/pyright.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/server.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/workspaceFactory.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/docStringUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/service.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/types.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/partialStubService.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/workspaceFactory.ts`
|
||||
177
architecture/generated/features/feat-type-evaluation.md
Normal file
177
architecture/generated/features/feat-type-evaluation.md
Normal file
@@ -0,0 +1,177 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Type Evaluation
|
||||
|
||||
**Feature path:** `Type Evaluation`
|
||||
|
||||
## Implementation summary
|
||||
|
||||
- **Files:** 25
|
||||
- **Symbols:** 535
|
||||
|
||||
### Primary files
|
||||
|
||||
These are the main implementation files attached to this semantic node.
|
||||
|
||||
| File | Summary |
|
||||
| ---- | ------- |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1-L7634) | Performs static type checking and traverses parse trees to validate and report diagnostics for a source file |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts#L1-L488) | Transforms objects created by constructors for special-case behaviors like functools.partial and TypedDicts |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts#L1-L1133) | Evaluates Python constructor and metaclass calls, validating __new__/__init__ arguments and inferring resulting instance types |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts#L1-L1598) | Handles special-case analysis and synthesis for Python dataclasses and dataclass_transform behaviors |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts#L1-L607) | Evaluates and applies function/class decorators, adjusting types, flags, overloads, properties, and dataclass behavior |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/enums.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/enums.ts#L1-L751) | Provides type analysis and special-case handling for Python Enum classes and enum members |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts#L1-L140) | Adds missing comparison methods to classes decorated with functools.total_ordering |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts#L1-L514) | Constructs and manages Python namedtuple class types with named fields and optional type annotations |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/operations.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/operations.ts#L1-L1405) | Evaluates types and validates semantics for unary, binary, augmented assignment, and ternary Python operators |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts#L1-L494) | Utilities for analyzing and handling function parameters, param lists, and related parameter typing in the analyzer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/properties.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/properties.ts#L1-L563) | Evaluates and constructs Python property types and manages getter/setter/deleter method typing and symbol table entries |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts#L1-L881) | Provides type evaluation logic for protocol (structural subtyping) classes |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts#L1-L640) | Tuple type analysis utilities: construct, infer, slice, expand, and assign tuple types for the type evaluator |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts#L1-L254) | Tracks speculative type contexts and caches speculative type results for nodes during speculative analysis |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeComplexity.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeComplexity.ts#L1-L103) | Computes a complexity score for types to rank candidate types during constraint solving |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts#L1-L517) | Retrieves and resolves docstrings for modules, classes, functions, variables, and properties including inherited stubs |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts#L1-L28991) | Evaluates types of parse tree nodes within a Python program |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts#L1-L900) | Type evaluator interfaces, helper types, constants, and utilities for Pyright's analyzer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts#L1-L72) | Wraps the type evaluator with logging and timing to track performance of type evaluation entry points |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts#L1-L1601) | Produces human-readable string representations of Pyright type objects for diagnostics and display |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typePrinterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinterUtils.ts#L1-L50) | Formats and escapes string and bytes literals for the type printer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts#L1-L4523) | Utilities and transformers for analyzing and manipulating Type objects used by the type checker |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeWalker.ts#L1-L205) | Walks components of a Type graph to visit contained types while preventing infinite recursion |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts#L1-L1694) | Provides TypedDict type creation, member resolution, assignment and helper utilities for the analyzer |
|
||||
| [packages/pyright/packages/pyright-internal/src/analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts#L1-L4000) | Represents and manipulates Python type abstractions used by the Pyright analyzer |
|
||||
|
||||
### Symbol preview (40 of 535)
|
||||
|
||||
| Symbol | Kind | Source |
|
||||
| ------ | ---- | ------ |
|
||||
| `Checker` | class | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L217-L7633) |
|
||||
| `Checker.check` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L244-L282) |
|
||||
| `Checker.walk` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L284-L292) |
|
||||
| `Checker.visitSuite` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L294-L297) |
|
||||
| `Checker.visitStatementList` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L299-L312) |
|
||||
| `Checker.visitClass` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L314-L397) |
|
||||
| `Checker.visitFunction` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L399-L742) |
|
||||
| `Checker.visitLambda` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L744-L793) |
|
||||
| `Checker.visitCall` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L795-L835) |
|
||||
| `Checker.visitAwait` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L837-L855) |
|
||||
| `Checker.visitFor` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L857-L869) |
|
||||
| `Checker.visitList` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L871-L874) |
|
||||
| `Checker.visitSet` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L876-L879) |
|
||||
| `Checker.visitDictionary` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L881-L884) |
|
||||
| `Checker.visitComprehension` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L886-L889) |
|
||||
| `Checker.visitComprehensionIf` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L891-L895) |
|
||||
| `Checker.visitIf` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L897-L901) |
|
||||
| `Checker.visitWhile` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L903-L907) |
|
||||
| `Checker.visitWith` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L909-L924) |
|
||||
| `Checker.visitReturn` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L926-L1053) |
|
||||
| `Checker.visitYield` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1055-L1065) |
|
||||
| `Checker.visitYieldFrom` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1067-L1097) |
|
||||
| `Checker.visitRaise` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1099-L1109) |
|
||||
| `Checker.visitExcept` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1111-L1122) |
|
||||
| `Checker.visitAssert` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1124-L1151) |
|
||||
| `Checker.visitAssignment` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1153-L1194) |
|
||||
| `Checker.visitAssignmentExpression` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1196-L1199) |
|
||||
| `Checker.visitAugmentedAssignment` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1201-L1206) |
|
||||
| `Checker.visitIndex` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1208-L1269) |
|
||||
| `Checker.visitBinaryOperation` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1271-L1293) |
|
||||
| `Checker.visitSlice` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1295-L1298) |
|
||||
| `Checker.visitUnpack` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1300-L1303) |
|
||||
| `Checker.visitTuple` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1305-L1308) |
|
||||
| `Checker.visitUnaryOperation` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1310-L1319) |
|
||||
| `Checker.visitTernary` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1321-L1326) |
|
||||
| `Checker.visitStringList` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1328-L1416) |
|
||||
| `Checker.visitFormatString` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1418-L1428) |
|
||||
| `Checker.visitGlobal` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1430-L1440) |
|
||||
| `Checker.visitNonlocal` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1442-L1454) |
|
||||
| `Checker.visitName` | method | [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1456-L1470) |
|
||||
| _495 additional symbols omitted_ | | |
|
||||
|
||||
## Dependencies
|
||||
|
||||
**Imported by:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/program.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/extensibility.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/lspUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts`
|
||||
|
||||
**Imports:**
|
||||
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scope.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/commands/commands.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/configOptions.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/console.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/core.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/debug.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnostic.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/logTracker.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/positionUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/textRange.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/timing.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/common/uri/uri.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/localization/localize.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/parser.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts`
|
||||
- `packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts`
|
||||
197
architecture/generated/pyright-engineering-map.md
Normal file
197
architecture/generated/pyright-engineering-map.md
Normal file
@@ -0,0 +1,197 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Pyright Engineering Map
|
||||
|
||||
A maintainer map from Pyright concepts to implementation roots, tests, and graph pages. It uses LSP terminology where Pyright implements a protocol-facing language feature, and stays within packages/pyright-owned paths.
|
||||
|
||||
## Quick Index
|
||||
|
||||
- [Type evaluation](#type-evaluation)
|
||||
- [Constraint solving and type variables](#constraint-solving-and-type-variables)
|
||||
- [Flow narrowing and type guards](#flow-narrowing-and-type-guards)
|
||||
- [Import resolution and packaging](#import-resolution-and-packaging)
|
||||
- [Parser, binder, and symbols](#parser-binder-and-symbols)
|
||||
- [Diagnostics and configuration](#diagnostics-and-configuration)
|
||||
- [Language service providers](#language-service-providers)
|
||||
- [CLI and VS Code extension](#cli-and-vs-code-extension)
|
||||
|
||||
## Type evaluation
|
||||
|
||||
**User surface:** Type inference, call analysis, overload selection, operator semantics, class and function type computation
|
||||
|
||||
**LSP surface:** `textDocument/hover`<br>`textDocument/completion`<br>`textDocument/signatureHelp`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/types.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/typeEvaluator*.test.ts](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Type Evaluation](features/feat-type-evaluation.md)
|
||||
|
||||
## Constraint solving and type variables
|
||||
|
||||
**User surface:** TypeVar solving, generic specialization, constrained types, variance, inference scoring
|
||||
|
||||
**LSP surface:** `textDocument/hover`<br>`textDocument/signatureHelp`<br>`textDocument/completion`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples/typeVar*.py](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples/generic*.py](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Constraint Solving and Type Variables](features/feat-constraint-solving-and-type-variables.md)
|
||||
- [Type Evaluation](features/feat-type-evaluation.md)
|
||||
|
||||
## Flow narrowing and type guards
|
||||
|
||||
**User surface:** Control-flow graph, narrowing expressions, TypeGuard and TypeIs behavior, pattern narrowing
|
||||
|
||||
**LSP surface:** `textDocument/hover`<br>`textDocument/publishDiagnostics`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples/typeNarrowing*.py](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples/typeGuard*.py](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Flow Narrowing and Type Guards](features/feat-flow-narrowing-and-type-guards.md)
|
||||
- [Type Evaluation](features/feat-type-evaluation.md)
|
||||
|
||||
## Import resolution and packaging
|
||||
|
||||
**User surface:** Module resolution, execution environments, editable installs, stub discovery, auto-import search
|
||||
|
||||
**LSP surface:** `textDocument/completion`<br>`textDocument/definition`<br>`workspace/symbol`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/importResolver.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/importResolver.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples/import*.py](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Import Resolution and Packaging](features/feat-import-resolution-and-packaging.md)
|
||||
- [Language Service Providers](features/feat-language-service-providers.md)
|
||||
|
||||
## Parser, binder, and symbols
|
||||
|
||||
**User surface:** Python syntax tree parsing, binding, scopes, symbol tables, declaration discovery
|
||||
|
||||
**LSP surface:** `textDocument/documentSymbol`<br>`textDocument/definition`<br>`textDocument/references`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/parser](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/parser)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/parser.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/parser.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/parseTreeUtils.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/parseTreeUtils.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Parser, Binder, and Symbols](features/feat-parser-binder-and-symbols.md)
|
||||
|
||||
## Diagnostics and configuration
|
||||
|
||||
**User surface:** Diagnostic rules, config files, execution environments, severity mapping, command-line analysis
|
||||
|
||||
**LSP surface:** `textDocument/publishDiagnostics`<br>`workspace/didChangeConfiguration`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/common/configOptions.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/commands](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/commands)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/config.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/config.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/samples](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/samples)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Diagnostics and Configuration](features/feat-diagnostics-and-configuration.md)
|
||||
- [Type Evaluation](features/feat-type-evaluation.md)
|
||||
|
||||
## Language service providers
|
||||
|
||||
**User surface:** Hover, completion, definition, references, rename, document symbols, semantic tokens
|
||||
|
||||
**LSP surface:** `textDocument/hover`<br>`textDocument/completion`<br>`textDocument/definition`<br>`textDocument/references`<br>`textDocument/rename`<br>`textDocument/documentSymbol`<br>`textDocument/semanticTokens`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/languageService](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/languageService)
|
||||
- [packages/pyright/packages/pyright-internal/src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/languageServer.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/languageServer.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/harness/fourslash](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright-internal/src/tests/harness/fourslash)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [Language Service Providers](features/feat-language-service-providers.md)
|
||||
|
||||
## CLI and VS Code extension
|
||||
|
||||
**User surface:** Pyright command-line entry point, VS Code extension integration, server startup, client configuration
|
||||
|
||||
**LSP surface:** `initialize`<br>`shutdown`<br>`workspace/configuration`
|
||||
|
||||
**Start in code:**
|
||||
|
||||
- [packages/pyright/packages/pyright/src](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/pyright/src)
|
||||
- [packages/pyright/packages/vscode-pyright/src](https://github.com/microsoft/pyrx/tree/main/packages/pyright/packages/vscode-pyright/src)
|
||||
- [packages/pyright/packages/pyright-internal/src/server.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
|
||||
**Test starting points:**
|
||||
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/languageServer.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/languageServer.test.ts)
|
||||
- [packages/pyright/packages/pyright-internal/src/tests/service.test.ts](https://github.com/microsoft/pyrx/blob/main/packages/pyright/packages/pyright-internal/src/tests/service.test.ts)
|
||||
|
||||
**Related semantic areas:**
|
||||
|
||||
- [CLI and VS Code Extension](features/feat-cli-and-vs-code-extension.md)
|
||||
|
||||
## How to use this map
|
||||
|
||||
- Start with the area that matches the behavior the user or protocol request exercises.
|
||||
- Follow the code links for implementation entry points, then use the test links to find the matching test shape.
|
||||
11
architecture/generated/subsystems/.pages
Normal file
11
architecture/generated/subsystems/.pages
Normal file
@@ -0,0 +1,11 @@
|
||||
title: Files by analyzer area
|
||||
nav:
|
||||
- analyzer: analyzer.md
|
||||
- commands: commands.md
|
||||
- common: common.md
|
||||
- languageService: languageservice.md
|
||||
- localization: localization.md
|
||||
- parser: parser.md
|
||||
- pprof: pprof.md
|
||||
- src: src.md
|
||||
- uri: uri.md
|
||||
210
architecture/generated/subsystems/analyzer.md
Normal file
210
architecture/generated/subsystems/analyzer.md
Normal file
@@ -0,0 +1,210 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `analyzer`
|
||||
|
||||
Source files under `analyzer/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 82
|
||||
- **Symbols (leaves)**: 1776
|
||||
|
||||
## Constraint Solving and Type Variables
|
||||
|
||||
- [analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts#L1-L90) — Holds mappings from type variables to resolved types and manages multiple constraint solution sets
|
||||
- [analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts#L1-L1450) — Solves TypeVar, TypeVarTuple, and ParamSpec constraints to infer concrete types based on collected constraints
|
||||
- [analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts#L1-L288) — Tracks and manages constraint sets and bounds for type variables used by the constraint solver
|
||||
|
||||
## Diagnostics and Configuration
|
||||
|
||||
- [analyzer/deprecatedSymbols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts#L1-L316) — Maps implicitly deprecated typing and collection symbols to the Python version and suggested replacement
|
||||
|
||||
## Documentation and Comments
|
||||
|
||||
- [analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts#L1-L318) — Parses pyright-specific comments to adjust diagnostic rule settings and collect comment diagnostics
|
||||
- [analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts#L1-L873) — Converts Python docstrings into Markdown or cleaned plaintext for documentation and display
|
||||
- [analyzer/docStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringUtils.ts#L1-L153) — Parses Python docstrings and extracts parameter and attribute docs in Epytext, reST, and Google styles
|
||||
|
||||
## Flow Narrowing and Type Guards
|
||||
|
||||
- [analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts#L1-L2061) — Determines narrowed types for variables and expressions and computes statement reachability via the code flow graph
|
||||
- [analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts#L1-L286) — Types and helpers for tracking code-flow nodes and reference keys used in Pyright's code flow analysis
|
||||
- [analyzer/codeFlowUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts#L1-L446) — Generates an ASCII diagram of a control flow graph from FlowNode structures
|
||||
- [analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts#L1-L2254) — Type evaluation and narrowing utilities for Python structural pattern matching (PEP 634) in Pyright
|
||||
- [analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts#L1-L377) — Evaluates parse-node expressions to determine static boolean, version, and platform string outcomes
|
||||
- [analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts#L1-L2814) — Narrow types based on conditional expressions, isinstance checks, and user-defined type guards
|
||||
|
||||
## Import Resolution and Packaging
|
||||
|
||||
- [analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts#L1-L21) — Provides a simple logger for collecting and retrieving import resolution messages
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts#L1-L2576) — Resolves Python imports to filesystem modules, packages, typeshed and stub sources for static type analysis
|
||||
- [analyzer/importResolverFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts#L1-L203) — Cached file-system adapter for import resolution, exposing directory/file queries and resolvable name lookups
|
||||
- [analyzer/importResolverTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts#L1-L62) — Type declarations for import resolver helpers including typeshed info provider and a minimal cached filesystem facade
|
||||
- [analyzer/importResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts#L1-L109) — Represents Python import resolution results with metadata, resolved URIs, and implicit import info
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts#L1-L1016) — Summarizes and manipulates Python import statements and generates edits for auto-imports and formatting
|
||||
- [analyzer/packageTypeReport.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts#L1-L113) — Defines types and a factory for package type verification reports, symbols, modules, and diagnostics
|
||||
- [analyzer/packageTypeVerifier.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts#L1-L1582) — Validates public exports of a package to ensure exported types are complete and reports problems
|
||||
- [analyzer/pyTypedUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts#L1-L66) — Determines whether a py.typed file exists and if it marks the package as partially typed
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts#L1-L251) — Resolves Python interpreter and typeshed search paths, site-packages locations, and .pth-derived paths
|
||||
- [analyzer/sourceEnumerator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts#L1-L234) — Enumerates Python source files with include/exclude rules, tracking symlinked directories and auto-excluding virtualenvs
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts#L1-L1137) — Maps .pyi stub files to corresponding .py implementation files and provides binding utilities
|
||||
- [analyzer/sourceMapperUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts#L1-L64) — Finds an import chain between two Uri nodes and returns the sequence of Uris
|
||||
- [analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts#L1-L925) — Emit Python .pyi type stub files from parsed and analyzed Python source files
|
||||
- [analyzer/typeshedInfoProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts#L1-L253) — Provides typeshed root/subdirectory lookup, third-party package mapping, and stdlib version info
|
||||
|
||||
## Parser, Binder, and Symbols
|
||||
|
||||
- [analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts#L1-L234) — Stores and manages analysis metadata (scopes, declarations, control-flow, imports, and __all__) for parse nodes
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts#L1-L4741) — Performs Python parse-tree name binding and creates scopes and symbol tables for static analysis
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts#L1-L304) — Describes declaration kinds and interfaces that record symbol locations, nodes, and import/alias resolution metadata
|
||||
- [analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts#L1-L421) — Utilities for inspecting, comparing, and resolving declarations and alias references in the analyzer
|
||||
- [analyzer/parseTreeCleaner.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeCleaner.ts#L1-L36) — Walks a Module parse tree and clears analyzer-specific analysis info from each parse node
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts#L1-L2748) — Utilities for traversing, querying, and printing Python parse tree nodes and their evaluation ranges
|
||||
- [analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts#L1-L936) — Traverses a Python parse tree and provides visitor/walker classes to visit and process parse nodes
|
||||
- [analyzer/scope.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scope.ts#L1-L268) — Models evaluation scopes and provides symbol table, binding info, and recursive lookup for Python analysis
|
||||
- [analyzer/scopeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts#L1-L97) — Utilities for locating and inspecting analysis scopes and scope hierarchies for parse tree nodes
|
||||
- [analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts#L1-L312) — Represents program symbols, tracking their flags, declarations, and synthesized type information
|
||||
- [analyzer/symbolNameUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts#L1-L51) — Classify Python symbol names (private, protected, dunder, constant, type alias, public constant/type alias)
|
||||
- [analyzer/symbolUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts#L1-L53) — Helpers for Symbol declaration queries, visibility checks, TypedDict index access, and class-var/final semantics
|
||||
- [analyzer/testWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts#L1-L123) — Validates parse-tree node parent/range invariants and evaluates NameNode types using a TypeEvaluator
|
||||
|
||||
## Program Analysis and Scheduling
|
||||
|
||||
- [analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts#L1-L106) — Exports types and analyzeProgram to run a Program analysis, gather diagnostics, and invoke a completion callback
|
||||
- [analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts#L1-L88) — Provides interfaces and utilities for storing per-source-file analysis metadata and import lookup in the analyzer
|
||||
- [analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts#L1-L313) — Manages a Program with optional background analysis, syncing config, imports, file state and diagnostics
|
||||
- [analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts#L1-L200) — Tracks cache owners and heap usage to trigger cache eviction when memory usage approaches the heap limit
|
||||
- [analyzer/cellChainIndex.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts#L1-L155) — Provides a lazily-built index mapping notebook CellDocs cells to their chain tails for fast later-cell lookups
|
||||
- [analyzer/circularDependency.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/circularDependency.ts#L1-L55) — Represents circular import chains as ordered lists of file URIs, normalizing start and comparing equality
|
||||
- [analyzer/parentDirectoryCache.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts#L1-L88) — Cache for storing parent-directory import lookup results to avoid repeated folder searches
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts#L1-L2302) — Tracks and manages the project's source files, imports, and analysis state for Pyright's type checker
|
||||
- [analyzer/programTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts#L1-L33) — Defines ISourceFileFactory interface and a type guard for creating SourceFile instances
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts#L1-L1946) — Analyzes Python files and manages background analysis, programs, configuration, and import resolution
|
||||
- [analyzer/serviceUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts#L1-L30) — Helpers to locate pyproject.toml and project config files starting from a given Uri
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts#L1-L1598) — Represents a single Python source or stub file and manages its parsing, analysis, and diagnostics
|
||||
- [analyzer/sourceFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts#L1-L259) — Holds per-file metadata and mutable program relations like imports, diagnostics, and edit-mode snapshots
|
||||
- [analyzer/sourceFileInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts#L1-L109) — Utilities for SourceFileInfo: import/chain relationships, cycle checks, and parsing open IPython notebook cells
|
||||
|
||||
## Shared Runtime Infrastructure
|
||||
|
||||
- [analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts#L1-L85) — Produces a PEP 661 Sentinel class instance type for sentinel declarations during type evaluation
|
||||
- [analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts#L1-L273) — Converts AST nodes, declarations, symbols, and types into concise string representations
|
||||
|
||||
## Type Evaluation
|
||||
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts#L1-L7634) — Performs static type checking and traverses parse trees to validate and report diagnostics for a source file
|
||||
- [analyzer/constructorTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts#L1-L488) — Transforms objects created by constructors for special-case behaviors like functools.partial and TypedDicts
|
||||
- [analyzer/constructors.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts#L1-L1133) — Evaluates Python constructor and metaclass calls, validating __new__/__init__ arguments and inferring resulting instance types
|
||||
- [analyzer/dataClasses.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts#L1-L1598) — Handles special-case analysis and synthesis for Python dataclasses and dataclass_transform behaviors
|
||||
- [analyzer/decorators.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts#L1-L607) — Evaluates and applies function/class decorators, adjusting types, flags, overloads, properties, and dataclass behavior
|
||||
- [analyzer/enums.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/enums.ts#L1-L751) — Provides type analysis and special-case handling for Python Enum classes and enum members
|
||||
- [analyzer/functionTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts#L1-L140) — Adds missing comparison methods to classes decorated with functools.total_ordering
|
||||
- [analyzer/namedTuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts#L1-L514) — Constructs and manages Python namedtuple class types with named fields and optional type annotations
|
||||
- [analyzer/operations.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/operations.ts#L1-L1405) — Evaluates types and validates semantics for unary, binary, augmented assignment, and ternary Python operators
|
||||
- [analyzer/parameterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts#L1-L494) — Utilities for analyzing and handling function parameters, param lists, and related parameter typing in the analyzer
|
||||
- [analyzer/properties.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/properties.ts#L1-L563) — Evaluates and constructs Python property types and manages getter/setter/deleter method typing and symbol table entries
|
||||
- [analyzer/protocols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts#L1-L881) — Provides type evaluation logic for protocol (structural subtyping) classes
|
||||
- [analyzer/tuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts#L1-L640) — Tuple type analysis utilities: construct, infer, slice, expand, and assign tuple types for the type evaluator
|
||||
- [analyzer/typeCacheUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts#L1-L254) — Tracks speculative type contexts and caches speculative type results for nodes during speculative analysis
|
||||
- [analyzer/typeComplexity.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeComplexity.ts#L1-L103) — Computes a complexity score for types to rank candidate types during constraint solving
|
||||
- [analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts#L1-L517) — Retrieves and resolves docstrings for modules, classes, functions, variables, and properties including inherited stubs
|
||||
- [analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts#L1-L28991) — Evaluates types of parse tree nodes within a Python program
|
||||
- [analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts#L1-L900) — Type evaluator interfaces, helper types, constants, and utilities for Pyright's analyzer
|
||||
- [analyzer/typeEvaluatorWithTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts#L1-L72) — Wraps the type evaluator with logging and timing to track performance of type evaluation entry points
|
||||
- [analyzer/typePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts#L1-L1601) — Produces human-readable string representations of Pyright type objects for diagnostics and display
|
||||
- [analyzer/typePrinterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinterUtils.ts#L1-L50) — Formats and escapes string and bytes literals for the type printer
|
||||
- [analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts#L1-L4523) — Utilities and transformers for analyzing and manipulating Type objects used by the type checker
|
||||
- [analyzer/typeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeWalker.ts#L1-L205) — Walks components of a Type graph to visit contained types while preventing infinite recursion
|
||||
- [analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts#L1-L1694) — Provides TypedDict type creation, member resolution, assignment and helper utilities for the analyzer
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts#L1-L4000) — Represents and manipulates Python type abstractions used by the Pyright analyzer
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts)
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts)
|
||||
- [src/backgroundThreadBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts)
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts)
|
||||
- [commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts)
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [common/docStringService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docStringService.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts)
|
||||
- [common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts)
|
||||
- [common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [common/lspUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/lspUtils.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [common/textEditTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts)
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts)
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [languageService/completionProviderUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts)
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts)
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts)
|
||||
- [languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts)
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts)
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts)
|
||||
- [languageService/importSorter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts)
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts)
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts)
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts)
|
||||
- [languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts)
|
||||
- [languageService/tooltipUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts)
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts)
|
||||
- [src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts)
|
||||
- [src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts)
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts)
|
||||
- [commands/commands.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commands.ts)
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts)
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts)
|
||||
- [common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts)
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [common/console.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/console.ts)
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts)
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [common/diagnosticRules.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts)
|
||||
- [common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts)
|
||||
- [common/editAction.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/editAction.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts)
|
||||
- [common/fileWatcher.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts)
|
||||
- [common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts)
|
||||
- [common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts)
|
||||
- [common/logTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/logTracker.ts)
|
||||
- [common/memUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/memUtils.ts)
|
||||
- [common/pathConsts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathConsts.ts)
|
||||
- [common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts)
|
||||
- [common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts)
|
||||
- [common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [common/stringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/stringUtils.ts)
|
||||
- [common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts)
|
||||
- [common/textRangeCollection.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts)
|
||||
- [common/timing.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/timing.ts)
|
||||
- [common/tomlUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/tomlUtils.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [uri/uriMap.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts)
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts)
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts)
|
||||
- [parser/parseNodeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodeUtils.ts)
|
||||
- [parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
- [parser/stringTokenUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts)
|
||||
- [parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts)
|
||||
- [parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts)
|
||||
48
architecture/generated/subsystems/commands.md
Normal file
48
architecture/generated/subsystems/commands.md
Normal file
@@ -0,0 +1,48 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `commands`
|
||||
|
||||
Source files under `commands/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 7
|
||||
- **Symbols (leaves)**: 29
|
||||
|
||||
## Diagnostics and Configuration
|
||||
|
||||
- [commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts#L1-L74) — Dispatches language-server commands to their specific handlers and indicates long-running/refactoring commands
|
||||
- [commands/commandResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandResult.ts#L1-L22) — Defines CommandResult interface representing command output with label, edits, optional data, and a type guard
|
||||
- [commands/commands.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commands.ts#L1-L22) — Exports an enum of Pyright command identifier strings used by the extension
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts#L1-L119) — Creates a language-server command to generate Python type stubs for a specified import and notify the user
|
||||
- [commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts#L1-L121) — Dumps tokens, syntax nodes, type info (including cached) and code-flow graph for a given file
|
||||
- [commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts#L1-L39) — Handles quick action commands for the language server and returns corresponding workspace edits
|
||||
- [commands/restartServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/restartServer.ts#L1-L21) — Provides a command to restart the language server
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts)
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts)
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts)
|
||||
- [common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
229
architecture/generated/subsystems/common.md
Normal file
229
architecture/generated/subsystems/common.md
Normal file
@@ -0,0 +1,229 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `common`
|
||||
|
||||
Source files under `common/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 51
|
||||
- **Symbols (leaves)**: 625
|
||||
|
||||
## Diagnostics and Configuration
|
||||
|
||||
- [common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts#L1-L182) — Defines command-line and language-server configuration option types for Pyright including config and server settings
|
||||
- [common/commandUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandUtils.ts#L1-L22) — Helpers to create LSP Command objects with URI arguments converted to string form
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts#L1-L1799) — Defines ExecutionEnvironment and ConfigOptions along with helpers for diagnostic rule sets and file-spec matching
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts#L1-L341) — Defines Diagnostic types, serialization, comparison, and addendum helpers for building and formatting diagnostics
|
||||
- [common/diagnosticRules.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts#L1-L107) — Enumerates string identifiers for configurable diagnostic rules used by the type checker
|
||||
- [common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts#L1-L202) — Collects and deduplicates file diagnostics and provides a TextRange-aware sink that converts offsets to position ranges
|
||||
|
||||
## Shared Runtime Infrastructure
|
||||
|
||||
- [common/asyncInitialization.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/asyncInitialization.ts#L1-L20) — Initializes runtime dependencies for Pyright, including TOML support and production source-map support
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts#L1-L298) — Cancellation utilities: combining tokens, file-based tokens, throttling, timeouts, and cancellation-aware racing
|
||||
- [common/caseSensitivityDetector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts#L1-L18) — Determines whether a given URI should be treated as case-sensitive
|
||||
- [common/charCodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/charCodes.ts#L1-L163) — Defines Char enum mapping descriptive names to numeric character codes for ASCII and select Unicode spaces
|
||||
- [common/chokidarFileWatcherProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/chokidarFileWatcherProvider.ts#L1-L71) — Chokidar-based FileWatcherProvider that watches filesystem paths and emits file events
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts#L1-L413) — Provides utility helpers for arrays and maps, including searching, sorting, transforming, and mutating collections
|
||||
- [common/console.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/console.ts#L1-L312) — Provides a logging abstraction with levels, multiple console implementations, chaining, cloning, and disposable support
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts#L1-L222) — Utility helpers and type guards for core operations like comparisons, type checks, cloning, and promise detection
|
||||
- [common/crypto.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/crypto.ts#L1-L72) — Generates cryptographically secure random hex strings using Node or Web Crypto, failing if unavailable
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts#L1-L152) — Assertion and debugging utilities: assertions, error/enum formatting, function name and serializable-error helpers
|
||||
- [common/deferred.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/deferred.ts#L1-L79) — Provides Deferred promise utilities with resolve/reject/completion state and helpers to create from promises
|
||||
- [common/docRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docRange.ts#L1-L16) — Represents a document's URI together with a text range inside that document
|
||||
- [common/docStringService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docStringService.ts#L1-L65) — Provides an interface and Pyright implementation to convert docstrings and extract parameter and attribute docs
|
||||
- [common/editAction.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/editAction.ts#L1-L69) — Defines interfaces and helpers for text and file edit actions and file create/delete/rename operations
|
||||
- [common/envVarUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts#L1-L94) — Expands VS Code-style path variables and resolves the result to a Uri using workspace roots and environment variables
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts#L1-L175) — Defines interfaces for program views, mutators, symbol providers, and other language service extensibility APIs
|
||||
- [common/extensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensions.ts#L1-L17) — Adds a Promise.ignoreErrors extension that logs and ignores promise rejections
|
||||
- [common/fileBasedCancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts#L1-L214) — File-based cancellation utilities and a provider for creating filesystem-backed cancellation tokens
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts#L1-L150) — File system provider interfaces and a virtual Dirent class for pluggable real or virtual file systems
|
||||
- [common/fileWatcher.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts#L1-L58) — File watcher types, null implementations, and a helper to filter ignored filesystem watch events
|
||||
- [common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts#L1-L380) — Host for executing Python interpreters and external processes to get search paths, versions, and run code
|
||||
- [common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts#L1-L140) — Provides host environment abstractions: Host interface, HostKind, script/process types, and NoAccessHost implementation
|
||||
- [common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts#L1-L1304) — Provides utilities to dump and format token syntax and type information for debugging and MCP tools
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts#L1-L134) — Language server interfaces and types for settings, window/command services, workspace and background analysis
|
||||
- [common/logTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/logTracker.ts#L1-L213) — Tracks nested logging blocks, measures durations and parsing stats, and emits conditional formatted console logs
|
||||
- [common/lspUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/lspUtils.ts#L1-L74) — Helper utilities for LSP: convert LSPAny, map declarations to SymbolKind, and detect null progress reporters
|
||||
- [common/memUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/memUtils.ts#L1-L49) — Exports helpers for V8 heap statistics and total/free system memory
|
||||
- [common/pathConsts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathConsts.ts#L1-L22) — Exports string constants for common Python filesystem paths and filenames
|
||||
- [common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts#L1-L698) — Utilities for manipulating, normalizing, and matching filesystem paths, filenames, and wildcard file specs
|
||||
- [common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts#L1-L96) — Converts between file offsets and line/column positions, ranges, and line end locations
|
||||
- [common/processUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/processUtils.ts#L1-L56) — Terminates processes and their child process trees across platforms
|
||||
- [common/progressReporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/progressReporter.ts#L1-L62) — Provides an interface and a tracker that manages and delegates progress reporting for a language server client
|
||||
- [common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts#L1-L221) — Defines PythonVersion type with parsing, stringifying, comparison helpers and predefined Python 3.x version constants
|
||||
- [common/realFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts#L1-L650) — Provides real filesystem access, temp file handling, ZIP/egg archive support, and file watching integration for Pyright
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts#L1-L48) — Provides ServiceKey and GroupServiceKey constants for registering core analyzer and language-server services
|
||||
- [common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts#L1-L166) — Registry for singleton and group services with add, remove, get, clone, and dispose operations
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts#L1-L146) — ServiceProvider extensions offering accessors and a default SourceFileFactory for common services
|
||||
- [common/streamUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/streamUtils.ts#L1-L31) — Provides helpers to read all stdin as a Buffer or as a string
|
||||
- [common/stringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/stringUtils.ts#L1-L128) — Utility functions for string comparison, hashing, searching, counting, truncation, and escaping
|
||||
- [common/textEditTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts#L1-L449) — Tracks and manages per-file text edits, merging overlapping edits and recording node removals
|
||||
- [common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts#L1-L208) — Defines types and utilities for text ranges, positions, and document ranges
|
||||
- [common/textRangeCollection.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts#L1-L173) — Maintains an ordered collection of text ranges and provides fast index and lookup utilities
|
||||
- [common/timing.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/timing.ts#L1-L106) — Duration and timing utilities that record, aggregate, and print operation runtimes
|
||||
- [common/tomlUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/tomlUtils.ts#L1-L37) — Provides TOML parsing utilities to convert TOML strings into JavaScript primitive objects
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts#L1-L299) — Converts Pyright file edit actions to LSP WorkspaceEdit objects and applies edits to an EditableProgram
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts)
|
||||
- [analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts)
|
||||
- [analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts)
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts)
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts)
|
||||
- [analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts)
|
||||
- [analyzer/codeFlowUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts)
|
||||
- [analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts)
|
||||
- [analyzer/constraintSolution.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolution.ts)
|
||||
- [analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts)
|
||||
- [analyzer/constraintTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintTracker.ts)
|
||||
- [analyzer/constructorTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts)
|
||||
- [analyzer/constructors.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts)
|
||||
- [analyzer/dataClasses.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts)
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts)
|
||||
- [analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts)
|
||||
- [analyzer/decorators.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts)
|
||||
- [analyzer/deprecatedSymbols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/deprecatedSymbols.ts)
|
||||
- [analyzer/enums.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/enums.ts)
|
||||
- [analyzer/functionTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/importResolverFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts)
|
||||
- [analyzer/importResolverTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts)
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts)
|
||||
- [analyzer/namedTuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts)
|
||||
- [analyzer/operations.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/operations.ts)
|
||||
- [analyzer/packageTypeReport.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts)
|
||||
- [analyzer/packageTypeVerifier.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts)
|
||||
- [analyzer/parameterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts)
|
||||
- [analyzer/parentDirectoryCache.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts)
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts)
|
||||
- [analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts)
|
||||
- [analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts)
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts)
|
||||
- [analyzer/programTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts)
|
||||
- [analyzer/properties.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/properties.ts)
|
||||
- [analyzer/protocols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts)
|
||||
- [analyzer/pyTypedUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts)
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts)
|
||||
- [analyzer/scope.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scope.ts)
|
||||
- [analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [analyzer/serviceUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts)
|
||||
- [analyzer/sourceEnumerator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts)
|
||||
- [analyzer/sourceFileInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts)
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts)
|
||||
- [analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts)
|
||||
- [analyzer/testWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts)
|
||||
- [analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts)
|
||||
- [analyzer/tuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts)
|
||||
- [analyzer/typeCacheUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts)
|
||||
- [analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts)
|
||||
- [analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
- [analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts)
|
||||
- [analyzer/typeEvaluatorWithTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorWithTracker.ts)
|
||||
- [analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts)
|
||||
- [analyzer/typePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts)
|
||||
- [analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts)
|
||||
- [analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts)
|
||||
- [analyzer/typeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeWalker.ts)
|
||||
- [analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts)
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
- [analyzer/typeshedInfoProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts)
|
||||
- [src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts)
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts)
|
||||
- [src/backgroundThreadBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts)
|
||||
- [commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts)
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts)
|
||||
- [commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts)
|
||||
- [commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts)
|
||||
- [commands/restartServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/restartServer.ts)
|
||||
- [uri/baseUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/baseUri.ts)
|
||||
- [uri/fileUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/fileUri.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts)
|
||||
- [uri/webUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/webUri.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts)
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [languageService/completionProviderUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts)
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts)
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts)
|
||||
- [languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts)
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts)
|
||||
- [languageService/dynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts)
|
||||
- [languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts)
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts)
|
||||
- [languageService/importSorter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts)
|
||||
- [languageService/navigationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts)
|
||||
- [languageService/pullDiagnosticsDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts)
|
||||
- [languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts)
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts)
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts)
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts)
|
||||
- [languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts)
|
||||
- [languageService/tooltipUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts)
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts)
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts)
|
||||
- [src/nodeMain.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeMain.ts)
|
||||
- [src/nodeServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeServer.ts)
|
||||
- [parser/characterStream.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characterStream.ts)
|
||||
- [parser/characters.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characters.ts)
|
||||
- [parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
- [parser/stringTokenUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts)
|
||||
- [parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts)
|
||||
- [parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts)
|
||||
- [src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts)
|
||||
- [src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts)
|
||||
- [src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts)
|
||||
- [src/readonlyAugmentedFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts)
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts)
|
||||
- [analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts)
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts)
|
||||
- [analyzer/docStringConversion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringConversion.ts)
|
||||
- [analyzer/docStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/docStringUtils.ts)
|
||||
- [analyzer/importLogger.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importLogger.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/importResolverTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts)
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts)
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts)
|
||||
- [analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts)
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts)
|
||||
- [analyzer/programTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts)
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts)
|
||||
- [analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts)
|
||||
- [analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts)
|
||||
- [analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts)
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts)
|
||||
- [commands/commands.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commands.ts)
|
||||
- [uri/fileUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/fileUri.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts)
|
||||
- [parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
- [parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts)
|
||||
- [parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts)
|
||||
- [src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
115
architecture/generated/subsystems/languageservice.md
Normal file
115
architecture/generated/subsystems/languageservice.md
Normal file
@@ -0,0 +1,115 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `languageService`
|
||||
|
||||
Source files under `languageService/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 23
|
||||
- **Symbols (leaves)**: 300
|
||||
|
||||
## Language Service Providers
|
||||
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts#L1-L166) — Runs and clones AnalyzerService and builds command-line options from server settings
|
||||
- [languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts#L1-L859) — Provides auto-import completion logic and utilities for finding module symbols and generating import edits
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts#L1-L628) — Provides call hierarchy items (callers and callees) for a code position across the workspace
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts#L1-L78) — Provides quick-fix code actions for diagnostics, including a create-type-stub action
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts#L1-L3698) — Provides Python language completion items for a source position using type and symbol analysis
|
||||
- [languageService/completionProviderUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts#L1-L252) — Helper utilities for completion items: type details, formatted documentation, and trailing overlap detection
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts#L1-L348) — Maps positions to symbol and type declarations for go-to-definition and type-definition features
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts#L1-L76) — Provides document highlights for a name at a given position, classifying occurrences as read or write
|
||||
- [languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts#L1-L622) — Collects and resolves symbol declarations and references within a parse tree for document-level symbol occurrences
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts#L1-L147) — Provides document symbol extraction and conversion to hierarchical or flat LSP SymbolInformation for a source file
|
||||
- [languageService/dynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts#L1-L75) — Manages dynamic LSP features with register/update/dispose logic and a registry for multiple features
|
||||
- [languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts#L1-L79) — Registers LSP file-watcher notifications for workspace config files and Python search paths
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts#L1-L682) — Generates editor hover tooltips for Python symbols with type info, signatures, and documentation
|
||||
- [languageService/importSorter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts#L1-L197) — Sorts and formats top-level Python import statements and produces TextEditAction replacements
|
||||
- [languageService/navigationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts#L1-L33) — Provides helpers to check file navigability and convert DocumentRange objects to LSP Location values
|
||||
- [languageService/pullDiagnosticsDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts#L1-L52) — Registers and manages pull-mode diagnostics and workspace support with the language server
|
||||
- [languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts#L1-L45) — Provides quick action handlers for source files such as ordering imports
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts#L1-L528) — Finds symbol references in files and returns DocumentRange/LSP locations
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts#L1-L204) — Provides rename support: checks rename eligibility and produces workspace edits for a symbol and its references
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts#L1-L488) — Provides signature help for Python call sites by mapping a cursor position to callable signatures and parameter info
|
||||
- [languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts#L1-L219) — Indexes all externally visible symbols and aliases in a source file into structured metadata
|
||||
- [languageService/tooltipUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts#L1-L846) — Formats and generates hover/completion tooltips and documentation text for types, functions, classes, and symbols
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts#L1-L162) — Provides workspace symbol search for the language server across user code
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts)
|
||||
- [commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts)
|
||||
- [analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts)
|
||||
- [analyzer/constructors.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts)
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts)
|
||||
- [analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts)
|
||||
- [analyzer/enums.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/enums.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/importResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts)
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts)
|
||||
- [analyzer/parameterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts)
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts)
|
||||
- [analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts)
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts)
|
||||
- [analyzer/scope.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scope.ts)
|
||||
- [analyzer/scopeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceFileInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfoUtils.ts)
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts)
|
||||
- [analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts)
|
||||
- [analyzer/symbolNameUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolNameUtils.ts)
|
||||
- [analyzer/symbolUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbolUtils.ts)
|
||||
- [analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts)
|
||||
- [analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts)
|
||||
- [analyzer/typePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts)
|
||||
- [analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts)
|
||||
- [analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts)
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
- [commands/commands.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commands.ts)
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts)
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts)
|
||||
- [common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts)
|
||||
- [common/commandUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandUtils.ts)
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [common/console.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/console.ts)
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts)
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [common/docRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docRange.ts)
|
||||
- [common/docStringService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docStringService.ts)
|
||||
- [common/editAction.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/editAction.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [common/lspUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/lspUtils.ts)
|
||||
- [common/pathConsts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathConsts.ts)
|
||||
- [common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts)
|
||||
- [common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts)
|
||||
- [common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [common/stringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/stringUtils.ts)
|
||||
- [common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts)
|
||||
- [common/textRangeCollection.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts)
|
||||
- [uri/emptyUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/emptyUri.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts)
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts)
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts)
|
||||
- [parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
- [parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts)
|
||||
- [parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
46
architecture/generated/subsystems/localization.md
Normal file
46
architecture/generated/subsystems/localization.md
Normal file
@@ -0,0 +1,46 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `localization`
|
||||
|
||||
Source files under `localization/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 1
|
||||
- **Symbols (leaves)**: 13
|
||||
|
||||
## Diagnostics and Configuration
|
||||
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts#L1-L1704) — Localization utilities and parameterized string formatting for retrieving locale-specific message strings
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts)
|
||||
- [analyzer/constraintSolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constraintSolver.ts)
|
||||
- [analyzer/constructorTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts)
|
||||
- [analyzer/dataClasses.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts)
|
||||
- [analyzer/functionTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts)
|
||||
- [analyzer/namedTuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts)
|
||||
- [analyzer/operations.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/operations.ts)
|
||||
- [analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts)
|
||||
- [analyzer/properties.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/properties.ts)
|
||||
- [analyzer/protocols.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/protocols.ts)
|
||||
- [analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/tuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts)
|
||||
- [analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
- [analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts)
|
||||
110
architecture/generated/subsystems/parser.md
Normal file
110
architecture/generated/subsystems/parser.md
Normal file
@@ -0,0 +1,110 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `parser`
|
||||
|
||||
Source files under `parser/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 9
|
||||
- **Symbols (leaves)**: 223
|
||||
|
||||
## Parser, Binder, and Symbols
|
||||
|
||||
- [parser/characterStream.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characterStream.ts#L1-L167) — Provides a character stream for inspecting and advancing through text used by parsers and tokenizers
|
||||
- [parser/characters.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/characters.ts#L1-L285) — Classifies Unicode characters and provides fast lookup helpers for identifier tokenization
|
||||
- [parser/parseNodeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodeUtils.ts#L1-L162) — Maps parse node and operator string names to their enum values and provides reverse lookup maps
|
||||
- [parser/parseNodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parseNodes.ts#L1-L2864) — Parse node types, enums, and helper functions for representing and manipulating Python AST nodes
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts#L1-L5465) — Parses Python source tokens into an abstract syntax tree and reports diagnostics
|
||||
- [parser/stringTokenUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/stringTokenUtils.ts#L1-L384) — Unescapes escaped string tokens and returns the unescaped value, escape errors, and non-ASCII/bytes info
|
||||
- [parser/tokenizer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizer.ts#L1-L2246) — Converts Python source into a stream of lexed tokens for parsing and analysis
|
||||
- [parser/tokenizerTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/tokenizerTypes.ts#L1-L619) — Defines enums, interfaces, and factory creators for Python tokenizer tokens and comments
|
||||
- [parser/unicode.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/unicode.ts#L1-L3649) — Unicode character range tables used by the Python language specification
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/analyzerNodeInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerNodeInfo.ts)
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [analyzer/cellChainIndex.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts)
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [analyzer/codeFlowEngine.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowEngine.ts)
|
||||
- [analyzer/codeFlowTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowTypes.ts)
|
||||
- [analyzer/codeFlowUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/codeFlowUtils.ts)
|
||||
- [analyzer/commentUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/commentUtils.ts)
|
||||
- [analyzer/constructorTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructorTransform.ts)
|
||||
- [analyzer/constructors.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/constructors.ts)
|
||||
- [analyzer/dataClasses.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/dataClasses.ts)
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts)
|
||||
- [analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts)
|
||||
- [analyzer/decorators.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/decorators.ts)
|
||||
- [analyzer/enums.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/enums.ts)
|
||||
- [analyzer/functionTransform.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/functionTransform.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts)
|
||||
- [analyzer/namedTuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/namedTuples.ts)
|
||||
- [analyzer/operations.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/operations.ts)
|
||||
- [analyzer/parameterUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parameterUtils.ts)
|
||||
- [analyzer/parseTreeCleaner.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeCleaner.ts)
|
||||
- [analyzer/parseTreeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeUtils.ts)
|
||||
- [analyzer/parseTreeWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parseTreeWalker.ts)
|
||||
- [analyzer/patternMatching.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/patternMatching.ts)
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts)
|
||||
- [analyzer/properties.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/properties.ts)
|
||||
- [analyzer/scopeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/scopeUtils.ts)
|
||||
- [analyzer/sentinel.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sentinel.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts)
|
||||
- [analyzer/staticExpressions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/staticExpressions.ts)
|
||||
- [analyzer/symbol.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/symbol.ts)
|
||||
- [analyzer/testWalker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/testWalker.ts)
|
||||
- [analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts)
|
||||
- [analyzer/tuples.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tuples.ts)
|
||||
- [analyzer/typeCacheUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeCacheUtils.ts)
|
||||
- [analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts)
|
||||
- [analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
- [analyzer/typeEvaluatorTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluatorTypes.ts)
|
||||
- [analyzer/typeGuards.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeGuards.ts)
|
||||
- [analyzer/typePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typePrinter.ts)
|
||||
- [analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts)
|
||||
- [analyzer/typeUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeUtils.ts)
|
||||
- [analyzer/typedDicts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typedDicts.ts)
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts)
|
||||
- [common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts)
|
||||
- [common/textEditTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts)
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts)
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts)
|
||||
- [languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts)
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts)
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts)
|
||||
- [languageService/importSorter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/importSorter.ts)
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts)
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts)
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts)
|
||||
- [languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts)
|
||||
- [languageService/tooltipUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/tooltipUtils.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [common/charCodes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/charCodes.ts)
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts)
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts)
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts)
|
||||
- [common/positionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/positionUtils.ts)
|
||||
- [common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts)
|
||||
- [common/stringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/stringUtils.ts)
|
||||
- [common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts)
|
||||
- [common/textRangeCollection.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRangeCollection.ts)
|
||||
- [common/timing.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/timing.ts)
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts)
|
||||
16
architecture/generated/subsystems/pprof.md
Normal file
16
architecture/generated/subsystems/pprof.md
Normal file
@@ -0,0 +1,16 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `pprof`
|
||||
|
||||
Source files under `pprof/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 1
|
||||
- **Symbols (leaves)**: 4
|
||||
|
||||
## Shared Runtime Infrastructure
|
||||
|
||||
- [pprof/profiler.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pprof/profiler.ts#L1-L64) — Starts and stops Datadog pprof CPU profiling and saves encoded profiles to disk
|
||||
137
architecture/generated/subsystems/src.md
Normal file
137
architecture/generated/subsystems/src.md
Normal file
@@ -0,0 +1,137 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `src`
|
||||
|
||||
Source files under `src/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 18
|
||||
- **Symbols (leaves)**: 296
|
||||
|
||||
## CLI and VS Code Extension
|
||||
|
||||
- [src/nodeMain.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeMain.ts#L1-L23) — Entrypoint that starts the Pyright Node server and its background analysis runner
|
||||
- [src/nodeServer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/nodeServer.ts#L1-L29) — Starts and configures the Pyright language server in Node, initializing deps and handling main vs worker threads
|
||||
- [src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts#L1-L1400) — Command-line entry point for the Pyright type checker, handling CLI args, diagnostics, and running analysis
|
||||
- [src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts#L1-L50) — FileSystem wrapper that remaps URIs and delegates mutable file operations to an underlying real filesystem
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts#L1-L333) — Implements the Pyright language server, handling workspace settings, background analysis, commands, and code actions
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts#L1-L457) — Manages creation, initialization, and lifecycle of language server workspaces for the Pyright analyzer
|
||||
- [src/langserver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright/src/langserver.ts#L1-L5) — Starts the Pyright command-line entrypoint with zero worker threads
|
||||
- [src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright/src/pyright.ts#L1-L4) — Starts the Pyright CLI
|
||||
- [src/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/cancellationUtils.ts#L1-L99) — Provides a file-based cancellation strategy for the language server protocol
|
||||
- [src/extension.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/extension.ts#L1-L407) — Registers and manages the Pyright language server client and related VS Code commands and configuration
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/vscode-pyright/src/server.ts#L1-L7) — Starts the Pyright VS Code language server with one background worker
|
||||
|
||||
## Import Resolution and Packaging
|
||||
|
||||
- [src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts#L1-L181) — Maps partially typed stub packages into corresponding installed library directories and provides a no-op alternative
|
||||
|
||||
## Language Service Providers
|
||||
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts#L1-L1620) — Provides core language server functionality and LSP handlers for Pyright
|
||||
|
||||
## Shared Runtime Infrastructure
|
||||
|
||||
- [src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts#L1-L66) — Provides classes to spawn and coordinate Pyright background analysis workers and runners
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts#L1-L898) — Runs the analyzer in a background worker and manages program views, diagnostics, and result serialization
|
||||
- [src/backgroundThreadBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts#L1-L287) — Provides background thread classes and helpers for message serialization, logging, and cancellation
|
||||
- [src/readonlyAugmentedFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts#L1-L271) — Provides a read-only augmented FileSystem that overlays mapped directories onto a backing FileSystem
|
||||
- [src/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/types.ts#L1-L40) — Exports types describing language server client capabilities and initialization options
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts)
|
||||
- [commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts)
|
||||
- [common/envVarUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts)
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [analyzer/analysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analysis.ts)
|
||||
- [analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts)
|
||||
- [analyzer/cacheManager.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cacheManager.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/packageTypeReport.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts)
|
||||
- [analyzer/packageTypeVerifier.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts)
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts)
|
||||
- [analyzer/pyTypedUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts)
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFileInfo.ts)
|
||||
- [analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts)
|
||||
- [commands/commandController.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandController.ts)
|
||||
- [commands/commandResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/commandResult.ts)
|
||||
- [common/asyncInitialization.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/asyncInitialization.ts)
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts)
|
||||
- [common/caseSensitivityDetector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts)
|
||||
- [common/chokidarFileWatcherProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/chokidarFileWatcherProvider.ts)
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts)
|
||||
- [common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts)
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [common/console.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/console.ts)
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts)
|
||||
- [common/debug.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/debug.ts)
|
||||
- [common/deferred.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/deferred.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [common/diagnosticRules.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticRules.ts)
|
||||
- [common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts)
|
||||
- [common/docRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docRange.ts)
|
||||
- [common/envVarUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/extensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensions.ts)
|
||||
- [common/fileBasedCancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts)
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts)
|
||||
- [common/fileWatcher.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts)
|
||||
- [common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts)
|
||||
- [common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [common/logTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/logTracker.ts)
|
||||
- [common/lspUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/lspUtils.ts)
|
||||
- [common/pathConsts.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathConsts.ts)
|
||||
- [common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts)
|
||||
- [common/progressReporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/progressReporter.ts)
|
||||
- [common/pythonVersion.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pythonVersion.ts)
|
||||
- [common/realFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [common/streamUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/streamUtils.ts)
|
||||
- [common/textRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textRange.ts)
|
||||
- [common/timing.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/timing.ts)
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts)
|
||||
- [uri/uriMap.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts)
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts)
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts)
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts)
|
||||
- [languageService/documentSymbolCollector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolCollector.ts)
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts)
|
||||
- [languageService/dynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/dynamicFeature.ts)
|
||||
- [languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts)
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts)
|
||||
- [languageService/navigationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts)
|
||||
- [languageService/pullDiagnosticsDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/pullDiagnosticsDynamicFeature.ts)
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts)
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts)
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts)
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts)
|
||||
- [localization/localize.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/localization/localize.ts)
|
||||
- [parser/parser.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/parser/parser.ts)
|
||||
126
architecture/generated/subsystems/uri.md
Normal file
126
architecture/generated/subsystems/uri.md
Normal file
@@ -0,0 +1,126 @@
|
||||
<!--
|
||||
Generated by the pyrx RPG docs pipeline from ../../.rpg/rpg_encoder.json.
|
||||
Do not edit directly — changes will be overwritten by the next refresh.
|
||||
Graph repo_sha: 784698179a5627072df39bbe0fcadb55bb7dd408
|
||||
Graph generated_at: 2026-06-10T00:19:36.841Z
|
||||
-->
|
||||
# Subsystem: `uri`
|
||||
|
||||
Source files under `uri/`. Grouped by the functional area each file was assigned to during semantic lifting.
|
||||
|
||||
- **Files**: 10
|
||||
- **Symbols (leaves)**: 177
|
||||
|
||||
## Shared Runtime Infrastructure
|
||||
|
||||
- [uri/baseUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/baseUri.ts#L1-L307) — Defines an abstract BaseUri class representing URIs and providing common path and extension utilities
|
||||
- [uri/constantUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/constantUri.ts#L1-L142) — Immutable marker URI type with no filesystem semantics and identity-based equality
|
||||
- [uri/emptyUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/emptyUri.ts#L1-L43) — Defines a singleton EmptyUri class representing an empty URI value
|
||||
- [uri/fileUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/fileUri.ts#L1-L302) — Represents file-schemed URIs for filesystem paths and provides path, query, fragment, and resolution utilities
|
||||
- [uri/memoization.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/memoization.ts#L1-L86) — Provides decorators to memoize property getters, no-arg instance methods, and static methods with LRU caching
|
||||
- [uri/uri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uri.ts#L1-L227) — Manages URI creation, parsing, normalization, and helpers for file, web, constant, and empty URI types
|
||||
- [uri/uriInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriInterface.ts#L1-L102) — Uri interface for representing and manipulating URIs, including path, fragment, query, and extension helpers
|
||||
- [uri/uriMap.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriMap.ts#L1-L81) — Map keyed by Uri for storing and iterating Uri-to-value mappings
|
||||
- [uri/uriUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/uriUtils.ts#L1-L459) — Utilities for URI and filesystem operations, including wildcard file specs, directory entries, and path helpers
|
||||
- [uri/webUri.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/uri/webUri.ts#L1-L295) — Implements a WebUri class representing non-file URIs and exposing path, query, fragment, and manipulation methods
|
||||
|
||||
## Cross-subsystem dependencies
|
||||
|
||||
**Imported by (external):**
|
||||
|
||||
- [analyzer/analyzerFileInfo.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/analyzerFileInfo.ts)
|
||||
- [analyzer/backgroundAnalysisProgram.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts)
|
||||
- [analyzer/binder.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/binder.ts)
|
||||
- [analyzer/cellChainIndex.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/cellChainIndex.ts)
|
||||
- [analyzer/checker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/checker.ts)
|
||||
- [analyzer/circularDependency.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/circularDependency.ts)
|
||||
- [analyzer/declaration.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declaration.ts)
|
||||
- [analyzer/declarationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/declarationUtils.ts)
|
||||
- [analyzer/importResolver.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolver.ts)
|
||||
- [analyzer/importResolverFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverFileSystem.ts)
|
||||
- [analyzer/importResolverTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResolverTypes.ts)
|
||||
- [analyzer/importResult.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importResult.ts)
|
||||
- [analyzer/importStatementUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/importStatementUtils.ts)
|
||||
- [analyzer/packageTypeReport.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeReport.ts)
|
||||
- [analyzer/packageTypeVerifier.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/packageTypeVerifier.ts)
|
||||
- [analyzer/parentDirectoryCache.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/parentDirectoryCache.ts)
|
||||
- [analyzer/program.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/program.ts)
|
||||
- [analyzer/programTypes.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/programTypes.ts)
|
||||
- [analyzer/pyTypedUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pyTypedUtils.ts)
|
||||
- [analyzer/pythonPathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/pythonPathUtils.ts)
|
||||
- [analyzer/service.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/service.ts)
|
||||
- [analyzer/serviceUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/serviceUtils.ts)
|
||||
- [analyzer/sourceEnumerator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceEnumerator.ts)
|
||||
- [analyzer/sourceFile.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceFile.ts)
|
||||
- [analyzer/sourceMapper.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapper.ts)
|
||||
- [analyzer/sourceMapperUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/sourceMapperUtils.ts)
|
||||
- [analyzer/tracePrinter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/tracePrinter.ts)
|
||||
- [analyzer/typeDocStringUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeDocStringUtils.ts)
|
||||
- [analyzer/typeEvaluator.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeEvaluator.ts)
|
||||
- [analyzer/typeStubWriter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeStubWriter.ts)
|
||||
- [analyzer/types.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/types.ts)
|
||||
- [analyzer/typeshedInfoProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/analyzer/typeshedInfoProvider.ts)
|
||||
- [src/backgroundAnalysis.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysis.ts)
|
||||
- [src/backgroundAnalysisBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundAnalysisBase.ts)
|
||||
- [src/backgroundThreadBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/backgroundThreadBase.ts)
|
||||
- [commands/createTypeStub.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/createTypeStub.ts)
|
||||
- [commands/dumpFileDebugInfoCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/dumpFileDebugInfoCommand.ts)
|
||||
- [commands/quickActionCommand.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/commands/quickActionCommand.ts)
|
||||
- [common/cancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/cancellationUtils.ts)
|
||||
- [common/commandLineOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandLineOptions.ts)
|
||||
- [common/commandUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/commandUtils.ts)
|
||||
- [common/configOptions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/configOptions.ts)
|
||||
- [common/diagnostic.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnostic.ts)
|
||||
- [common/diagnosticSink.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/diagnosticSink.ts)
|
||||
- [common/docRange.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docRange.ts)
|
||||
- [common/docStringService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/docStringService.ts)
|
||||
- [common/editAction.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/editAction.ts)
|
||||
- [common/envVarUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/envVarUtils.ts)
|
||||
- [common/extensibility.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/extensibility.ts)
|
||||
- [common/fileBasedCancellationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileBasedCancellationUtils.ts)
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts)
|
||||
- [common/fileWatcher.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileWatcher.ts)
|
||||
- [common/fullAccessHost.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fullAccessHost.ts)
|
||||
- [common/host.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/host.ts)
|
||||
- [common/languageInfoUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageInfoUtils.ts)
|
||||
- [common/languageServerInterface.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/languageServerInterface.ts)
|
||||
- [common/logTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/logTracker.ts)
|
||||
- [common/realFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/realFileSystem.ts)
|
||||
- [common/serviceProviderExtensions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProviderExtensions.ts)
|
||||
- [common/textEditTracker.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/textEditTracker.ts)
|
||||
- [common/workspaceEditUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/workspaceEditUtils.ts)
|
||||
- [src/languageServerBase.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageServerBase.ts)
|
||||
- [languageService/analyzerServiceExecutor.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/analyzerServiceExecutor.ts)
|
||||
- [languageService/autoImporter.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/autoImporter.ts)
|
||||
- [languageService/callHierarchyProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/callHierarchyProvider.ts)
|
||||
- [languageService/codeActionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/codeActionProvider.ts)
|
||||
- [languageService/completionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProvider.ts)
|
||||
- [languageService/completionProviderUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/completionProviderUtils.ts)
|
||||
- [languageService/definitionProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/definitionProvider.ts)
|
||||
- [languageService/documentHighlightProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentHighlightProvider.ts)
|
||||
- [languageService/documentSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/documentSymbolProvider.ts)
|
||||
- [languageService/fileWatcherDynamicFeature.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/fileWatcherDynamicFeature.ts)
|
||||
- [languageService/hoverProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/hoverProvider.ts)
|
||||
- [languageService/navigationUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/navigationUtils.ts)
|
||||
- [languageService/quickActions.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/quickActions.ts)
|
||||
- [languageService/referencesProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/referencesProvider.ts)
|
||||
- [languageService/renameProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/renameProvider.ts)
|
||||
- [languageService/signatureHelpProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/signatureHelpProvider.ts)
|
||||
- [languageService/symbolIndexer.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/symbolIndexer.ts)
|
||||
- [languageService/workspaceSymbolProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/languageService/workspaceSymbolProvider.ts)
|
||||
- [src/partialStubService.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/partialStubService.ts)
|
||||
- [src/pyright.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyright.ts)
|
||||
- [src/pyrightFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/pyrightFileSystem.ts)
|
||||
- [src/readonlyAugmentedFileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/readonlyAugmentedFileSystem.ts)
|
||||
- [src/server.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/server.ts)
|
||||
- [src/workspaceFactory.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/workspaceFactory.ts)
|
||||
|
||||
**Imports (external):**
|
||||
|
||||
- [common/caseSensitivityDetector.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/caseSensitivityDetector.ts)
|
||||
- [common/collectionUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/collectionUtils.ts)
|
||||
- [common/core.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/core.ts)
|
||||
- [common/fileSystem.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/fileSystem.ts)
|
||||
- [common/pathUtils.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/pathUtils.ts)
|
||||
- [common/serviceKeys.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceKeys.ts)
|
||||
- [common/serviceProvider.ts](https://github.com/microsoft/pyrx/blob/784698179a5627072df39bbe0fcadb55bb7dd408/packages/pyright/packages/pyright-internal/src/common/serviceProvider.ts)
|
||||
323
build/azuredevops/azure-pipelines-release.yml
Normal file
323
build/azuredevops/azure-pipelines-release.yml
Normal file
@@ -0,0 +1,323 @@
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- refs/tags/*
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
variables:
|
||||
- name: TeamName
|
||||
value: Pyright
|
||||
- name: VSIX_NAME
|
||||
value: vscode-pyright.vsix
|
||||
- name: ARTIFACT_NAME_VSIX
|
||||
value: vsix
|
||||
- name: PACKAGE_NAME
|
||||
value: pyright.tgz
|
||||
- name: ARTIFACT_NAME_PACKAGE
|
||||
value: pyright
|
||||
- name: AZURE_ARTIFACTS_FEED
|
||||
value: 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/'
|
||||
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.Publish.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
sdl:
|
||||
codeSignValidation:
|
||||
enabled: true
|
||||
additionalTargetsGlobPattern: -|**/gdn-vscode-pyright.vsix/**
|
||||
codeql:
|
||||
compiled:
|
||||
enabled: false
|
||||
justificationForDisabling: 'Running a scan on the Pyright-Build azure-pipelines.yml'
|
||||
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: 1ESPT-Ubuntu22.04
|
||||
os: linux
|
||||
customBuildTags:
|
||||
- ES365AIMigrationTooling
|
||||
stages:
|
||||
- stage: BuildVsix
|
||||
jobs:
|
||||
- job: build_vsix
|
||||
displayName: Build VSIX
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
name: VSEngSS-MicroBuild2022-1ES # use windows for codesigning to make things easier https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/650/MicroBuild-Signing
|
||||
os: windows
|
||||
templateContext:
|
||||
mb:
|
||||
signing:
|
||||
enabled: true
|
||||
signType: 'real'
|
||||
signWithProd: true
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: 'publish vsix artifact'
|
||||
targetPath: 'build_output'
|
||||
artifactName: $(ARTIFACT_NAME_VSIX)
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
clean: true
|
||||
submodules: true
|
||||
fetchTags: false
|
||||
persistCredentials: True
|
||||
- task: NodeTool@0
|
||||
displayName: Use Node 24.15.0
|
||||
inputs:
|
||||
versionSpec: 24.15.0
|
||||
- template: /build/templates/npmAuthenticate.yml@self
|
||||
- task: CmdLine@2
|
||||
displayName: npm install
|
||||
inputs:
|
||||
script: npm run install:all
|
||||
- task: CmdLine@2
|
||||
displayName: Package VSIX
|
||||
inputs:
|
||||
script: |
|
||||
npm run package
|
||||
workingDirectory: packages/vscode-pyright
|
||||
|
||||
- task: PowerShell@2
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: 'Move-Item -Path "pyright-*.vsix" -Destination "$(VSIX_NAME)"'
|
||||
workingDirectory: packages/vscode-pyright
|
||||
displayName: 'Move VSIX file'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy vsix to: build_output'
|
||||
inputs:
|
||||
SourceFolder: packages/vscode-pyright
|
||||
Contents: '$(VSIX_NAME)'
|
||||
TargetFolder: build_output
|
||||
|
||||
- script: |
|
||||
npm install -g @vscode/vsce
|
||||
displayName: 'Install vsce and dependencies'
|
||||
|
||||
- script: npx vsce generate-manifest -i $(VSIX_NAME) -o extension.manifest
|
||||
displayName: 'Generate extension manifest'
|
||||
workingDirectory: packages/vscode-pyright
|
||||
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: 'Install NuGet'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
inputs:
|
||||
command: 'restore'
|
||||
restoreSolution: '$(Build.SourcesDirectory)/packages/vscode-pyright/packages.config'
|
||||
restoreDirectory: '$(Build.SourcesDirectory)/packages/vscode-pyright/packages'
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Sign binaries'
|
||||
inputs:
|
||||
solution: 'packages/vscode-pyright/sign.proj'
|
||||
msbuildArguments: '/verbosity:diagnostic /p:SignType=real'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Compare extension.manifest and extension.signature.p7s'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
$manifestPath = "$(Build.SourcesDirectory)\packages\vscode-pyright\extension.manifest"
|
||||
$signaturePath = "$(Build.SourcesDirectory)\packages\vscode-pyright\extension.signature.p7s"
|
||||
$compareResult = Compare-Object (Get-Content $manifestPath) (Get-Content $signaturePath)
|
||||
if ($compareResult -eq $null) {
|
||||
Write-Error "Files are identical. Failing the build."
|
||||
exit 1
|
||||
} else {
|
||||
Write-Output "Files are different."
|
||||
}
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy extension.manifest'
|
||||
inputs:
|
||||
SourceFolder: 'packages/vscode-pyright'
|
||||
Contents: 'extension.manifest'
|
||||
TargetFolder: build_output
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy extension.signature.p7s'
|
||||
inputs:
|
||||
SourceFolder: 'packages/vscode-pyright'
|
||||
Contents: 'extension.signature.p7s'
|
||||
TargetFolder: build_output
|
||||
|
||||
- stage: BuildNpm
|
||||
dependsOn: # Blank to allow running in parallel with BuildVsix
|
||||
jobs:
|
||||
- job: build_npm
|
||||
displayName: Build NPM
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)/${{ variables.ARTIFACT_NAME_PACKAGE }}/${{ variables.PACKAGE_NAME }}'
|
||||
sbomBuildDropPath: '$(Build.ArtifactStagingDirectory)/${{ variables.ARTIFACT_NAME_PACKAGE }}'
|
||||
artifactName: ${{ variables.ARTIFACT_NAME_PACKAGE }}
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
clean: true
|
||||
submodules: true
|
||||
fetchTags: false
|
||||
persistCredentials: True
|
||||
- task: NodeTool@0
|
||||
displayName: Use Node 24.15.0
|
||||
inputs:
|
||||
versionSpec: 24.15.0
|
||||
- template: /build/templates/npmAuthenticate.yml@self
|
||||
- task: CmdLine@2
|
||||
displayName: npm install
|
||||
inputs:
|
||||
script: npm run install:all
|
||||
|
||||
- script: npm pack
|
||||
displayName: npm pack
|
||||
workingDirectory: packages/pyright
|
||||
|
||||
- script: mv pyright-*.tgz ${{ variables.PACKAGE_NAME }}
|
||||
displayName: Remove version from package name
|
||||
workingDirectory: packages/pyright
|
||||
|
||||
# CredScan does not understand scanning a single file. So, it will default to scanning the whole folder that your output is pointing to.
|
||||
# We don't want it to scan the microbuild plugins, which is installed in the agent.stagedirectory by default.
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy ${{ variables.PACKAGE_NAME }} to subfolder'
|
||||
inputs:
|
||||
SourceFolder: packages/pyright
|
||||
Contents: '${{ variables.PACKAGE_NAME }}'
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/${{ variables.ARTIFACT_NAME_PACKAGE }}'
|
||||
|
||||
- stage: CreateRelease
|
||||
dependsOn:
|
||||
- BuildVsix
|
||||
- BuildNpm
|
||||
jobs:
|
||||
- job: create_release
|
||||
displayName: Create GitHub Release
|
||||
templateContext:
|
||||
type: releaseJob
|
||||
isProduction: true
|
||||
inputs:
|
||||
- input: pipelineArtifact
|
||||
artifactName: $(ARTIFACT_NAME_VSIX)
|
||||
targetPath: $(Pipeline.Workspace)/$(ARTIFACT_NAME_VSIX)
|
||||
- input: pipelineArtifact
|
||||
artifactName: $(ARTIFACT_NAME_PACKAGE)
|
||||
targetPath: $(Pipeline.Workspace)/$(ARTIFACT_NAME_PACKAGE)
|
||||
steps:
|
||||
- checkout: none
|
||||
# Next step fails the build if https://github.com/microsoft/pyright/issues/10350 repros.
|
||||
- script: |
|
||||
mkdir pyrightTest
|
||||
cd pyrightTest
|
||||
yarn
|
||||
yarn add --dev $(Pipeline.Workspace)/$(ARTIFACT_NAME_PACKAGE)/$(PACKAGE_NAME)
|
||||
node_modules/.bin/pyright --version
|
||||
displayName: Validate npm package
|
||||
- task: GitHubRelease@1 #https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/github-release-v1?view=azure-pipelines
|
||||
displayName: 'Create GitHub Release'
|
||||
inputs:
|
||||
gitHubConnection: 'Github-Pylance' # The name of the GitHub service connection
|
||||
repositoryName: 'microsoft/pyright' # The name of your GitHub repository
|
||||
action: 'create'
|
||||
isDraft: true
|
||||
isPreRelease: false
|
||||
addChangeLog: true
|
||||
title: 'Published $(Build.SourceBranchName)'
|
||||
assets: |
|
||||
$(Pipeline.Workspace)/$(ARTIFACT_NAME_VSIX)/$(VSIX_NAME)
|
||||
$(Pipeline.Workspace)/$(ARTIFACT_NAME_PACKAGE)/$(PACKAGE_NAME)
|
||||
|
||||
- stage: WaitForValidation
|
||||
dependsOn:
|
||||
- CreateRelease
|
||||
jobs:
|
||||
- job: wait_for_validation
|
||||
displayName: Wait for manual validation
|
||||
pool: server
|
||||
templateContext:
|
||||
mb:
|
||||
publish:
|
||||
enabled: false
|
||||
steps:
|
||||
- task: ManualValidation@0
|
||||
timeoutInMinutes: 120 # task times out in 2 hours
|
||||
inputs:
|
||||
notifyUsers: '[DevDiv]\Python.Language Server,eric@traut.com'
|
||||
instructions: 'In the next 2 hours please test the latest draft release of Pyright, then Publish the release in GitHub.'
|
||||
onTimeout: 'reject' # require sign-off
|
||||
|
||||
- stage: PublishToMarketplace
|
||||
dependsOn:
|
||||
- WaitForValidation
|
||||
jobs:
|
||||
- job: publish_extension
|
||||
displayName: Publish extension to marketplace
|
||||
steps:
|
||||
- checkout: none
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 24.15.0
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Artifacts from Validation Job'
|
||||
inputs:
|
||||
buildType: 'current'
|
||||
artifactName: '$(ARTIFACT_NAME_VSIX)'
|
||||
targetPath: '$(System.ArtifactsDirectory)'
|
||||
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension
|
||||
# Install dependencies and VS Code Extension Manager (vsce >= v2.26.1 needed)
|
||||
- script: |
|
||||
npm install -g @vscode/vsce
|
||||
displayName: 'Install vsce and dependencies'
|
||||
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token
|
||||
# Publish to Marketplace
|
||||
# see. stackoverflow.com/collectives/ci-cd/articles/76873787/publish-azure-devops-extensions-using-azure-workload-identity
|
||||
# az rest -u https://app.vssps.visualstudio.com/_apis/profile/profiles/me --resource 499b84ac-1321-427f-aa17-267ca6975798
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Publishing with Managed Identity'
|
||||
inputs:
|
||||
azureSubscription: PyrightPublishPipelineSecureConnectionWithManagedIdentity
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
$aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
|
||||
vsce publish --pat $aadToken --packagePath $(System.ArtifactsDirectory)/$(VSIX_NAME) --noVerify --manifestPath $(System.ArtifactsDirectory)/extension.manifest --signaturePath $(System.ArtifactsDirectory)/extension.signature.p7s
|
||||
|
||||
- stage: PublishToNpm
|
||||
dependsOn:
|
||||
- WaitForValidation
|
||||
- PublishToMarketplace
|
||||
jobs:
|
||||
- job: publish_package
|
||||
displayName: Publish package to NPM
|
||||
|
||||
pool:
|
||||
name: VSEngSS-MicroBuild2022-1ES # This pool is required to have the certs needed to publish using ESRP.
|
||||
os: windows
|
||||
image: server2022-microbuildVS2022-1es
|
||||
|
||||
templateContext:
|
||||
type: releaseJob
|
||||
isProduction: true
|
||||
inputs:
|
||||
- input: pipelineArtifact
|
||||
artifactName: $(ARTIFACT_NAME_PACKAGE)
|
||||
targetPath: $(Build.StagingDirectory)/dist
|
||||
|
||||
steps:
|
||||
- template: MicroBuild.Publish.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
intent: PackageDistribution
|
||||
contentType: npm
|
||||
contentSource: Folder
|
||||
folderLocation: $(Build.StagingDirectory)/dist
|
||||
waitForReleaseCompletion: true
|
||||
owners: rchiodo@microsoft.com
|
||||
approvers: grwheele@microsoft.com
|
||||
62
build/azuredevops/azure-pipelines.yml
Normal file
62
build/azuredevops/azure-pipelines.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
trigger: none
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
variables:
|
||||
- name: SigningType
|
||||
value: 'real'
|
||||
- name: TeamName
|
||||
value: Pyright
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
sdl:
|
||||
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
demands:
|
||||
- ImageOverride -equals 1ESPT-Ubuntu22.04
|
||||
os: Linux
|
||||
customBuildTags:
|
||||
- ES365AIMigrationTooling
|
||||
stages:
|
||||
- stage: stage
|
||||
jobs:
|
||||
- job: build
|
||||
displayName: Build VSIX
|
||||
timeoutInMinutes: 720
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
displayName: 'publish vsix artifact'
|
||||
targetPath: build_output
|
||||
artifactName: vsix-win
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
fetchTags: true
|
||||
persistCredentials: True
|
||||
- task: NodeTool@0
|
||||
displayName: Use Node 24.15.0
|
||||
inputs:
|
||||
versionSpec: 24.15.0
|
||||
- task: CmdLine@2
|
||||
displayName: npm install
|
||||
inputs:
|
||||
script: npm run install:all
|
||||
- task: CmdLine@2
|
||||
displayName: Package VSIX
|
||||
inputs:
|
||||
script: |
|
||||
npm run package
|
||||
workingDirectory: packages/vscode-pyright
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy vsix to: build_output'
|
||||
inputs:
|
||||
SourceFolder: packages/vscode-pyright
|
||||
Contents: '*.vsix'
|
||||
TargetFolder: build_output
|
||||
206
build/generateUnicodeTables.py
Normal file
206
build/generateUnicodeTables.py
Normal file
@@ -0,0 +1,206 @@
|
||||
# generateUnicodeTables.py
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT license.
|
||||
#
|
||||
# Generates the content of unicode.ts based on the official Unicode
|
||||
# character database.
|
||||
|
||||
import sys
|
||||
import urllib.request
|
||||
from io import TextIOWrapper
|
||||
|
||||
|
||||
class Character:
|
||||
def __init__(self, code: int, category: str, *, end: int | None = None):
|
||||
self.code = code
|
||||
self.category = category
|
||||
|
||||
self.hasSurrogate = code > 0xFFFF
|
||||
if self.hasSurrogate:
|
||||
unicodeChar = chr(code)
|
||||
utf16 = unicodeChar.encode("utf-16")
|
||||
rawHex = utf16.hex()
|
||||
hex = rawHex[4:]
|
||||
|
||||
self.highSurrogate = int(hex[2:4] + hex[0:2], base=16)
|
||||
self.lowSurrogate = int(hex[6:8] + hex[4:6], base=16)
|
||||
|
||||
|
||||
class CharacterRange:
|
||||
def __init__(self, start: Character, end: Character):
|
||||
self.start = start
|
||||
self.end = end
|
||||
|
||||
|
||||
def downloadUnicodeData(unicodeVersion: str) -> str:
|
||||
url = f"https://www.unicode.org/Public/{unicodeVersion}.0/ucd/UnicodeData.txt"
|
||||
(path, _) = urllib.request.urlretrieve(url)
|
||||
return path
|
||||
|
||||
|
||||
def parseFile(filePath: str) -> list[Character]:
|
||||
with open(filePath, "r") as reader:
|
||||
lines = reader.readlines()
|
||||
chars: list[Character] = []
|
||||
for i in range(len(lines)):
|
||||
line = lines[i]
|
||||
splitOnSemicolon = line.split(";")
|
||||
charCode = int(splitOnSemicolon[0], base=16)
|
||||
category = splitOnSemicolon[2]
|
||||
|
||||
if splitOnSemicolon[1].endswith(", First>"):
|
||||
# Legacy range syntax
|
||||
# D800;<Non Private Use High Surrogate, First>;Cs;0;L;;;;;N;;;;;
|
||||
# DB7F;<Non Private Use High Surrogate, Last>;Cs;0;L;;;;;N;;;;;
|
||||
nextLine = lines[i + 1]
|
||||
nextSplitOnSemicolon = nextLine.split(";")
|
||||
nextCharCode = int(nextSplitOnSemicolon[0], base=16)
|
||||
for ord in range(charCode, nextCharCode + 1):
|
||||
chars.append(Character(ord, category))
|
||||
elif splitOnSemicolon[1].endswith(", Last>"):
|
||||
continue
|
||||
else:
|
||||
chars.append(Character(charCode, category))
|
||||
|
||||
return chars
|
||||
|
||||
|
||||
# Given a collection of characters, returns a list of ranges of contiguous
|
||||
# characters. Contiguous means that the character codes are sequential with
|
||||
# no gaps and the characters all have the same category. For character codes
|
||||
# greater than 0xFFFF, contiguous means that the high surrogate is the same
|
||||
# and the low surrogate values are sequential with no gaps. So, two character
|
||||
# codes might be sequential numerically but have different high surrogates,
|
||||
# and therefore would not be members of the same range.
|
||||
def getSurrogateRanges(chars: list[Character]) -> list[CharacterRange]:
|
||||
surrogateRanges: list[CharacterRange] = []
|
||||
|
||||
consecutiveRangeStartChar: Character | None = None
|
||||
previousChar: Character | None = None
|
||||
for char in chars:
|
||||
if not consecutiveRangeStartChar:
|
||||
consecutiveRangeStartChar = char
|
||||
|
||||
if previousChar:
|
||||
if not previousChar.hasSurrogate and not char.hasSurrogate:
|
||||
if (
|
||||
char.code == previousChar.code + 1
|
||||
and char.category == previousChar.category
|
||||
):
|
||||
pass
|
||||
elif not previousChar.hasSurrogate and char.hasSurrogate:
|
||||
consecutiveRangeStartChar = char
|
||||
else:
|
||||
if (
|
||||
char.highSurrogate == previousChar.highSurrogate
|
||||
and char.lowSurrogate == previousChar.lowSurrogate + 1
|
||||
and char.category == previousChar.category
|
||||
):
|
||||
pass
|
||||
else:
|
||||
surrogateRanges.append(
|
||||
CharacterRange(consecutiveRangeStartChar, previousChar)
|
||||
)
|
||||
consecutiveRangeStartChar = char
|
||||
|
||||
previousChar = char
|
||||
|
||||
return surrogateRanges
|
||||
|
||||
|
||||
# Write out a table of all character codes within the specified category. These are
|
||||
# the full hex character codes (Unicode code points) not surrogate values. Sequential
|
||||
# ranges of character codes are written as arrays of two numbers (start and end) to
|
||||
# save space.
|
||||
def writeRangeTable(writer: TextIOWrapper, category: str, chars: list[Character]):
|
||||
chars = [ch for ch in chars if ch.category == category]
|
||||
|
||||
writer.write("\n")
|
||||
writer.write(f"export const unicode{category}: UnicodeRangeTable = [\n")
|
||||
|
||||
consecutiveRangeStartChar: Character | None = None
|
||||
for i in range(len(chars)):
|
||||
char = chars[i]
|
||||
|
||||
if not consecutiveRangeStartChar:
|
||||
consecutiveRangeStartChar = char
|
||||
|
||||
if i + 1 >= len(chars) or chars[i + 1].code != char.code + 1:
|
||||
if consecutiveRangeStartChar.code == char.code:
|
||||
writer.write(f" 0x{consecutiveRangeStartChar.code:04x},\n")
|
||||
else:
|
||||
writer.write(f" [0x{consecutiveRangeStartChar.code:04x}, 0x{char.code:04x}],\n")
|
||||
|
||||
consecutiveRangeStartChar = None
|
||||
|
||||
writer.write("];\n")
|
||||
|
||||
|
||||
# Write out a table of all characters within the specified category using their UTF-16
|
||||
# values. Characters are grouped by high surrogate value. Sequential ranges of low
|
||||
# surrogate values are written as arrays of two numbers (start and end) to save space.
|
||||
def writeSurrogateRangeTable(
|
||||
writer: TextIOWrapper, category: str, surrogateRanges: list[CharacterRange]
|
||||
):
|
||||
surrogateRanges = [r for r in surrogateRanges if r.start.category == category]
|
||||
|
||||
if len(surrogateRanges) == 0:
|
||||
return
|
||||
|
||||
writer.write("\n")
|
||||
writer.write(
|
||||
f"export const unicode{category}Surrogate: UnicodeSurrogateRangeTable = {{\n"
|
||||
)
|
||||
|
||||
previousCharRange: CharacterRange | None = None
|
||||
for charRange in surrogateRanges:
|
||||
if (
|
||||
previousCharRange
|
||||
and charRange.start.highSurrogate != previousCharRange.start.highSurrogate
|
||||
):
|
||||
writer.write(" ],\n")
|
||||
previousCharRange = None
|
||||
|
||||
if not previousCharRange:
|
||||
writer.write(f" 0x{charRange.start.highSurrogate:04x}: [\n")
|
||||
previousCharRange = charRange
|
||||
|
||||
if charRange.start.lowSurrogate == charRange.end.lowSurrogate:
|
||||
writer.write(f" 0x{charRange.start.lowSurrogate:04x}, // 0x{charRange.start.code:04X}\n")
|
||||
else:
|
||||
writer.write(
|
||||
f" [0x{charRange.start.lowSurrogate:04x}, 0x{charRange.end.lowSurrogate:04x}], // 0x{charRange.start.code:04X}..0x{charRange.end.code:04X}\n"
|
||||
)
|
||||
|
||||
writer.write(" ],\n")
|
||||
writer.write("};\n")
|
||||
|
||||
|
||||
unicodeVersion = "16.0" if len(sys.argv) <= 1 else sys.argv[1]
|
||||
path = downloadUnicodeData(unicodeVersion)
|
||||
chars = parseFile(path)
|
||||
surrogateRanges = getSurrogateRanges(chars)
|
||||
|
||||
with open("packages/pyright-internal/src/parser/unicode.ts", "w") as writer:
|
||||
writer.write(
|
||||
f"""/*
|
||||
* unicode.ts
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT license.
|
||||
*
|
||||
* Tables that encode Unicode character codes for various Unicode-
|
||||
* defined categories used in the Python spec.
|
||||
*
|
||||
* Generated by build/generateUnicodeTables.py from the UnicodeData.txt
|
||||
* metadata file for Unicode {unicodeVersion}.
|
||||
*/
|
||||
|
||||
export type UnicodeRange = [number, number] | number;
|
||||
export type UnicodeRangeTable = UnicodeRange[];
|
||||
export type UnicodeSurrogateRangeTable = {{ [surrogate: number]: UnicodeRange[] }};
|
||||
"""
|
||||
)
|
||||
|
||||
for category in ["Lu", "Ll", "Lt", "Lo", "Lm", "Nl", "Mn", "Mc", "Nd", "Pc"]:
|
||||
writeRangeTable(writer, category, chars)
|
||||
writeSurrogateRangeTable(writer, category, surrogateRanges)
|
||||
83
build/lib/updateDeps.js
Normal file
83
build/lib/updateDeps.js
Normal file
@@ -0,0 +1,83 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
//@ts-check
|
||||
|
||||
const { promises: fsAsync } = require('fs');
|
||||
const ncu = require('npm-check-updates');
|
||||
const PQueue = require('p-queue').default;
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
const { glob } = require('glob');
|
||||
const exec = util.promisify(require('child_process').exec);
|
||||
|
||||
/** @type {((path: string, options?: import('fs').RmOptions) => Promise<void>) | undefined} */
|
||||
const node14rm = /** @type {any} */ (fsAsync).rm;
|
||||
/** @type {(path: string, options?: { recursive?: boolean }) => Promise<void>} */
|
||||
const legacyRmdir = /** @type {any} */ (fsAsync.rmdir);
|
||||
|
||||
/** @type {(path: string) => Promise<void>} */
|
||||
async function rmdir(path) {
|
||||
if (node14rm) {
|
||||
// Avoid deprecation warning when on Node v14+, which have deprecated recursive rmdir in favor of rm.
|
||||
return node14rm(path, { recursive: true, force: true });
|
||||
}
|
||||
return legacyRmdir(path, { recursive: true });
|
||||
}
|
||||
|
||||
async function findPackages() {
|
||||
const lernaFile = await fsAsync.readFile('lerna.json', 'utf-8');
|
||||
|
||||
/** @type {{ packages: string[] }} */
|
||||
const lernaConfig = JSON.parse(lernaFile);
|
||||
|
||||
const matches = await Promise.all(lernaConfig.packages.map((pattern) => glob(pattern + '/package.json')));
|
||||
return ['package.json'].concat(...matches);
|
||||
}
|
||||
|
||||
const queue = new PQueue({ concurrency: 4 });
|
||||
|
||||
/** @type {(packageFile: string, transitive: boolean, reject?: string[]) => Promise<void>} */
|
||||
async function updatePackage(packageFile, transitive, reject = undefined) {
|
||||
packageFile = path.resolve(packageFile);
|
||||
const packagePath = path.dirname(packageFile);
|
||||
const packageName = path.basename(packagePath);
|
||||
|
||||
console.log(`${packageName}: updating with ncu`);
|
||||
const updateResult = await ncu.run({
|
||||
packageFile: packageFile,
|
||||
target: 'minor',
|
||||
upgrade: true,
|
||||
reject: reject,
|
||||
});
|
||||
|
||||
if (!transitive && Object.keys(/**@type {any}*/ (updateResult)).length === 0) {
|
||||
// If nothing changed and we aren't updating transitive deps, don't run npm install.
|
||||
return;
|
||||
}
|
||||
|
||||
if (transitive) {
|
||||
console.log(`${packageName}: removing package-lock.json and node_modules`);
|
||||
await fsAsync.unlink(path.join(packagePath, 'package-lock.json'));
|
||||
await rmdir(path.join(packagePath, 'node_modules'));
|
||||
}
|
||||
|
||||
await queue.add(async () => {
|
||||
console.log(`${packageName}: reinstalling package`);
|
||||
await exec('npm install', {
|
||||
cwd: packagePath,
|
||||
env: {
|
||||
...process.env,
|
||||
SKIP_LERNA_BOOTSTRAP: 'yes',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** @type {(transitive: boolean, reject?: string[]) => Promise<void>} */
|
||||
async function updateAll(transitive, reject = undefined) {
|
||||
const packageFiles = await findPackages();
|
||||
await Promise.all(packageFiles.map((packageFile) => updatePackage(packageFile, transitive, reject)));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updateAll,
|
||||
};
|
||||
125
build/lib/webpack.js
Normal file
125
build/lib/webpack.js
Normal file
@@ -0,0 +1,125 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
const JSONC = require('jsonc-parser');
|
||||
const assert = require('assert');
|
||||
|
||||
/**
|
||||
* Builds a faked resource path for production source maps in webpack.
|
||||
*
|
||||
* @param {string} packageName The name of the package where webpack is running.
|
||||
*/
|
||||
function monorepoResourceNameMapper(packageName) {
|
||||
/**@type {(info: {resourcePath: string}) => string} */
|
||||
const mapper = (info) => {
|
||||
const parts = [];
|
||||
|
||||
// Walk backwards looking for the monorepo
|
||||
for (const part of info.resourcePath.split('/').reverse()) {
|
||||
if (part === '..' || part === 'packages') {
|
||||
break;
|
||||
}
|
||||
|
||||
if (part === '.') {
|
||||
parts.push(packageName);
|
||||
break;
|
||||
}
|
||||
|
||||
parts.push(part);
|
||||
}
|
||||
|
||||
return parts.reverse().join('/');
|
||||
};
|
||||
return mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of node_modules folders for the entire monorepo.
|
||||
*
|
||||
* @param {string} workspaceRoot
|
||||
*/
|
||||
function managedPaths(workspaceRoot) {
|
||||
const contents = fs.readFileSync(path.join(workspaceRoot, 'lerna.json'), 'utf-8');
|
||||
/** @type {{ packages: string[] }} */
|
||||
const data = JSON.parse(contents);
|
||||
const patterns = data.packages;
|
||||
|
||||
const paths = [path.resolve(workspaceRoot, 'node_modules')];
|
||||
paths.push(
|
||||
...patterns
|
||||
.flatMap((p) => glob.sync(p, { cwd: workspaceRoot }))
|
||||
.map((p) => path.resolve(workspaceRoot, p, 'node_modules'))
|
||||
);
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a webpack caching config, given the calling module's __dirname and __filename.
|
||||
* @param {string} dirname __dirname
|
||||
* @param {string} filename __filename
|
||||
* @param {string | undefined} name name of the webpack instance, if using multiple configs
|
||||
*/
|
||||
function cacheConfig(dirname, filename, name = undefined) {
|
||||
// Temporarily disabled: caching breaks when switching branches,
|
||||
// after typescript compilation errors, and so on.
|
||||
if (true) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
type: /** @type {'filesystem'} */ ('filesystem'),
|
||||
cacheDirectory: path.resolve(dirname, '.webpack_cache'),
|
||||
buildDependencies: {
|
||||
config: [filename],
|
||||
},
|
||||
managedPaths: managedPaths(path.resolve(dirname, '..', '..')),
|
||||
name,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a webpack resolve alias configuration from a tsconfig.json file.
|
||||
* This is an alternative to using tsconfig-paths-webpack-plugin, which
|
||||
* has a number of unfixed bugs.
|
||||
*
|
||||
* https://github.com/dividab/tsconfig-paths/issues/143
|
||||
* https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/59
|
||||
* https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/60
|
||||
* @param {string} tsconfigPath Path to tsconfig
|
||||
*/
|
||||
function tsconfigResolveAliases(tsconfigPath) {
|
||||
tsconfigPath = path.resolve(tsconfigPath);
|
||||
const tsconfigDir = path.dirname(tsconfigPath);
|
||||
|
||||
const tsconfig = JSONC.parse(fs.readFileSync(tsconfigPath, 'utf-8'));
|
||||
const baseUrl = tsconfig.baseUrl;
|
||||
assert(typeof baseUrl === 'string' || baseUrl === undefined);
|
||||
const baseDir = baseUrl ? path.resolve(tsconfigDir, baseUrl) : tsconfigDir;
|
||||
|
||||
const paths = tsconfig['compilerOptions']['paths'];
|
||||
assert(typeof paths === 'object');
|
||||
|
||||
const endWildcard = /\/\*$/;
|
||||
|
||||
return Object.fromEntries(
|
||||
Object.entries(paths).map(([from, toArr]) => {
|
||||
assert(typeof from === 'string', typeof from);
|
||||
assert(Array.isArray(toArr) && toArr.length === 1);
|
||||
let to = toArr[0];
|
||||
assert(typeof to === 'string');
|
||||
assert(endWildcard.test(from));
|
||||
assert(endWildcard.test(to));
|
||||
|
||||
from = from.replace(endWildcard, '');
|
||||
to = to.replace(endWildcard, '');
|
||||
|
||||
return [from, path.resolve(baseDir, to)];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
monorepoResourceNameMapper,
|
||||
cacheConfig,
|
||||
tsconfigResolveAliases,
|
||||
};
|
||||
255
build/perfCompare.py
Normal file
255
build/perfCompare.py
Normal file
@@ -0,0 +1,255 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
# perfCompare.py
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT license.
|
||||
#
|
||||
# Benchmarks pyright's type-checking performance across two or more git
|
||||
# commits/branches by building the production CLI bundle at each commit and
|
||||
# timing repeated runs over a fixed corpus. See the module docstring for usage
|
||||
# and the measurement methodology.
|
||||
|
||||
"""Compare pyright type-checking performance across two or more commits/branches.
|
||||
|
||||
Adapted from mypy's misc/perf_compare.py for pyright. Where mypy self-checks its
|
||||
own (mypyc-compiled) source, pyright is a bundled JS CLI, so this script:
|
||||
|
||||
* For each target commit: checks it out *in place*, builds the production CLI
|
||||
bundle (``packages/pyright/dist``), and stashes that dist dir under
|
||||
``build/perfCompare/binaries/<sha>/`` so later runs can skip the rebuild.
|
||||
* Restores your original branch/commit when the build phase is done.
|
||||
* Runs each commit's bundle N times over a fixed corpus, in randomized
|
||||
interleaved order, parsing pyright's own ``Completed in X.XXXsec`` line as the
|
||||
per-run metric (in-process analysis time -- excludes node startup jitter).
|
||||
* Reports per-commit mean/median plus robust paired deltas vs the baseline.
|
||||
|
||||
Usage:
|
||||
|
||||
python build/perfCompare.py --corpus <path-to-python-project> main HEAD
|
||||
|
||||
Requirements / caveats:
|
||||
|
||||
* Run from the pyright repo root with a CLEAN working tree (it checks out
|
||||
commits in place, reusing the already-installed node_modules -- worktrees
|
||||
would lack them).
|
||||
* The corpus path is whatever you want type-checked; it stays fixed across all
|
||||
commits so only the checker changes. Errors in the corpus are ignored.
|
||||
* Builds are keyed by the resolved commit SHA, so passing a moving ref like
|
||||
HEAD/branch name caches under its current SHA (fine within one run).
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import resource
|
||||
import shutil
|
||||
import statistics
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
REPO_ROOT = os.path.dirname(SCRIPT_DIR)
|
||||
PYRIGHT_PKG = os.path.join(REPO_ROOT, "packages", "pyright")
|
||||
DIST_DIR = os.path.join(PYRIGHT_PKG, "dist")
|
||||
# Cached production bundles, keyed by commit SHA, kept beside this script (gitignored).
|
||||
BUILD_CACHE = os.path.join(SCRIPT_DIR, "perfCompare", "binaries")
|
||||
|
||||
COMPLETED_RE = re.compile(r"Completed in ([\d.]+)sec")
|
||||
CHECK_RE = re.compile(r"Check:\s+([\d.]+)sec")
|
||||
|
||||
|
||||
def heading(s: str) -> None:
|
||||
print()
|
||||
print(f"=== {s} ===")
|
||||
print()
|
||||
|
||||
|
||||
def git(*args: str, capture: bool = False) -> str:
|
||||
res = subprocess.run(
|
||||
["git", *args], cwd=REPO_ROOT, check=True, text=True,
|
||||
stdout=subprocess.PIPE if capture else None,
|
||||
)
|
||||
return (res.stdout or "").strip()
|
||||
|
||||
|
||||
def resolve_sha(commit: str) -> str:
|
||||
return git("rev-parse", commit, capture=True)
|
||||
|
||||
|
||||
def current_ref() -> str:
|
||||
"""The symbolic branch name if on one, else the detached SHA -- for restore."""
|
||||
branch = git("rev-parse", "--abbrev-ref", "HEAD", capture=True)
|
||||
return branch if branch != "HEAD" else resolve_sha("HEAD")
|
||||
|
||||
|
||||
def working_tree_clean() -> bool:
|
||||
return git("status", "--porcelain", capture=True) == ""
|
||||
|
||||
|
||||
def build_commit(commit: str, sha: str) -> str:
|
||||
"""Check out `commit`, build the prod bundle, cache dist under the SHA. Returns cache dir."""
|
||||
cache_dir = os.path.join(BUILD_CACHE, sha)
|
||||
if os.path.isdir(cache_dir) and os.path.isfile(os.path.join(cache_dir, "pyright.js")):
|
||||
print(f"build cache hit for {commit} ({sha[:10]}): {cache_dir}")
|
||||
return cache_dir
|
||||
|
||||
heading(f"Building {commit} ({sha[:10]})")
|
||||
git("checkout", "-q", sha)
|
||||
subprocess.run(["npm", "run", "build"], cwd=PYRIGHT_PKG, check=True)
|
||||
|
||||
if os.path.isdir(cache_dir):
|
||||
shutil.rmtree(cache_dir)
|
||||
os.makedirs(BUILD_CACHE, exist_ok=True)
|
||||
shutil.copytree(DIST_DIR, cache_dir, symlinks=True)
|
||||
print(f"cached build -> {cache_dir}")
|
||||
return cache_dir
|
||||
|
||||
|
||||
def run_once(bundle_dir: str, corpus: str) -> tuple[float, float | None, float]:
|
||||
"""Run pyright on corpus once; return (wall_completed_sec, check_sec | None, cpu_sec).
|
||||
|
||||
`wall` is pyright's own ``Completed in`` (in-process analysis wall time). `cpu` is the
|
||||
user+sys CPU time of the node child, via the RUSAGE_CHILDREN delta around the run --
|
||||
much less sensitive to scheduling/background noise. This is accurate because pyright runs
|
||||
single-process by default (no ``--threads``), so there are no un-reaped worker processes
|
||||
whose CPU would escape node's accounting.
|
||||
"""
|
||||
cmd = ["node", os.path.join(bundle_dir, "pyright.js"), "--stats", os.path.abspath(corpus)]
|
||||
r0 = resource.getrusage(resource.RUSAGE_CHILDREN)
|
||||
# Ignore exit code: corpora routinely produce type errors.
|
||||
res = subprocess.run(cmd, cwd=REPO_ROOT, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
r1 = resource.getrusage(resource.RUSAGE_CHILDREN)
|
||||
cpu = (r1.ru_utime - r0.ru_utime) + (r1.ru_stime - r0.ru_stime)
|
||||
m = COMPLETED_RE.search(res.stdout)
|
||||
if not m:
|
||||
sys.stderr.write(res.stdout[-2000:] + "\n")
|
||||
raise RuntimeError("Could not parse 'Completed in ...sec' from pyright output")
|
||||
c = CHECK_RE.search(res.stdout)
|
||||
return float(m.group(1)), (float(c.group(1)) if c else None), cpu
|
||||
|
||||
|
||||
def winsorized_paired_stats(diffs: list[float], *, trim_frac: float = 0.1, conf: float = 0.95) -> dict[str, float]:
|
||||
"""Robust paired-difference summary (trimmed mean + Tukey-McLaughlin SE). See mypy's perf_compare."""
|
||||
n = len(diffs)
|
||||
s = sorted(diffs)
|
||||
g = int(n * trim_frac)
|
||||
median = statistics.median(s)
|
||||
if n < 2 or n - 2 * g < 2:
|
||||
return {"est": statistics.mean(s), "median": median, "ci": 0.0, "kept": float(n)}
|
||||
kept = s[g: n - g]
|
||||
est = statistics.mean(kept)
|
||||
wins = [kept[0]] * g + kept + [kept[-1]] * g
|
||||
wvar = statistics.variance(wins)
|
||||
se = (wvar ** 0.5) / ((1 - 2 * trim_frac) * (n ** 0.5))
|
||||
z = statistics.NormalDist().inv_cdf(0.5 + conf / 2)
|
||||
return {"est": est, "median": median, "ci": z * se, "kept": float(len(kept))}
|
||||
|
||||
|
||||
def main() -> None:
|
||||
t0 = time.time()
|
||||
p = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter, description=__doc__
|
||||
)
|
||||
src = p.add_mutually_exclusive_group(required=True)
|
||||
src.add_argument("--corpus", help="path to a Python project *directory* to type-check (fixed across commits)")
|
||||
src.add_argument("--corpus-file", help="path to a single Python *file* to type-check (e.g. one hot file). "
|
||||
"Lower per-run cost and variance than a whole project.")
|
||||
p.add_argument("--num-runs", type=int, default=10, help="measured runs per commit (default 10)")
|
||||
p.add_argument("--warmup-runs", type=int, default=2, help="leading warmup runs to discard (default 2)")
|
||||
p.add_argument("--metric", choices=["wall", "cpu"], default="wall",
|
||||
help="quantity to compare: 'wall' (pyright's reported analysis time, default) or "
|
||||
"'cpu' (user+sys CPU of the node child). 'cpu' is far less sensitive to background "
|
||||
"interference/scheduling, tightening the distribution -- recommended for high run counts.")
|
||||
p.add_argument("--workers1", action="store_true",
|
||||
help="parity flag with mypy's perf_compare: assert single-process analysis. Pyright already "
|
||||
"runs single-process by default (multi-process needs --threads, which this script never "
|
||||
"passes), so this is the default; the flag is accepted to document intent.")
|
||||
p.add_argument("--no-build", action="store_true", help="skip building; reuse cached dist bundles under build/perfCompare/binaries/")
|
||||
p.add_argument("commit", nargs="+", help="git revisions to compare; the first is the baseline (e.g. main HEAD)")
|
||||
args = p.parse_args()
|
||||
|
||||
if not os.path.isdir(os.path.join(REPO_ROOT, ".git")):
|
||||
sys.exit("error: run from the pyright repo root")
|
||||
corpus = args.corpus if args.corpus is not None else args.corpus_file
|
||||
if args.corpus is not None and not os.path.isdir(args.corpus):
|
||||
sys.exit(f"error: --corpus directory not found: {args.corpus}")
|
||||
if args.corpus_file is not None and not os.path.isfile(args.corpus_file):
|
||||
sys.exit(f"error: --corpus-file not found: {args.corpus_file}")
|
||||
|
||||
commits: list[str] = args.commit
|
||||
shas = {c: resolve_sha(c) for c in commits}
|
||||
|
||||
bundles: dict[str, str] = {}
|
||||
if args.no_build:
|
||||
for c in commits:
|
||||
cache_dir = os.path.join(BUILD_CACHE, shas[c])
|
||||
if not os.path.isfile(os.path.join(cache_dir, "pyright.js")):
|
||||
sys.exit(f"error: --no-build but no cached bundle for {c} ({shas[c][:10]})")
|
||||
bundles[c] = cache_dir
|
||||
else:
|
||||
if not working_tree_clean():
|
||||
sys.exit("error: working tree not clean -- commit/stash first (this script checks out commits in place)")
|
||||
original = current_ref()
|
||||
print(f"original ref: {original} (will restore after building)")
|
||||
try:
|
||||
for c in commits:
|
||||
bundles[c] = build_commit(c, shas[c])
|
||||
finally:
|
||||
heading(f"Restoring {original}")
|
||||
git("checkout", "-q", original)
|
||||
|
||||
num_runs = args.num_runs + args.warmup_runs
|
||||
metric_label = "CPU time (user+sys)" if args.metric == "cpu" else "pyright-reported wall time"
|
||||
heading(f"Measuring (corpus: {corpus}, {args.num_runs} runs + {args.warmup_runs} warmup, "
|
||||
f"metric: {args.metric}, single-process)")
|
||||
# `results` holds the chosen comparison metric; the other values are still printed per run.
|
||||
results: dict[str, list[float]] = {c: [] for c in commits}
|
||||
for n in range(num_runs):
|
||||
warm = n < args.warmup_runs
|
||||
print(f"{'Warmup' if warm else 'Run'} {n + 1 - (0 if warm else args.warmup_runs)}/"
|
||||
f"{args.warmup_runs if warm else args.num_runs}...")
|
||||
order = commits[:]
|
||||
random.shuffle(order)
|
||||
for c in order:
|
||||
wall, check, cpu = run_once(bundles[c], corpus)
|
||||
metric_val = cpu if args.metric == "cpu" else wall
|
||||
if not warm:
|
||||
results[c].append(metric_val)
|
||||
check_str = f" check={check:.2f}s" if check is not None else ""
|
||||
print(f" {c}: cpu={cpu:.3f}s wall={wall:.3f}s{check_str}")
|
||||
|
||||
baseline = commits[0]
|
||||
heading(f"Results ({metric_label})")
|
||||
first_mean = first_median = -1.0
|
||||
for c in commits:
|
||||
mean = statistics.mean(results[c])
|
||||
median = statistics.median(results[c])
|
||||
sd = statistics.pstdev(results[c]) if len(results[c]) > 1 else 0.0
|
||||
if first_mean < 0:
|
||||
first_mean, first_median = mean, median
|
||||
dm = dmed = "0.0%"
|
||||
else:
|
||||
dm = f"{mean / first_mean - 1:+.1%}"
|
||||
dmed = f"{median / first_median - 1:+.1%}"
|
||||
print(f"{c:<22} mean {mean:.3f}s ({dm}) | stdev {sd:.3f}s | median {median:.3f}s ({dmed})")
|
||||
|
||||
base_runs = results[baseline]
|
||||
base_center = statistics.median(base_runs)
|
||||
heading(f"Paired deltas vs {baseline} (per-round diffs; median +/- 95% CI)")
|
||||
for c in commits:
|
||||
if c == baseline:
|
||||
print(f"{c:<22} baseline")
|
||||
continue
|
||||
diffs = [a - b for a, b in zip(results[c], base_runs)]
|
||||
st = winsorized_paired_stats(diffs)
|
||||
pct = (st["median"] / base_center * 100) if base_center else 0.0
|
||||
print(f"{c:<22} median {st['median'] * 1000:+7.1f}ms +/-{st['ci'] * 1000:4.1f} ({pct:+.2f}%)")
|
||||
|
||||
t = int(time.time() - t0)
|
||||
print(f"\nTotal wall time: {t // 60}m {t % 60}s")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
9
build/skipBootstrap.js
Normal file
9
build/skipBootstrap.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// This script exits with a "failure" if this SKIP_LERNA_BOOTSTRAP is set.
|
||||
// This can be used to write npm script like:
|
||||
// node ./build/skipBootstrap.js || lerna bootstrap
|
||||
// Which means "skip lerna bootstrap if SKIP_LERNA_BOOTSTRAP is set".
|
||||
// This prevents spurious bootstraps in nested lerna repos.
|
||||
|
||||
if (!process.env.SKIP_LERNA_BOOTSTRAP) {
|
||||
process.exit(1);
|
||||
}
|
||||
16
build/templates/npmAuthenticate.yml
Normal file
16
build/templates/npmAuthenticate.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
steps:
|
||||
- task: npmAuthenticate@0
|
||||
inputs:
|
||||
workingFile: .npmrc
|
||||
|
||||
- task: npmAuthenticate@0
|
||||
inputs:
|
||||
workingFile: packages/pyright/.npmrc
|
||||
|
||||
- task: npmAuthenticate@0
|
||||
inputs:
|
||||
workingFile: packages/pyright-internal/.npmrc
|
||||
|
||||
- task: npmAuthenticate@0
|
||||
inputs:
|
||||
workingFile: packages/vscode-pyright/.npmrc
|
||||
29
build/updateDeps.js
Normal file
29
build/updateDeps.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
//@ts-check
|
||||
|
||||
const yargs = require('yargs');
|
||||
|
||||
const { updateAll } = require('./lib/updateDeps');
|
||||
|
||||
async function main() {
|
||||
const argv = yargs.options({
|
||||
transitive: { type: 'boolean' },
|
||||
}).argv;
|
||||
|
||||
await updateAll(!!argv.transitive, [
|
||||
// These packages impact compatibility with VS Code and other users;
|
||||
// ensure they remained pinned exactly.
|
||||
'@types/vscode',
|
||||
'vsce',
|
||||
'vscode-jsonrpc',
|
||||
'vscode-languageclient',
|
||||
'vscode-languageserver',
|
||||
'vscode-languageserver-protocol',
|
||||
'vscode-languageserver-textdocument',
|
||||
'vscode-languageserver-types',
|
||||
// Minor version changes have breaks; require a manual update.
|
||||
'typescript',
|
||||
]);
|
||||
}
|
||||
|
||||
main();
|
||||
251
build/updateTypeshed.py
Normal file
251
build/updateTypeshed.py
Normal file
@@ -0,0 +1,251 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to update the typeshed-fallback folder with the latest files from
|
||||
the typeshed repository (https://github.com/python/typeshed).
|
||||
|
||||
This script:
|
||||
1. Clones/downloads the typeshed repository to a temporary directory
|
||||
2. Copies the stdlib/ and stubs/ folders to typeshed-fallback
|
||||
3. Copies the LICENSE and README.md files
|
||||
4. Updates commit.txt with the current commit hash
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_script_dir() -> Path:
|
||||
"""Get the directory where this script is located."""
|
||||
return Path(__file__).parent.resolve()
|
||||
|
||||
|
||||
def get_typeshed_fallback_dir() -> Path:
|
||||
"""Get the path to the typeshed-fallback directory."""
|
||||
script_dir = get_script_dir()
|
||||
return script_dir.parent / "packages" / "pyright-internal" / "typeshed-fallback"
|
||||
|
||||
|
||||
def run_git_command(args: list[str], cwd: Path) -> subprocess.CompletedProcess:
|
||||
"""Run a git command and return the result."""
|
||||
return subprocess.run(
|
||||
["git"] + args,
|
||||
cwd=cwd,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
def clone_typeshed(target_dir: Path, commit: str | None = None) -> str:
|
||||
"""
|
||||
Clone the typeshed repository to the target directory.
|
||||
|
||||
Args:
|
||||
target_dir: Directory to clone into
|
||||
commit: Optional specific commit hash to checkout
|
||||
|
||||
Returns:
|
||||
The commit hash that was checked out
|
||||
"""
|
||||
typeshed_url = "https://github.com/python/typeshed.git"
|
||||
|
||||
print(f"Cloning typeshed repository to {target_dir}...")
|
||||
|
||||
# Clone with depth 1 for faster download (unless we need a specific commit)
|
||||
if commit:
|
||||
# Full clone needed for specific commit
|
||||
run_git_command(["clone", typeshed_url, str(target_dir)], cwd=target_dir.parent)
|
||||
run_git_command(["checkout", commit], cwd=target_dir)
|
||||
else:
|
||||
# Shallow clone for latest
|
||||
run_git_command(["clone", "--depth", "1", typeshed_url, str(target_dir)], cwd=target_dir.parent)
|
||||
|
||||
# Get the current commit hash
|
||||
result = run_git_command(["rev-parse", "HEAD"], cwd=target_dir)
|
||||
commit_hash = result.stdout.strip()
|
||||
|
||||
print(f"Checked out commit: {commit_hash}")
|
||||
return commit_hash
|
||||
|
||||
|
||||
def remove_directory_contents(dir_path: Path) -> None:
|
||||
"""Remove all contents of a directory but keep the directory itself."""
|
||||
if dir_path.exists():
|
||||
shutil.rmtree(dir_path)
|
||||
dir_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def should_copy_file(file_path: Path) -> bool:
|
||||
"""Check if a file should be copied based on its extension or name."""
|
||||
allowed_extensions = {".pyi", ".toml"}
|
||||
allowed_names = {"VERSIONS"}
|
||||
return file_path.suffix.lower() in allowed_extensions or file_path.name in allowed_names
|
||||
|
||||
|
||||
def is_in_excluded_folder(file_path: Path, base_folder: Path) -> bool:
|
||||
"""Check if the file is inside a folder that starts with '@'."""
|
||||
rel_path = file_path.relative_to(base_folder)
|
||||
for part in rel_path.parts:
|
||||
if part.startswith("@"):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def copy_tree_filtered(src_folder: Path, dst_folder: Path) -> None:
|
||||
"""
|
||||
Copy a directory tree, only including .pyi and VERSIONS files.
|
||||
Skips any folder starting with '@'.
|
||||
|
||||
Args:
|
||||
src_folder: Source directory
|
||||
dst_folder: Destination directory
|
||||
"""
|
||||
for src_path in src_folder.rglob("*"):
|
||||
if src_path.is_file() and should_copy_file(src_path):
|
||||
# Skip files in folders starting with '@'
|
||||
if is_in_excluded_folder(src_path, src_folder):
|
||||
continue
|
||||
|
||||
# Calculate relative path and destination
|
||||
rel_path = src_path.relative_to(src_folder)
|
||||
dst_path = dst_folder / rel_path
|
||||
|
||||
# Create parent directories if needed
|
||||
dst_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Copy the file
|
||||
shutil.copy2(src_path, dst_path)
|
||||
|
||||
|
||||
def copy_typeshed_files(source_dir: Path, dest_dir: Path) -> None:
|
||||
"""
|
||||
Copy the relevant typeshed files to the destination directory.
|
||||
Only .pyi and VERSIONS files are copied from folders.
|
||||
|
||||
Args:
|
||||
source_dir: The cloned typeshed repository directory
|
||||
dest_dir: The typeshed-fallback directory
|
||||
"""
|
||||
# Folders to copy
|
||||
folders_to_copy = ["stdlib", "stubs"]
|
||||
|
||||
# Copy folders (only .py and .pyi files)
|
||||
for folder in folders_to_copy:
|
||||
src_folder = source_dir / folder
|
||||
dst_folder = dest_dir / folder
|
||||
|
||||
if not src_folder.exists():
|
||||
print(f"Warning: Source folder {src_folder} does not exist, skipping...")
|
||||
continue
|
||||
|
||||
print(f"Copying {folder}/ (only .pyi and VERSIONS files)...")
|
||||
|
||||
# Remove existing folder contents
|
||||
remove_directory_contents(dst_folder)
|
||||
|
||||
# Copy the folder with filtering
|
||||
copy_tree_filtered(src_folder, dst_folder)
|
||||
|
||||
# Files to copy
|
||||
files_to_copy = ["LICENSE", "README.md"]
|
||||
|
||||
# Copy files
|
||||
for file in files_to_copy:
|
||||
src_file = source_dir / file
|
||||
dst_file = dest_dir / file
|
||||
|
||||
if not src_file.exists():
|
||||
print(f"Warning: Source file {src_file} does not exist, skipping...")
|
||||
continue
|
||||
|
||||
print(f"Copying {file}...")
|
||||
shutil.copy2(src_file, dst_file)
|
||||
|
||||
|
||||
def update_commit_file(dest_dir: Path, commit_hash: str) -> None:
|
||||
"""Update the commit.txt file with the new commit hash."""
|
||||
commit_file = dest_dir / "commit.txt"
|
||||
print(f"Updating commit.txt with {commit_hash}...")
|
||||
commit_file.write_text(commit_hash + "\n")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Update typeshed-fallback with the latest typeshed files"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--commit",
|
||||
"-c",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Specific commit hash to checkout (default: latest main branch)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dry-run",
|
||||
"-n",
|
||||
action="store_true",
|
||||
help="Show what would be done without making changes",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
typeshed_fallback_dir = get_typeshed_fallback_dir()
|
||||
|
||||
if not typeshed_fallback_dir.exists():
|
||||
print(f"Error: typeshed-fallback directory not found at {typeshed_fallback_dir}")
|
||||
return 1
|
||||
|
||||
print(f"Typeshed fallback directory: {typeshed_fallback_dir}")
|
||||
|
||||
if args.dry_run:
|
||||
print("\n*** DRY RUN - No changes will be made ***\n")
|
||||
print("Would perform the following actions:")
|
||||
print(" 1. Clone typeshed repository to a temporary directory")
|
||||
if args.commit:
|
||||
print(f" 2. Checkout commit: {args.commit}")
|
||||
else:
|
||||
print(" 2. Use latest commit from main branch")
|
||||
print(" 3. Copy stdlib/ folder (only .pyi and VERSIONS files)")
|
||||
print(" 4. Copy stubs/ folder (only .pyi and VERSIONS files)")
|
||||
print(" 5. Copy LICENSE file")
|
||||
print(" 6. Copy README.md file")
|
||||
print(" 7. Update commit.txt with new commit hash")
|
||||
return 0
|
||||
|
||||
# Create a temporary directory for cloning
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
temp_path = Path(temp_dir)
|
||||
typeshed_clone_dir = temp_path / "typeshed"
|
||||
|
||||
try:
|
||||
# Clone typeshed
|
||||
commit_hash = clone_typeshed(typeshed_clone_dir, args.commit)
|
||||
|
||||
# Copy files
|
||||
copy_typeshed_files(typeshed_clone_dir, typeshed_fallback_dir)
|
||||
|
||||
# Update commit.txt
|
||||
update_commit_file(typeshed_fallback_dir, commit_hash)
|
||||
|
||||
print("\nTypeshed update complete!")
|
||||
print(f"Updated to commit: {commit_hash}")
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error running git command: {e}")
|
||||
print(f"stdout: {e.stdout}")
|
||||
print(f"stderr: {e.stderr}")
|
||||
return 1
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
0
docs/.nojekyll
Normal file
0
docs/.nojekyll
Normal file
9
docs/README.md
Normal file
9
docs/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||

|
||||
|
||||
# Static type checker for Python
|
||||
|
||||
Pyright is a full-featured, [standards-compliant](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) static type checker for Python. It is designed for high performance and can be used with large Python source bases.
|
||||
|
||||
Pyright includes a [command-line tool](command-line.md), a language server, and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright).
|
||||
|
||||
|
||||
1
docs/_navbar.md
Normal file
1
docs/_navbar.md
Normal file
@@ -0,0 +1 @@
|
||||
[GitHub Site](https://github.com/Microsoft/pyright)
|
||||
41
docs/_sidebar.md
Normal file
41
docs/_sidebar.md
Normal file
@@ -0,0 +1,41 @@
|
||||
- Getting Started
|
||||
|
||||
- [Installing Pyright](installation.md)
|
||||
- [Getting Started](getting-started.md)
|
||||
- [Static Typing](type-concepts.md)
|
||||
- [Features](features.md)
|
||||
|
||||
- Customization
|
||||
|
||||
- [Configuration](configuration.md)
|
||||
- [Configuration Options](configuration.md#main-configuration-options)
|
||||
- [Diagnostic Rules](configuration.md#type-check-diagnostics-settings)
|
||||
- [Execution Environments](configuration.md#execution-environment-options)
|
||||
- [Sample pyrightconfig.json](configuration.md#sample-config-file)
|
||||
- [Sample pyproject.toml](configuration.md#sample-pyprojecttoml-file)
|
||||
- [Diagnostic Settings Defaults](configuration.md#diagnostic-settings-defaults)
|
||||
- [Locale Configuration](configuration.md#locale-configuration)
|
||||
- [Language Server Settings](settings.md)
|
||||
- [Command Line Interface](command-line.md)
|
||||
- [Type Server (TSP)](type-server.md)
|
||||
- [Controlling Behavior With Comments](comments.md)
|
||||
- [Continuous Integration](ci-integration.md)
|
||||
|
||||
- Usage
|
||||
|
||||
- [Advanced Type Concepts](type-concepts-advanced.md)
|
||||
- [Type Inference](type-inference.md)
|
||||
- [Import Statements](import-statements.md)
|
||||
- [Import Resolution](import-resolution.md)
|
||||
- [Extending Builtins](builtins.md)
|
||||
- [Type Stubs](type-stubs.md)
|
||||
- [Types in Libraries](typed-libraries.md)
|
||||
- [Differences from Mypy](mypy-comparison.md)
|
||||
- [Commands](commands.md)
|
||||
|
||||
- Development
|
||||
|
||||
- [Building & Debugging](build-debug.md)
|
||||
- [Pyright Internals](internals.md)
|
||||
|
||||
|
||||
39
docs/build-debug.md
Normal file
39
docs/build-debug.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## Building Pyright
|
||||
|
||||
To install the dependencies for all packages in the repo:
|
||||
1. Install [nodejs](https://nodejs.org/en/) version 16.x
|
||||
2. Open terminal window in main directory of cloned source
|
||||
3. Execute `npm run install:all` to install dependencies for projects and sub-projects
|
||||
|
||||
|
||||
## Building the CLI
|
||||
|
||||
1. cd to the `packages/pyright` directory
|
||||
2. Execute `npm run build`
|
||||
|
||||
Once built, you can run the command-line tool by executing the following:
|
||||
|
||||
`node index.js`
|
||||
|
||||
## Building the VS Code extension
|
||||
|
||||
1. cd to the `packages/vscode-pyright` directory
|
||||
2. Execute `npm run package`
|
||||
|
||||
The resulting package (pyright-X.Y.Z.vsix) can be found in the client directory.
|
||||
To install in VS Code, go to the extensions panel and choose “Install from VSIX...” from the menu, then select the package.
|
||||
|
||||
|
||||
## Running Pyright tests
|
||||
|
||||
1. cd to the `packages/pyright-internal` directory
|
||||
2. Execute `npm run test`
|
||||
|
||||
|
||||
## Debugging Pyright
|
||||
|
||||
To debug pyright, open the root source directory within VS Code. Open the debug sub-panel and choose “Pyright CLI” from the debug target menu. Click on the green “run” icon or press F5 to build and launch the command-line version in the VS Code debugger. There's also a similar option that provides a slightly faster build/debug loop: make sure you've built the pyright-internal project e.g. with Terminal > Run Build Task > tsc: watch, then choose “Pyright CLI (pyright-internal)”.
|
||||
|
||||
To debug the VS Code extension, select “Pyright extension” from the debug target menu. Click on the green “run” icon or press F5 to build and launch a second copy of VS Code with the extension. Within the second VS Code instance, open a python source file so the pyright extension is loaded. Return to the first instance of VS Code and select “Pyright extension attach server” from the debug target menu and click the green “run” icon. This will attach the debugger to the process that hosts the type checker. You can now set breakpoints, etc.
|
||||
|
||||
To debug the VS Code extension in watch mode, you can do the above, but select “Pyright extension (watch mode)”. When pyright's source is saved, an incremental build will occur, and you can either reload the second VS Code window or relaunch it to start using the updated code. Note that the watcher stays open when debugging stops, so you may need to stop it (or close VS Code) if you want to perform packaging steps without the output potentially being overwritten.
|
||||
8
docs/builtins.md
Normal file
8
docs/builtins.md
Normal file
@@ -0,0 +1,8 @@
|
||||
## Extending Builtins
|
||||
|
||||
The Python interpreter implicitly adds a set of symbols that are available within every module even though they are not explicitly imported. These so-called “built in” symbols include commonly-used types and functions such as “list”, “dict”, “int”, “float”, “min”, and “len”.
|
||||
|
||||
Pyright gains knowledge of which types are included in “builtins” scope through the type stub file `builtins.pyi`. This stub file comes from the typeshed github repo and is bundled with pyright, along with type stubs that describe other stdlib modules.
|
||||
|
||||
Some Python environments are customized to include additional builtins symbols. If you are using such an environment, you may want to tell Pyright about these additional symbols that are available at runtime. To do so, you can add a local type stub file called `__builtins__.pyi`. This file can be placed at the root of your project directory or at the root of the subdirectory specified in the `stubPath` setting (which is named `typings` by default).
|
||||
|
||||
129
docs/ci-integration.md
Normal file
129
docs/ci-integration.md
Normal file
@@ -0,0 +1,129 @@
|
||||
## Integrating Pyright into Continuous Integration
|
||||
|
||||
### Adding Pyright badge to README.md
|
||||
|
||||
[](https://microsoft.github.io/pyright/)
|
||||
|
||||
To add a “pyright: checked” SVG badge to your project’s README.md file, use the following:
|
||||
|
||||
```text
|
||||
[](https://microsoft.github.io/pyright/)
|
||||
```
|
||||
|
||||
### Running Pyright as a github action
|
||||
|
||||
You can configure pyright to run as a github action.
|
||||
|
||||
```yml
|
||||
- uses: jakebailey/pyright-action@v1
|
||||
with:
|
||||
version: 1.1.xxx # Optional (if you want to pin the version)
|
||||
```
|
||||
|
||||
Refer to the [pyright-action project](https://github.com/jakebailey/pyright-action) for more options.
|
||||
|
||||
### Running Pyright in gitlab (with code-quality review)
|
||||
|
||||
You can configure pyright to run in gitlab, and generate a compatible codequality report.
|
||||
|
||||
```yml
|
||||
job_name:
|
||||
before_script:
|
||||
- npm i -g pyright
|
||||
- npm i -g pyright-to-gitlab-ci
|
||||
script:
|
||||
- pyright <python source> --outputjson > report_raw.json
|
||||
after_script:
|
||||
- pyright-to-gitlab-ci --src report_raw.json --output report.json --base_path .
|
||||
artifacts:
|
||||
paths:
|
||||
- report.json
|
||||
reports:
|
||||
codequality: report.json
|
||||
```
|
||||
|
||||
Refer to the [pyright-to-gitlab-ci](https://www.npmjs.com/package/pyright-to-gitlab-ci) package for more details.
|
||||
|
||||
### Running Pyright as a pre-commit hook
|
||||
|
||||
You can run pyright as a pre-commit hook using the community-maintained [Python wrapper for pyright](https://github.com/RobertCraigie/pyright-python). For pre-commit configuration instructions, refer to [this documentation](https://github.com/RobertCraigie/pyright-python#pre-commit).
|
||||
|
||||
### Running Pyright from a CI script
|
||||
|
||||
You can run pyright from a bash script. Here's a sample script that installs the latest version of pyright and runs it.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
PATH_TO_PYRIGHT=`which pyright`
|
||||
|
||||
vercomp () {
|
||||
if [[ $1 == $2 ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
local IFS=.
|
||||
local i ver1=($1) ver2=($2)
|
||||
# fill empty fields in ver1 with zeros
|
||||
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
|
||||
do
|
||||
ver1[i]=0
|
||||
done
|
||||
for ((i=0; i<${#ver1[@]}; i++))
|
||||
do
|
||||
if [[ -z ${ver2[i]} ]]
|
||||
then
|
||||
# fill empty fields in ver2 with zeros
|
||||
ver2[i]=0
|
||||
fi
|
||||
if ((10#${ver1[i]} > 10#${ver2[i]}))
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
if ((10#${ver1[i]} < 10#${ver2[i]}))
|
||||
then
|
||||
return 2
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Node version check
|
||||
echo "Checking node version..."
|
||||
NODE_VERSION=`node -v | cut -d'v' -f2`
|
||||
MIN_NODE_VERSION="14.21.3"
|
||||
vercomp $MIN_NODE_VERSION $NODE_VERSION
|
||||
# 1 == gt
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo "Node version ${NODE_VERSION} too old, min expected is ${MIN_NODE_VERSION}, run:"
|
||||
echo " npm -g upgrade node"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Do we need to sudo?
|
||||
echo "Checking node_modules dir..."
|
||||
NODE_MODULES=`npm -g root`
|
||||
SUDO="sudo"
|
||||
if [ -w "$NODE_MODULES" ]; then
|
||||
SUDO="" #nop
|
||||
fi
|
||||
|
||||
# If we can't find pyright, install it.
|
||||
echo "Checking pyright exists..."
|
||||
if [ -z "$PATH_TO_PYRIGHT" ]; then
|
||||
echo "...installing pyright"
|
||||
${SUDO} npm install -g pyright
|
||||
else
|
||||
# already installed, upgrade to make sure it's current
|
||||
# this avoids a sudo on launch if we're already current
|
||||
echo "Checking pyright version..."
|
||||
CURRENT=`pyright --version | cut -d' ' -f2`
|
||||
REMOTE=`npm info pyright version`
|
||||
if [ "$CURRENT" != "$REMOTE" ]; then
|
||||
echo "...new version of pyright found, upgrading."
|
||||
${SUDO} npm upgrade -g pyright
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "done."
|
||||
pyright -w
|
||||
```
|
||||
96
docs/command-line.md
Normal file
96
docs/command-line.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# Pyright Command-Line Options
|
||||
|
||||
Usage: pyright [options] [files...] (1)
|
||||
|
||||
Pyright can be run as either a VS Code extension or as a node-based command-line tool. The command-line version allows for the following options:
|
||||
|
||||
| Flag | Description |
|
||||
| :--------------------------------- | :--------------------------------------------------- |
|
||||
| --createstub `<IMPORT>` | Create type stub file(s) for import |
|
||||
| --dependencies | Emit import dependency information |
|
||||
| -h, --help | Show help message |
|
||||
| --ignoreexternal | Ignore external imports for --verifytypes |
|
||||
| --level <LEVEL> | Minimum diagnostic level (error or warning) |
|
||||
| --outputjson | Output results in JSON format |
|
||||
| -p, --project `<FILE OR DIRECTORY>` | Use the configuration file at this location |
|
||||
| --pythonpath `<FILE>` | Path to the Python interpreter (2) |
|
||||
| --pythonplatform `<PLATFORM>` | Analyze for platform (Darwin, Linux, Windows, iOS, Android) |
|
||||
| --pythonversion `<VERSION>` | Analyze for version (3.3, 3.4, etc.) |
|
||||
| --skipunannotated | Skip type analysis of unannotated functions |
|
||||
| --stats | Print detailed performance stats |
|
||||
| -t, --typeshedpath `<DIRECTORY>` | Use typeshed type stubs at this location (3) |
|
||||
| --threads <optional N> | Use up to N threads to parallelize type checking (4) |
|
||||
| -v, --venvpath `<DIRECTORY>` | Directory that contains virtual environments (5) |
|
||||
| --verbose | Emit verbose diagnostics |
|
||||
| --verifytypes `<IMPORT>` | Verify completeness of types in py.typed package |
|
||||
| --version | Print pyright version and exit |
|
||||
| --warnings | Use exit code of 1 if warnings are reported |
|
||||
| -w, --watch | Continue to run and watch for changes (6) |
|
||||
| - | Read file or directory list from stdin |
|
||||
|
||||
(1) If specific files are specified on the command line, it overrides the files or directories specified in the pyrightconfig.json or pyproject.toml file.
|
||||
|
||||
(2) This option is the same as the language server setting `python.pythonPath`. It cannot be used with --venvpath. The --pythonpath options is recommended over --venvpath in most cases. For more details, refer to the [import resolution](import-resolution.md#configuring-your-python-environment) documentation.
|
||||
|
||||
(3) Pyright has built-in typeshed type stubs for Python stdlib functionality. To use a different version of typeshed type stubs, specify the directory with this option.
|
||||
|
||||
(4) This feature is experimental. If thread count is > 1, multiple copies of pyright are executed in parallel to type check files in a project. If no thread count is specified, the thread count is based on the number of available logical processors (if at least 4) or 1 (if less than 4).
|
||||
|
||||
(5) This option is the same as the language server setting `python.venvPath`. It used in conjunction with configuration file, which can refer to different virtual environments by name. For more details, refer to the [configuration](configuration.md) and [import resolution](import-resolution.md#configuring-your-python-environment) documentation. This allows a common config file to be checked in to the project and shared by everyone on the development team without making assumptions about the local paths to the venv directory on each developer’s computer.
|
||||
|
||||
(6) When running in watch mode, pyright will reanalyze only those files that have been modified. These “deltas” are typically much faster than the initial analysis, which needs to analyze all files in the source tree.
|
||||
|
||||
|
||||
# Pyright Exit Codes
|
||||
|
||||
| Exit Code | Meaning |
|
||||
| :---------- | :--------------------------------------------------------------- |
|
||||
| 0 | No errors reported |
|
||||
| 1 | One or more errors reported |
|
||||
| 2 | Fatal error occurred with no errors or warnings reported |
|
||||
| 3 | Config file could not be read or parsed |
|
||||
| 4 | Illegal command-line parameters specified |
|
||||
|
||||
|
||||
# JSON Output
|
||||
|
||||
If the “--outputjson” option is specified on the command line, diagnostics are output in JSON format. The JSON structure is as follows:
|
||||
```javascript
|
||||
{
|
||||
version: string,
|
||||
time: string,
|
||||
generalDiagnostics: Diagnostic[],
|
||||
summary: {
|
||||
filesAnalyzed: number,
|
||||
errorCount: number,
|
||||
warningCount: number,
|
||||
informationCount: number,
|
||||
timeInSec: number
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Each Diagnostic is output in the following format:
|
||||
|
||||
```javascript
|
||||
{
|
||||
file: string,
|
||||
severity: 'error' | 'warning' | 'information',
|
||||
message: string,
|
||||
rule?: string,
|
||||
range: {
|
||||
start: {
|
||||
line: number,
|
||||
character: number
|
||||
},
|
||||
end: {
|
||||
line: number,
|
||||
character: number
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Diagnostic line and character numbers are zero-based.
|
||||
|
||||
Not all diagnostics have an associated diagnostic rule. Diagnostic rules are used only for diagnostics that can be disabled or enabled. If a rule is associated with the diagnostic, it is included in the output. If it’s not, the rule field is omitted from the JSON output.
|
||||
11
docs/commands.md
Normal file
11
docs/commands.md
Normal file
@@ -0,0 +1,11 @@
|
||||
## VS Code Commands
|
||||
|
||||
Pyright offers the following commands, which can be invoked from VS Code’s “Command Palette”, which can be accessed from the View menu or by pressing Cmd-Shift-P.
|
||||
|
||||
### Organize Imports
|
||||
This command reorders all imports found in the global (module-level) scope of the source file. As recommended in PEP8, imports are grouped into three groups, each separated by an empty line. The first group includes all built-in modules, the second group includes all third-party modules, and the third group includes all local modules.
|
||||
|
||||
Within each group, imports are sorted alphabetically. And within each “from X import Y” statement, the imported symbols are sorted alphabetically. Pyright also rewraps any imports that don't fit within a single line, switching to multi-line formatting.
|
||||
|
||||
### Restart Server
|
||||
This command forces the type checker to discard all of its cached type information and restart analysis. It is useful in cases where new type stubs or libraries have been installed.
|
||||
39
docs/comments.md
Normal file
39
docs/comments.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## Comments
|
||||
|
||||
Some behaviors of pyright can be controlled through the use of comments within the source file.
|
||||
|
||||
### File-level Type Controls
|
||||
Strict type checking, where most supported type-checking switches generate errors, can be enabled for a file through the use of a special comment. Typically this comment is placed at or near the top of a code file on its own line.
|
||||
|
||||
```python
|
||||
# pyright: strict
|
||||
```
|
||||
|
||||
Likewise, basic type checking can be enabled for a file. If you use `# pyright: basic`, the settings for the file use the default “basic” settings, not any override settings specified in the configuration file or language server settings. You can override the basic default settings within the file by specifying them individually (see below).
|
||||
|
||||
```python
|
||||
# pyright: basic
|
||||
```
|
||||
|
||||
Individual configuration settings can also be overridden on a per-file basis and optionally combined with “strict” or “basic” type checking. For example, if you want to enable all type checks except for “reportPrivateUsage”, you could add the following comment:
|
||||
|
||||
```python
|
||||
# pyright: strict, reportPrivateUsage=false
|
||||
```
|
||||
|
||||
Diagnostic levels are also supported.
|
||||
|
||||
```python
|
||||
# pyright: reportPrivateUsage=warning, reportOptionalCall=error
|
||||
```
|
||||
|
||||
|
||||
### Line-level Diagnostic Suppression
|
||||
|
||||
PEP 484 defines a special comment `# type: ignore` that can be used at the end of a line to suppress all diagnostics emitted by a type checker on that line. Pyright supports this mechanism.
|
||||
|
||||
Pyright also supports a `# pyright: ignore` comment at the end of a line to suppress all Pyright diagnostics on that line. This can be useful if you use multiple type checkers on your source base and want to limit suppression of diagnostics to Pyright only.
|
||||
|
||||
The `# pyright: ignore` comment accepts an optional list of comma-delimited diagnostic rule names surrounded by square brackets. If such a list is present, only diagnostics within those diagnostic rule categories are suppressed on that line. For example, `# pyright: ignore [reportPrivateUsage, reportGeneralTypeIssues]` would suppress diagnostics related to those two categories but no others.
|
||||
|
||||
If the `reportUnnecessaryTypeIgnoreComment` configuration option is enabled, any unnecessary `# type: ignore` and `# pyright: ignore` comments will be reported so they can be removed.
|
||||
461
docs/configuration.md
Normal file
461
docs/configuration.md
Normal file
@@ -0,0 +1,461 @@
|
||||
## Pyright Configuration
|
||||
|
||||
Pyright offers flexible configuration options specified in a JSON-formatted text configuration. By default, the file is called “pyrightconfig.json” and is located within the root directory of your project. Multi-root workspaces (“Add Folder to Workspace…”) are supported, and each workspace root can have its own “pyrightconfig.json” file. For a sample pyrightconfig.json file, see [below](configuration.md#sample-config-file).
|
||||
|
||||
Pyright settings can also be specified in a `[tool.pyright]` section of a “pyproject.toml” file. A “pyrightconfig.json” file always takes precedent over “pyproject.toml” if both are present. For a sample pyproject.toml file, see [below](configuration.md#sample-pyprojecttoml-file).
|
||||
|
||||
Relative paths specified within the config file are relative to the config file’s location. Paths with shell variables (including `~`) are not supported. Paths within a config file should generally be relative paths so the config file can be shared by other developers who contribute to the project.
|
||||
|
||||
## Environment Options
|
||||
|
||||
The following settings control the *environment* in which Pyright will check for diagnostics. These settings determine how Pyright finds source files, imports, and what Python version specific rules are applied.
|
||||
|
||||
- **include** [array of paths, optional]: Paths of directories or files that should be considered part of the project. If no paths are specified, pyright defaults to the directory that contains the config file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no include paths are specified, the root path for the workspace is assumed.
|
||||
|
||||
- **exclude** [array of paths, optional]: Paths of directories or files that should not be considered part of the project. These override the directories and files that `include` matched, allowing specific subdirectories to be excluded. Note that files in the exclude paths may still be included in the analysis if they are referenced (imported) by source files that are not excluded. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). If no exclude paths are specified, Pyright automatically excludes the following: `**/node_modules`, `**/__pycache__`, `**/.*`. Pylance also excludes any virtual environment directories regardless of the exclude paths specified. For more detail on Python environment specification and discovery, refer to the [import resolution](import-resolution.md#configuring-your-python-environment) documentation.
|
||||
|
||||
- **strict** [array of paths, optional]: Paths of directories or files that should use “strict” analysis if they are included. This is the same as manually adding a “# pyright: strict” comment. In strict mode, most type-checking rules are enabled. Refer to [this table](configuration.md#diagnostic-settings-defaults) for details about which rules are enabled in strict mode. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character).
|
||||
|
||||
- **extends** [path, optional]: Path to another `.json` or `.toml` file that is used as a “base configuration”, allowing this configuration to inherit configuration settings. Top-level keys within this configuration overwrite top-level keys in the base configuration. Multiple levels of inheritance are supported. Relative paths specified in a configuration file are resolved relative to the location of that configuration file.
|
||||
|
||||
- **defineConstant** [map of constants to values (boolean or string), optional]: Set of identifiers that should be assumed to contain a constant value wherever used within this program. For example, `{ "DEBUG": true }` indicates that pyright should assume that the identifier `DEBUG` will always be equal to `True`. If this identifier is used within a conditional expression (such as `if not DEBUG:`) pyright will use the indicated value to determine whether the guarded block is reachable or not. Member expressions that reference one of these constants (e.g. `my_module.DEBUG`) are also supported.
|
||||
|
||||
- **typeshedPath** [path, optional]: Path to a directory that contains typeshed type stub files. Pyright ships with a bundled copy of typeshed type stubs. If you want to use a different version of typeshed stubs, you can clone the [typeshed github repo](https://github.com/python/typeshed) to a local directory and reference the location with this path. This option is useful if you’re actively contributing updates to typeshed.
|
||||
|
||||
- **stubPath** [path, optional]: Path to a directory that contains custom type stubs. Each package's type stub file(s) are expected to be in its own subdirectory. The default value of this setting is "./typings". (typingsPath is now deprecated)
|
||||
|
||||
- **venvPath** [path, optional]: Path to a directory containing one or more subdirectories, each of which contains a virtual environment. When used in conjunction with a **venv** setting (see below), pyright will search for imports in the virtual environment’s site-packages directory rather than the paths specified by the default Python interpreter. If you are working on a project with other developers, it is best not to specify this setting in the config file, since this path will typically differ for each developer. Instead, it can be specified on the command line or in a per-user setting. For more details, refer to the [import resolution](import-resolution.md#configuring-your-python-environment) documentation. This setting is ignored when using Pylance. VS Code's python interpreter path is used instead.
|
||||
|
||||
- **venv** [string, optional]: Used in conjunction with the venvPath, specifies the virtual environment to use. For more details, refer to the [import resolution](import-resolution.md#configuring-your-python-environment) documentation. This setting is ignored when using Pylance.
|
||||
|
||||
- **verboseOutput** [boolean]: Specifies whether output logs should be verbose. This is useful when diagnosing certain problems like import resolution issues.
|
||||
|
||||
- **extraPaths** [array of strings, optional]: Additional search paths that will be used when searching for modules imported by files.
|
||||
|
||||
- **pythonVersion** [string, optional]: Specifies the version of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalizes type definitions based on the version. If no version is specified, pyright will use the version of the current python interpreter, if one is present.
|
||||
|
||||
- **pythonPlatform** [string, optional]: Specifies the target platform that will be used to execute the source code. Should be one of `"Windows"`, `"Darwin"`, `"Linux"`, `"iOS"`, `"Android"`, or `"All"`. If specified, pyright will tailor its use of type stub files, which conditionalize type definitions based on the platform. If no platform is specified, pyright will use the current platform.
|
||||
|
||||
- **executionEnvironments** [array of objects, optional]: Specifies a list of execution environments (see [below](configuration.md#execution-environment-options)). Execution environments are searched from start to finish by comparing the path of a source file with the root path specified in the execution environment.
|
||||
|
||||
- **useLibraryCodeForTypes** [boolean]: Determines whether pyright reads, parses and analyzes library code to extract type information in the absence of type stub files. Type information will typically be incomplete. We recommend using type stubs where possible. The default value for this option is true.
|
||||
|
||||
## Type Evaluation Settings
|
||||
|
||||
The following settings determine how different types should be evaluated.
|
||||
|
||||
- <a name="strictListInference"></a> **strictListInference** [boolean]: When inferring the type of a list, use strict type assumptions. For example, the expression `[1, 'a', 3.4]` could be inferred to be of type `list[Any]` or `list[int | str | float]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`.
|
||||
|
||||
- <a name="strictDictionaryInference"></a> **strictDictionaryInference** [boolean]: When inferring the type of a dictionary’s keys and values, use strict type assumptions. For example, the expression `{'a': 1, 'b': 'a'}` could be inferred to be of type `dict[str, Any]` or `dict[str, int | str]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`.
|
||||
|
||||
- <a name="strictSetInference"></a> **strictSetInference** [boolean]: When inferring the type of a set, use strict type assumptions. For example, the expression `{1, 'a', 3.4}` could be inferred to be of type `set[Any]` or `set[int | str | float]`. If this setting is true, it will use the latter (stricter) type. The default value for this setting is `false`.
|
||||
|
||||
- <a name="analyzeUnannotatedFunctions"></a> **analyzeUnannotatedFunctions** [boolean]: Analyze and report errors for functions and methods that have no type annotations for input parameters or return types. The default value for this setting is `true`.
|
||||
|
||||
- <a name="strictParameterNoneValue"></a> **strictParameterNoneValue** [boolean]: PEP 484 indicates that when a function parameter is assigned a default value of None, its type should implicitly be Optional even if the explicit type is not. When enabled, this rule requires that parameter type annotations use Optional explicitly in this case. The default value for this setting is `true`.
|
||||
|
||||
- <a name="enableTypeIgnoreComments"></a> **enableTypeIgnoreComments** [boolean]: PEP 484 defines support for "# type: ignore" comments. This switch enables or disables support for these comments. The default value for this setting is `true`. This does not affect "# pyright: ignore" comments.
|
||||
|
||||
- <a name="deprecateTypingAliases"></a> **deprecateTypingAliases** [boolean]: PEP 585 indicates that aliases to types in standard collections that were introduced solely to support generics are deprecated as of Python 3.9. This switch controls whether these are treated as deprecated. This applies only when pythonVersion is 3.9 or newer. The default value for this setting is `false` but may be switched to `true` in the future.
|
||||
|
||||
- <a name="enableReachabilityAnalysis"></a> **enableReachabilityAnalysis** [boolean]: If enabled, code that is determined to be unreachable by type analysis is reported using a tagged hint. This setting does not affect code that is determined to be unreachable independent of type analysis; such code is always reported as unreachable using a tagged hint. This setting also has no effect when using the command-line version of pyright because it never emits tagged hints for unreachable code.
|
||||
|
||||
- <a name="enableExperimentalFeatures"></a> **enableExperimentalFeatures** [boolean]: Enables a set of experimental (mostly undocumented) features that correspond to proposed or exploratory changes to the Python typing standard. These features will likely change or be removed, so they should not be used except for experimentation purposes. The default value for this setting is `false`.
|
||||
|
||||
- <a name="disableBytesTypePromotions"></a> **disableBytesTypePromotions** [boolean]: Disables legacy behavior where `bytearray` and `memoryview` are considered subtypes of `bytes`. [PEP 688](https://peps.python.org/pep-0688/#no-special-meaning-for-bytes) deprecates this behavior, but this switch is provided to restore the older behavior. The default value for this setting is `true`.
|
||||
|
||||
## Type Check Diagnostics Settings
|
||||
The following settings control pyright’s diagnostic output (warnings or errors).
|
||||
|
||||
- **typeCheckingMode** ["off", "basic", "standard", "strict"]: Specifies the default rule set to use. Some rules can be overridden using additional configuration flags documented below. The default value for this setting is "standard". If set to "off", all type-checking rules are disabled, but Python syntax and semantic errors are still reported.
|
||||
|
||||
- **ignore** [array of paths, optional]: Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed even if they are an included file or within the transitive closure of an included file. Paths may contain wildcard characters ** (a directory or multiple levels of directories), * (a sequence of zero or more characters), or ? (a single character). This setting can be overridden in VS code in your settings.json.
|
||||
|
||||
### Type Check Rule Overrides
|
||||
|
||||
The following settings allow more fine grained control over the **typeCheckingMode**. Unless otherwise specified, each diagnostic setting can specify a boolean value (`false` indicating that no error is generated and `true` indicating that an error is generated). Alternatively, a string value of `"none"`, `"warning"`, `"information"`, or `"error"` can be used to specify the diagnostic level.
|
||||
|
||||
- <a name="reportGeneralTypeIssues"></a> **reportGeneralTypeIssues** [boolean or string, optional]: Generate or suppress diagnostics for general type inconsistencies, unsupported operations, argument/parameter mismatches, etc. This covers all of the basic type-checking rules not covered by other rules. It does not include syntax errors. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportPropertyTypeMismatch"></a> **reportPropertyTypeMismatch** [boolean or string, optional]: Generate or suppress diagnostics for properties where the type of the value passed to the setter is not assignable to the value returned by the getter. Such mismatches violate the intended use of properties, which are meant to act like variables. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportFunctionMemberAccess"></a> **reportFunctionMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for non-standard member accesses for functions. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportMissingImports"></a> **reportMissingImports** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding imported python file or type stub file. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportMissingModuleSource"></a> **reportMissingModuleSource** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding source file. This happens when a type stub is found, but the module source file was not found, indicating that the code may fail at runtime when using this execution environment. Type checking will be done using the type stub. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportInvalidTypeForm"></a> **reportInvalidTypeForm** [boolean or string, optional]: Generate or suppress diagnostics for type annotations that use invalid type expression forms or are semantically invalid. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportMissingTypeStubs"></a> **reportMissingTypeStubs** [boolean or string, optional]: Generate or suppress diagnostics for imports that have no corresponding type stub file (either a typeshed file or a custom type stub). The type checker requires type stubs to do its best job at analysis. The default value for this setting is `"none"`. Note that there is a corresponding quick fix for this diagnostics that let you generate custom type stub to improve editing experiences.
|
||||
|
||||
- <a name="reportImportCycles"></a> **reportImportCycles** [boolean or string, optional]: Generate or suppress diagnostics for cyclical import chains. These are not errors in Python, but they do slow down type analysis and often hint at architectural layering issues. Generally, they should be avoided. The default value for this setting is `"none"`. Note that there are import cycles in the typeshed stdlib typestub files that are ignored by this setting.
|
||||
|
||||
- <a name="reportUnusedImport"></a> **reportUnusedImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol that is not referenced within that file. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnusedClass"></a> **reportUnusedClass** [boolean or string, optional]: Generate or suppress diagnostics for a class with a private name (starting with an underscore) that is not accessed. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnusedFunction"></a> **reportUnusedFunction** [boolean or string, optional]: Generate or suppress diagnostics for a function or method with a private name (starting with an underscore) that is not accessed. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnusedVariable"></a> **reportUnusedVariable** [boolean or string, optional]: Generate or suppress diagnostics for a variable that is not accessed. The default value for this setting is `"none"`. Variables whose names begin with an underscore are exempt from this check.
|
||||
|
||||
- <a name="reportDuplicateImport"></a> **reportDuplicateImport** [boolean or string, optional]: Generate or suppress diagnostics for an imported symbol or module that is imported more than once. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportWildcardImportFromLibrary"></a> **reportWildcardImportFromLibrary** [boolean or string, optional]: Generate or suppress diagnostics for a wildcard import from an external library. The use of this language feature is highly discouraged and can result in bugs when the library is updated. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportAbstractUsage"></a> **reportAbstractUsage** [boolean or string, optional]: Generate or suppress diagnostics for the attempted instantiate an abstract or protocol class or use of an abstract method. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportArgumentType"></a> **reportArgumentType** [boolean or string, optional]: Generate or suppress diagnostics for argument type incompatibilities when evaluating a call expression. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportAssertTypeFailure"></a> **reportAssertTypeFailure** [boolean or string, optional]: Generate or suppress diagnostics for a type mismatch detected by the `typing.assert_type` call. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportAssignmentType"></a> **reportAssignmentType** [boolean or string, optional]: Generate or suppress diagnostics for assignment type incompatibility. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportAttributeAccessIssue"></a> **reportAttributeAccessIssue** [boolean or string, optional]: Generate or suppress diagnostics related to attribute accesses. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportCallIssue"></a> **reportCallIssue** [boolean or string, optional]: Generate or suppress diagnostics related to call expressions and arguments passed to a call target. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportInconsistentOverload"></a> **reportInconsistentOverload** [boolean or string, optional]: Generate or suppress diagnostics for an overloaded function that has overload signatures that are inconsistent with each other or with the implementation. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportIndexIssue"></a> **reportIndexIssue** [boolean or string, optional]: Generate or suppress diagnostics related to index operations and expressions. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportInvalidTypeArguments"></a> **reportInvalidTypeArguments** [boolean or string, optional]: Generate or suppress diagnostics for invalid type argument usage. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportNoOverloadImplementation"></a> **reportNoOverloadImplementation** [boolean or string, optional]: Generate or suppress diagnostics for an overloaded function or method if the implementation is not provided. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOperatorIssue"></a> **reportOperatorIssue** [boolean or string, optional]: Generate or suppress diagnostics related to the use of unary or binary operators (like `*` or `not`). The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalSubscript"></a> **reportOptionalSubscript** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to subscript (index) a variable with an Optional type. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalMemberAccess"></a> **reportOptionalMemberAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a member of a variable with an Optional type. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalCall"></a> **reportOptionalCall** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to call a variable with an Optional type. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalIterable"></a> **reportOptionalIterable** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an iterable value (e.g. within a `for` statement). The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalContextManager"></a> **reportOptionalContextManager** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as a context manager (as a parameter to a `with` statement). The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportOptionalOperand"></a> **reportOptionalOperand** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to use an Optional type as an operand to a unary operator (like `~`) or the left-hand operator of a binary operator (like `*` or `<<`). The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportRedeclaration"></a> **reportRedeclaration** [boolean or string, optional]: Generate or suppress diagnostics for a symbol that has more than one type declaration. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportReturnType"></a> **reportReturnType** [boolean or string, optional]: Generate or suppress diagnostics related to function return type compatibility. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportTypedDictNotRequiredAccess"></a> **reportTypedDictNotRequiredAccess** [boolean or string, optional]: Generate or suppress diagnostics for an attempt to access a non-required field within a TypedDict without first checking whether it is present. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportUntypedFunctionDecorator"></a> **reportUntypedFunctionDecorator** [boolean or string, optional]: Generate or suppress diagnostics for function decorators that have no type annotations. These obscure the function type, defeating many type analysis features. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUntypedClassDecorator"></a> **reportUntypedClassDecorator** [boolean or string, optional]: Generate or suppress diagnostics for class decorators that have no type annotations. These obscure the class type, defeating many type analysis features. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUntypedBaseClass"></a> **reportUntypedBaseClass** [boolean or string, optional]: Generate or suppress diagnostics for base classes whose type cannot be determined statically. These obscure the class type, defeating many type analysis features. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUntypedNamedTuple"></a> **reportUntypedNamedTuple** [boolean or string, optional]: Generate or suppress diagnostics when “namedtuple” is used rather than “NamedTuple”. The former contains no type information, whereas the latter does. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportPrivateUsage"></a> **reportPrivateUsage** [boolean or string, optional]: Generate or suppress diagnostics for incorrect usage of private or protected variables or functions. Protected class members begin with a single underscore (“_”) and can be accessed only by subclasses. Private class members begin with a double underscore but do not end in a double underscore and can be accessed only within the declaring class. Variables and functions declared outside of a class are considered private if their names start with either a single or double underscore, and they cannot be accessed outside of the declaring module. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportTypeCommentUsage"></a> **reportTypeCommentUsage** [boolean or string, optional]: Prior to Python 3.5, the grammar did not support type annotations, so types needed to be specified using “type comments”. Python 3.5 eliminated the need for function type comments, and Python 3.6 eliminated the need for variable type comments. Future versions of Python will likely deprecate all support for type comments. If enabled, this check will flag any type comment usage unless it is required for compatibility with the specified language version. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportPrivateImportUsage"></a> **reportPrivateImportUsage** [boolean or string, optional]: Generate or suppress diagnostics for use of a symbol from a "py.typed" module that is not meant to be exported from that module. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportConstantRedefinition"></a> **reportConstantRedefinition** [boolean or string, optional]: Generate or suppress diagnostics for attempts to redefine variables whose names are all-caps with underscores and numerals. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportDeprecated"></a> **reportDeprecated** [boolean or string, optional]: Generate or suppress diagnostics for use of a class or function that has been marked as deprecated. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportIncompatibleMethodOverride"></a> **reportIncompatibleMethodOverride** [boolean or string, optional]: Generate or suppress diagnostics for methods that override a method of the same name in a base class in an incompatible manner (wrong number of parameters, incompatible parameter types, or incompatible return type). The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportIncompatibleVariableOverride"></a> **reportIncompatibleVariableOverride** [boolean or string, optional]: Generate or suppress diagnostics for class variable declarations that override a symbol of the same name in a base class with a type that is incompatible with the base class symbol type. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportInconsistentConstructor"></a> **reportInconsistentConstructor** [boolean or string, optional]: Generate or suppress diagnostics when an `__init__` method signature is inconsistent with a `__new__` signature. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportOverlappingOverload"></a> **reportOverlappingOverload** [boolean or string, optional]: Generate or suppress diagnostics for function overloads that overlap in signature and obscure each other or have incompatible return types. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportPossiblyUnboundVariable"></a> **reportPossiblyUnboundVariable** [boolean or string, optional]: Generate or suppress diagnostics for variables that are possibly unbound on some code paths. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportMissingSuperCall"></a> **reportMissingSuperCall** [boolean or string, optional]: Generate or suppress diagnostics for `__init__`, `__init_subclass__`, `__enter__` and `__exit__` methods in a subclass that fail to call through to the same-named method on a base class. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUninitializedInstanceVariable"></a> **reportUninitializedInstanceVariable** [boolean or string, optional]: Generate or suppress diagnostics for instance variables within a class that are not initialized or declared within the class body or the `__init__` method. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportInvalidStringEscapeSequence"></a> **reportInvalidStringEscapeSequence** [boolean or string, optional]: Generate or suppress diagnostics for invalid escape sequences used within string literals. The Python specification indicates that such sequences will generate a syntax error in future versions. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportUnknownParameterType"></a> **reportUnknownParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for functions or methods that have an unknown type. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnknownArgumentType"></a> **reportUnknownArgumentType** [boolean or string, optional]: Generate or suppress diagnostics for call arguments for functions or methods that have an unknown type. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnknownLambdaType"></a> **reportUnknownLambdaType** [boolean or string, optional]: Generate or suppress diagnostics for input or return parameters for lambdas that have an unknown type. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnknownVariableType"></a> **reportUnknownVariableType** [boolean or string, optional]: Generate or suppress diagnostics for variables that have an unknown type. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnknownMemberType"></a> **reportUnknownMemberType** [boolean or string, optional]: Generate or suppress diagnostics for class or instance variables that have an unknown type. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportMissingParameterType"></a> **reportMissingParameterType** [boolean or string, optional]: Generate or suppress diagnostics for input parameters for functions or methods that are missing a type annotation. The `self` and `cls` parameters used within methods are exempt from this check. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportMissingTypeArgument"></a> **reportMissingTypeArgument** [boolean or string, optional]: Generate or suppress diagnostics when a generic class is used without providing explicit or implicit type arguments. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportInvalidTypeVarUse"></a> **reportInvalidTypeVarUse** [boolean or string, optional]: Generate or suppress diagnostics when a TypeVar is used inappropriately (e.g. if a TypeVar appears only once) within a generic function signature. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportCallInDefaultInitializer"></a> **reportCallInDefaultInitializer** [boolean or string, optional]: Generate or suppress diagnostics for function calls, list expressions, set expressions, or dictionary expressions within a default value initialization expression. Such calls can mask expensive operations that are performed at module initialization time. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnnecessaryIsInstance"></a> **reportUnnecessaryIsInstance** [boolean or string, optional]: Generate or suppress diagnostics for `isinstance` or `issubclass` calls where the result is statically determined to be always true or always false. Such calls are often indicative of a programming error. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnnecessaryCast"></a> **reportUnnecessaryCast** [boolean or string, optional]: Generate or suppress diagnostics for `cast` calls that are statically determined to be unnecessary. Such calls are sometimes indicative of a programming error. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnnecessaryComparison"></a> **reportUnnecessaryComparison** [boolean or string, optional]: Generate or suppress diagnostics for `==` or `!=` comparisons or other conditional expressions that are statically determined to always evaluate to False or True. Such comparisons are sometimes indicative of a programming error. The default value for this setting is `"none"`. Also reports `case` clauses in a `match` statement that can be statically determined to never match (with exception of the `_` wildcard pattern, which is exempted).
|
||||
|
||||
- <a name="reportUnnecessaryContains"></a> **reportUnnecessaryContains** [boolean or string, optional]: Generate or suppress diagnostics for `in` operations that are statically determined to always evaluate to False or True. Such operations are sometimes indicative of a programming error. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportAssertAlwaysTrue"></a> **reportAssertAlwaysTrue** [boolean or string, optional]: Generate or suppress diagnostics for `assert` statement that will provably always assert because its first argument is a parenthesized tuple (for example, `assert (v > 0, "Bad value")` when the intent was probably `assert v > 0, "Bad value"`). This is a common programming error. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportSelfClsParameterName"></a> **reportSelfClsParameterName** [boolean or string, optional]: Generate or suppress diagnostics for a missing or misnamed “self” parameter in instance methods and “cls” parameter in class methods. Instance methods in metaclasses (classes that derive from “type”) are allowed to use “cls” for instance methods. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportImplicitStringConcatenation"></a> **reportImplicitStringConcatenation** [boolean or string, optional]: Generate or suppress diagnostics for two or more string literals that follow each other, indicating an implicit concatenation. This is considered a bad practice and often masks bugs such as missing commas. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUndefinedVariable"></a> **reportUndefinedVariable** [boolean or string, optional]: Generate or suppress diagnostics for undefined variables. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportUnboundVariable"></a> **reportUnboundVariable** [boolean or string, optional]: Generate or suppress diagnostics for unbound variables. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportUnhashable"></a> **reportUnhashable** [boolean or string, optional]: Generate or suppress diagnostics for the use of an unhashable object in a container that requires hashability. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportInvalidStubStatement"></a> **reportInvalidStubStatement** [boolean or string, optional]: Generate or suppress diagnostics for statements that are syntactically correct but have no purpose within a type stub file. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportIncompleteStub"></a> **reportIncompleteStub** [boolean or string, optional]: Generate or suppress diagnostics for a module-level `__getattr__` call in a type stub file, indicating that it is incomplete. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnsupportedDunderAll"></a> **reportUnsupportedDunderAll** [boolean or string, optional]: Generate or suppress diagnostics for statements that define or manipulate `__all__` in a way that is not allowed by a static type checker, thus rendering the contents of `__all__` to be unknown or incorrect. Also reports names within the `__all__` list that are not present in the module namespace. The default value for this setting is `"warning"`.
|
||||
|
||||
- <a name="reportUnusedCallResult"></a> **reportUnusedCallResult** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is not None. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnusedCoroutine"></a> **reportUnusedCoroutine** [boolean or string, optional]: Generate or suppress diagnostics for call statements whose return value is not used in any way and is a Coroutine. This identifies a common error where an `await` keyword is mistakenly omitted. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportUnusedExcept"></a> **reportUnusedExcept** [boolean or string, optional]: Generate or suppress diagnostics for an `except` clause that will never be reached. The default value for this setting is `"error"`.
|
||||
|
||||
- <a name="reportUnusedExpression"></a> **reportUnusedExpression** [boolean or string, optional]: Generate or suppress diagnostics for simple expressions whose results are not used in any way. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnnecessaryTypeIgnoreComment"></a> **reportUnnecessaryTypeIgnoreComment** [boolean or string, optional]: Generate or suppress diagnostics for a `# type: ignore` or `# pyright: ignore` comment that would have no effect if removed. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportMatchNotExhaustive"></a> **reportMatchNotExhaustive** [boolean or string, optional]: Generate or suppress diagnostics for a `match` statement that does not provide cases that exhaustively match against all potential types of the target expression. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportUnreachable"></a> **reportUnreachable** [boolean or string, optional]: Generate or suppress diagnostics for code that is determined to be structurally unreachable or unreachable by type analysis. The default value for this setting is `"none"`.
|
||||
|
||||
- <a name="reportImplicitOverride"></a> **reportImplicitOverride** [boolean or string, optional]: Generate or suppress diagnostics for overridden methods in a class that are missing an explicit `@override` decorator. The default value for this setting is `"none"`.
|
||||
|
||||
## Execution Environment Options
|
||||
Pyright allows multiple “execution environments” to be defined for different portions of your source tree. For example, a subtree may be designed to run with different import search paths or a different version of the python interpreter than the rest of the source base.
|
||||
|
||||
The following settings can be specified for each execution environment. Each source file within a project is associated with at most one execution environment -- the first one whose root directory contains that file.
|
||||
|
||||
- **root** [string, required]: Root path for the code that will execute within this execution environment.
|
||||
|
||||
- **extraPaths** [array of strings, optional]: Additional search paths (in addition to the root path) that will be used when searching for modules imported by files within this execution environment. If specified, this overrides the default extraPaths setting when resolving imports for files within this execution environment. Note that each file’s execution environment mapping is independent, so if file A is in one execution environment and imports a second file B within a second execution environment, any imports from B will use the extraPaths in the second execution environment.
|
||||
|
||||
- **pythonVersion** [string, optional]: The version of Python used for this execution environment. If not specified, the global `pythonVersion` setting is used instead.
|
||||
|
||||
- **pythonPlatform** [string, optional]: Specifies the target platform that will be used for this execution environment. If not specified, the global `pythonPlatform` setting is used instead.
|
||||
|
||||
In addition, any of the [type check diagnostics settings](configuration.md#type-check-diagnostics-settings) listed above can be specified. These settings act as overrides for the files in this execution environment.
|
||||
|
||||
## Sample Config File
|
||||
The following is an example of a pyright config file:
|
||||
```json
|
||||
{
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
|
||||
"exclude": [
|
||||
"**/node_modules",
|
||||
"**/__pycache__",
|
||||
"src/experimental",
|
||||
"src/typestubs"
|
||||
],
|
||||
|
||||
"ignore": [
|
||||
"src/oldstuff"
|
||||
],
|
||||
|
||||
"defineConstant": {
|
||||
"DEBUG": true
|
||||
},
|
||||
|
||||
"stubPath": "src/stubs",
|
||||
|
||||
"reportMissingImports": "error",
|
||||
"reportMissingTypeStubs": false,
|
||||
|
||||
"pythonVersion": "3.6",
|
||||
"pythonPlatform": "Linux",
|
||||
|
||||
"executionEnvironments": [
|
||||
{
|
||||
"root": "src/web",
|
||||
"pythonVersion": "3.5",
|
||||
"pythonPlatform": "Windows",
|
||||
"extraPaths": [
|
||||
"src/service_libs"
|
||||
],
|
||||
"reportMissingImports": "warning"
|
||||
},
|
||||
{
|
||||
"root": "src/sdk",
|
||||
"pythonVersion": "3.0",
|
||||
"extraPaths": [
|
||||
"src/backend"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "src/tests",
|
||||
"extraPaths": [
|
||||
"src/tests/e2e",
|
||||
"src/sdk"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "src"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Sample pyproject.toml File
|
||||
```toml
|
||||
[tool.pyright]
|
||||
include = ["src"]
|
||||
exclude = ["**/node_modules",
|
||||
"**/__pycache__",
|
||||
"src/experimental",
|
||||
"src/typestubs"
|
||||
]
|
||||
ignore = ["src/oldstuff"]
|
||||
defineConstant = { DEBUG = true }
|
||||
stubPath = "src/stubs"
|
||||
|
||||
reportMissingImports = "error"
|
||||
reportMissingTypeStubs = false
|
||||
|
||||
pythonVersion = "3.6"
|
||||
pythonPlatform = "Linux"
|
||||
|
||||
executionEnvironments = [
|
||||
{ root = "src/web", pythonVersion = "3.5", pythonPlatform = "Windows", extraPaths = [ "src/service_libs" ], reportMissingImports = "warning" },
|
||||
{ root = "src/sdk", pythonVersion = "3.0", extraPaths = [ "src/backend" ] },
|
||||
{ root = "src/tests", extraPaths = ["src/tests/e2e", "src/sdk" ]},
|
||||
{ root = "src" }
|
||||
]
|
||||
```
|
||||
|
||||
## Diagnostic Settings Defaults
|
||||
|
||||
Each diagnostic setting has a default that is dictated by the specified type checking mode. The default for each rule can be overridden in the configuration file or settings. In strict type checking mode, overrides may only increase the strictness (e.g. increase the severity level from `"warning"` to `"error"`).
|
||||
|
||||
The following table lists the default severity levels for each diagnostic rule within each type checking mode (`"off"`, `"basic"`, `"standard"` and `"strict"`).
|
||||
|
||||
| Diagnostic Rule | Off | Basic | Standard | Strict |
|
||||
| :---------------------------------------- | :--------- | :--------- | :--------- | :--------- |
|
||||
| analyzeUnannotatedFunctions | true | true | true | true |
|
||||
| disableBytesTypePromotions | true | true | true | true |
|
||||
| strictParameterNoneValue | true | true | true | true |
|
||||
| enableTypeIgnoreComments | true | true | true | true |
|
||||
| enableReachabilityAnalysis | false | true | true | true |
|
||||
| strictListInference | false | false | false | true |
|
||||
| strictDictionaryInference | false | false | false | true |
|
||||
| strictSetInference | false | false | false | true |
|
||||
| deprecateTypingAliases | false | false | false | false |
|
||||
| enableExperimentalFeatures | false | false | false | false |
|
||||
| reportMissingTypeStubs | "none" | "none" | "none" | "error" |
|
||||
| reportMissingModuleSource | "warning" | "warning" | "warning" | "warning" |
|
||||
| reportInvalidTypeForm | "warning" | "error" | "error" | "error" |
|
||||
| reportMissingImports | "warning" | "error" | "error" | "error" |
|
||||
| reportUndefinedVariable | "warning" | "error" | "error" | "error" |
|
||||
| reportAssertAlwaysTrue | "none" | "warning" | "warning" | "error" |
|
||||
| reportInvalidStringEscapeSequence | "none" | "warning" | "warning" | "error" |
|
||||
| reportInvalidTypeVarUse | "none" | "warning" | "warning" | "error" |
|
||||
| reportSelfClsParameterName | "none" | "warning" | "warning" | "error" |
|
||||
| reportUnsupportedDunderAll | "none" | "warning" | "warning" | "error" |
|
||||
| reportUnusedExpression | "none" | "warning" | "warning" | "error" |
|
||||
| reportWildcardImportFromLibrary | "none" | "warning" | "warning" | "error" |
|
||||
| reportAbstractUsage | "none" | "error" | "error" | "error" |
|
||||
| reportArgumentType | "none" | "error" | "error" | "error" |
|
||||
| reportAssertTypeFailure | "none" | "error" | "error" | "error" |
|
||||
| reportAssignmentType | "none" | "error" | "error" | "error" |
|
||||
| reportAttributeAccessIssue | "none" | "error" | "error" | "error" |
|
||||
| reportCallIssue | "none" | "error" | "error" | "error" |
|
||||
| reportGeneralTypeIssues | "none" | "error" | "error" | "error" |
|
||||
| reportInconsistentOverload | "none" | "error" | "error" | "error" |
|
||||
| reportIndexIssue | "none" | "error" | "error" | "error" |
|
||||
| reportInvalidTypeArguments | "none" | "error" | "error" | "error" |
|
||||
| reportNoOverloadImplementation | "none" | "error" | "error" | "error" |
|
||||
| reportOperatorIssue | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalSubscript | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalMemberAccess | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalCall | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalIterable | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalContextManager | "none" | "error" | "error" | "error" |
|
||||
| reportOptionalOperand | "none" | "error" | "error" | "error" |
|
||||
| reportRedeclaration | "none" | "error" | "error" | "error" |
|
||||
| reportReturnType | "none" | "error" | "error" | "error" |
|
||||
| reportTypedDictNotRequiredAccess | "none" | "error" | "error" | "error" |
|
||||
| reportPrivateImportUsage | "none" | "error" | "error" | "error" |
|
||||
| reportUnboundVariable | "none" | "error" | "error" | "error" |
|
||||
| reportUnhashable | "none" | "error" | "error" | "error" |
|
||||
| reportUnusedCoroutine | "none" | "error" | "error" | "error" |
|
||||
| reportUnusedExcept | "none" | "error" | "error" | "error" |
|
||||
| reportFunctionMemberAccess | "none" | "none" | "error" | "error" |
|
||||
| reportIncompatibleMethodOverride | "none" | "none" | "error" | "error" |
|
||||
| reportIncompatibleVariableOverride | "none" | "none" | "error" | "error" |
|
||||
| reportOverlappingOverload | "none" | "none" | "error" | "error" |
|
||||
| reportPossiblyUnboundVariable | "none" | "none" | "error" | "error" |
|
||||
| reportConstantRedefinition | "none" | "none" | "none" | "error" |
|
||||
| reportDeprecated | "none" | "none" | "none" | "error" |
|
||||
| reportDuplicateImport | "none" | "none" | "none" | "error" |
|
||||
| reportIncompleteStub | "none" | "none" | "none" | "error" |
|
||||
| reportInconsistentConstructor | "none" | "none" | "none" | "error" |
|
||||
| reportInvalidStubStatement | "none" | "none" | "none" | "error" |
|
||||
| reportMatchNotExhaustive | "none" | "none" | "none" | "error" |
|
||||
| reportMissingParameterType | "none" | "none" | "none" | "error" |
|
||||
| reportMissingTypeArgument | "none" | "none" | "none" | "error" |
|
||||
| reportPrivateUsage | "none" | "none" | "none" | "error" |
|
||||
| reportTypeCommentUsage | "none" | "none" | "none" | "error" |
|
||||
| reportUnknownArgumentType | "none" | "none" | "none" | "error" |
|
||||
| reportUnknownLambdaType | "none" | "none" | "none" | "error" |
|
||||
| reportUnknownMemberType | "none" | "none" | "none" | "error" |
|
||||
| reportUnknownParameterType | "none" | "none" | "none" | "error" |
|
||||
| reportUnknownVariableType | "none" | "none" | "none" | "error" |
|
||||
| reportUnnecessaryCast | "none" | "none" | "none" | "error" |
|
||||
| reportUnnecessaryComparison | "none" | "none" | "none" | "error" |
|
||||
| reportUnnecessaryContains | "none" | "none" | "none" | "error" |
|
||||
| reportUnnecessaryIsInstance | "none" | "none" | "none" | "error" |
|
||||
| reportUnusedClass | "none" | "none" | "none" | "error" |
|
||||
| reportUnusedImport | "none" | "none" | "none" | "error" |
|
||||
| reportUnusedFunction | "none" | "none" | "none" | "error" |
|
||||
| reportUnusedVariable | "none" | "none" | "none" | "error" |
|
||||
| reportUntypedBaseClass | "none" | "none" | "none" | "error" |
|
||||
| reportUntypedClassDecorator | "none" | "none" | "none" | "error" |
|
||||
| reportUntypedFunctionDecorator | "none" | "none" | "none" | "error" |
|
||||
| reportUntypedNamedTuple | "none" | "none" | "none" | "error" |
|
||||
| reportCallInDefaultInitializer | "none" | "none" | "none" | "none" |
|
||||
| reportImplicitOverride | "none" | "none" | "none" | "none" |
|
||||
| reportImplicitStringConcatenation | "none" | "none" | "none" | "none" |
|
||||
| reportImportCycles | "none" | "none" | "none" | "none" |
|
||||
| reportMissingSuperCall | "none" | "none" | "none" | "none" |
|
||||
| reportPropertyTypeMismatch | "none" | "none" | "none" | "none" |
|
||||
| reportUninitializedInstanceVariable | "none" | "none" | "none" | "none" |
|
||||
| reportUnnecessaryTypeIgnoreComment | "none" | "none" | "none" | "none" |
|
||||
| reportUnreachable | "none" | "none" | "none" | "none" |
|
||||
| reportUnusedCallResult | "none" | "none" | "none" | "none" |
|
||||
|
||||
## Overriding settings (in VS Code)
|
||||
|
||||
If a pyproject.toml (with a pyright section) or a pyrightconfig.json exists, any pyright settings in a VS Code settings.json will be ignored. Pyrightconfig.json is prescribing the environment to be used for a particular project. Changing the environment configuration options per user is not supported.
|
||||
|
||||
If a pyproject.toml (with a pyright section) or a pyrightconfig.json does not exist, then the VS Code settings.json settings apply.
|
||||
|
||||
## Locale Configuration
|
||||
|
||||
Pyright provides diagnostic messages that are translated to multiple languages. By default, pyright uses the default locale of the operating system. You can override the desired locale through the use of one of the following environment variables, listed in priority order.
|
||||
|
||||
```
|
||||
LC_ALL="de"
|
||||
LC_MESSAGES="en-us"
|
||||
LANG="zh-cn"
|
||||
LANGUAGE="fr"
|
||||
```
|
||||
|
||||
When running in VS Code, the editor's locale takes precedence. Setting these environment variables applies only when using pyright outside of VS Code.
|
||||
67
docs/features.md
Normal file
67
docs/features.md
Normal file
@@ -0,0 +1,67 @@
|
||||
## Pyright Features
|
||||
|
||||
### Speed
|
||||
Pyright is a fast type checker meant for large Python source bases. It can run in a “watch” mode and performs fast incremental updates when files are modified.
|
||||
|
||||
### Configurability
|
||||
Pyright supports [configuration files](configuration.md) that provide granular control over settings. Different “execution environments” can be associated with subdirectories within a source base. Each environment can specify different module search paths, python language versions, and platform targets.
|
||||
|
||||
### Type Checking Features
|
||||
* [PEP 484](https://www.python.org/dev/peps/pep-0484/) type hints including generics
|
||||
* [PEP 487](https://www.python.org/dev/peps/pep-0487/) simpler customization of class creation
|
||||
* [PEP 526](https://www.python.org/dev/peps/pep-0526/) syntax for variable annotations
|
||||
* [PEP 544](https://www.python.org/dev/peps/pep-0544/) structural subtyping
|
||||
* [PEP 561](https://www.python.org/dev/peps/pep-0561/) distributing and packaging type information
|
||||
* [PEP 563](https://www.python.org/dev/peps/pep-0563/) postponed evaluation of annotations
|
||||
* [PEP 570](https://www.python.org/dev/peps/pep-0570/) position-only parameters
|
||||
* [PEP 585](https://www.python.org/dev/peps/pep-0585/) type hinting generics in standard collections
|
||||
* [PEP 586](https://www.python.org/dev/peps/pep-0586/) literal types
|
||||
* [PEP 589](https://www.python.org/dev/peps/pep-0589/) typed dictionaries
|
||||
* [PEP 591](https://www.python.org/dev/peps/pep-0591/) final qualifier
|
||||
* [PEP 593](https://www.python.org/dev/peps/pep-0593/) flexible variable annotations
|
||||
* [PEP 604](https://www.python.org/dev/peps/pep-0604/) complementary syntax for unions
|
||||
* [PEP 612](https://www.python.org/dev/peps/pep-0612/) parameter specification variables
|
||||
* [PEP 613](https://www.python.org/dev/peps/pep-0613/) explicit type aliases
|
||||
* [PEP 635](https://www.python.org/dev/peps/pep-0635/) structural pattern matching
|
||||
* [PEP 646](https://www.python.org/dev/peps/pep-0646/) variadic generics
|
||||
* [PEP 647](https://www.python.org/dev/peps/pep-0647/) user-defined type guards
|
||||
* [PEP 655](https://www.python.org/dev/peps/pep-0655/) required typed dictionary items
|
||||
* [PEP 673](https://www.python.org/dev/peps/pep-0673/) Self type
|
||||
* [PEP 675](https://www.python.org/dev/peps/pep-0675/) arbitrary literal strings
|
||||
* [PEP 681](https://www.python.org/dev/peps/pep-0681/) dataclass transform
|
||||
* [PEP 692](https://www.python.org/dev/peps/pep-0692/) TypedDict for kwargs typing
|
||||
* [PEP 695](https://www.python.org/dev/peps/pep-0695/) type parameter syntax
|
||||
* [PEP 696](https://www.python.org/dev/peps/pep-0696/) type defaults for TypeVarLikes
|
||||
* [PEP 698](https://www.python.org/dev/peps/pep-0698/) override decorator for static typing
|
||||
* [PEP 702](https://www.python.org/dev/peps/pep-0702/) marking deprecations
|
||||
* [PEP 705](https://www.python.org/dev/peps/pep-0705/) TypedDict: read-only items
|
||||
* [PEP 728](https://www.python.org/dev/peps/pep-0728/) TypedDict with typed extra items
|
||||
* [PEP 742](https://www.python.org/dev/peps/pep-0742/) narrowing types with TypeIs
|
||||
* [PEP 746](https://www.python.org/dev/peps/pep-0746/) (experimental) type checking annotated metadata
|
||||
* [PEP 747](https://www.python.org/dev/peps/pep-0747/) (experimental) annotating type forms
|
||||
* [PEP 764](https://www.python.org/dev/peps/pep-0764/) (experimental) inline typed dictionaries
|
||||
* Type inference for function return values, instance variables, class variables, and globals
|
||||
* Type guards that understand conditional code flow constructs like if/else statements
|
||||
|
||||
### Language Server Support
|
||||
Pyright ships as both a command-line tool and a language server that provides many powerful features that help improve programming efficiency.
|
||||
|
||||
* Intelligent type completion of keywords, symbols, and import names appears when editing
|
||||
* Import statements are automatically inserted when necessary for type completions
|
||||
* Signature completion tips help when filling in arguments for a call
|
||||
* Hover over symbols to provide type information and doc strings
|
||||
* Find Definitions to quickly go to the location of a symbol’s definition
|
||||
* Find References to find all references to a symbol within a code base
|
||||
* Rename Symbol to rename all references to a symbol within a code base
|
||||
* Find Symbols within the current document or within the entire workspace
|
||||
* View call hierarchy information — calls made within a function and places where a function is called
|
||||
* Organize Imports command for automatically ordering imports according to PEP8 rules
|
||||
* Type stub generation for third-party libraries
|
||||
|
||||
### Built-in Type Stubs
|
||||
Pyright includes a recent copy of the stdlib type stubs from [Typeshed](https://github.com/python/typeshed). It can be configured to use another (perhaps more recent or modified) copy of the Typeshed type stubs. Of course, it also works with custom type stub files that are part of your project.
|
||||
|
||||
## Limitations
|
||||
Pyright provides support for Python 3.0 and newer. There are no plans to support older versions.
|
||||
|
||||
|
||||
26
docs/getting-started.md
Normal file
26
docs/getting-started.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## Getting Started with Type Checking
|
||||
|
||||
A static type checker like Pyright can add incremental value to your source code as more type information is provided.
|
||||
|
||||
Here is a typical progression:
|
||||
|
||||
### 1. Initial Type Checking
|
||||
* Install pyright (either the language server or command-line tool).
|
||||
* Write a minimal `pyrightconfig.json` that defines `include` entries. Place the config file in your project’s top-level directory and commit it to your repo. Alternatively, you can add a pyright section to a `pyproject.toml` file. For additional details and a sample config file, refer to [this documentation](configuration.md).
|
||||
* Run pyright over your source base with the default settings. Fix any errors and warnings that it emits. Optionally disable specific diagnostic rules if they are generating too many errors. They can be re-enabled at a later time.
|
||||
|
||||
### 2. Types For Imported Libraries
|
||||
* Update dependent libraries to recent versions. Many popular libraries have recently added inlined types, which eliminates the need to install or create type stubs.
|
||||
* Enable the `reportMissingTypeStubs` setting in the config file and add (minimal) type stub files for the imported files. You may wish to create a stubs directory within your code base — a location for all of your custom type stub files. Configure the “stubPath” config entry to refer to this directory.
|
||||
* Look for type stubs for the packages you use. Some package authors opt to ship stubs as a separate companion package named that has “-stubs” appended to the name of the original package.
|
||||
* In cases where type stubs do not yet exist for a package you are using, consider creating a custom type stub that defines the portion of the interface that your source code consumes. Check in your custom type stub files and configure pyright to run as part of your continuous integration (CI) environment to keep the project “type clean”.
|
||||
|
||||
### 3. Incremental Typing
|
||||
* Incrementally add type annotations to your code files. The annotations that provide most value are on function input parameters, instance variables, and return parameters (in that order).
|
||||
* Enable stricter type checking options like "reportUnknownParameterType", and "reportUntypedFunctionDecorator".
|
||||
|
||||
### 4. Strict Typing
|
||||
* On a file-by-file basis, enable all type checking options by adding the comment `# pyright: strict` somewhere in the file.
|
||||
* Optionally add entire subdirectories to the `strict` config entry to indicate that all files within those subdirectories should be strictly typed.
|
||||
|
||||
|
||||
BIN
docs/img/CreateTypeStub1.png
Normal file
BIN
docs/img/CreateTypeStub1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
BIN
docs/img/CreateTypeStub2.png
Normal file
BIN
docs/img/CreateTypeStub2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
docs/img/PyrightLarge.png
Normal file
BIN
docs/img/PyrightLarge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
docs/img/PyrightSmall.png
Normal file
BIN
docs/img/PyrightSmall.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
2
docs/img/pyright_badge.svg
Normal file
2
docs/img/pyright_badge.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20" role="img" aria-label="pyright: checked"><title>pyright: checked</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="104" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="49" height="20" fill="#555"/><rect x="49" width="55" height="20" fill="#4c1"/><rect width="104" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="255" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="390">pyright</text><text x="255" y="140" transform="scale(.1)" fill="#fff" textLength="390">pyright</text><text aria-hidden="true" x="755" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="450">checked</text><text x="755" y="140" transform="scale(.1)" fill="#fff" textLength="450">checked</text></g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
75
docs/import-resolution.md
Normal file
75
docs/import-resolution.md
Normal file
@@ -0,0 +1,75 @@
|
||||
## Import Resolution
|
||||
|
||||
### Resolution Order
|
||||
If the import is relative (the module name starts with one or more dots), it resolves the import relative to the path of the importing source file.
|
||||
|
||||
For absolute (non-relative) imports, Pyright employs the following resolution order:
|
||||
|
||||
1. Try to resolve using the **stubPath** as defined in the `stubPath` config entry or the `python.analysis.stubPath` setting.
|
||||
|
||||
2. Try to resolve using **code within the workspace**.
|
||||
|
||||
* Try to resolve relative to the **root directory** of the execution environment. If no execution environments are specified in the config file, use the root of the workspace. For more information about execution environments, refer to the [configuration documentation](configuration.md#execution-environment-options).
|
||||
|
||||
* Try to resolve using any of the **extra paths** defined for the execution environment in the config file. If no execution environment applies, use the `python.analysis.extraPaths` setting. Extra paths are searched in the order in which they are provided in the config file or setting.
|
||||
|
||||
* If no execution environment is configured, try to resolve using the **local directory `src`**. It is common for Python projects to place local source files within a directory of this name.
|
||||
|
||||
3. Try to resolve using **stubs or inlined types found within installed packages**. Pyright uses the configured Python environment to determine whether a package has been installed. For more details about how to configure your Python environment for Pyright, see below. If a Python environment is configured, Pyright looks in the `lib/site-packages`, `Lib/site-packages`, or `python*/site-packages` subdirectory. If no site-packages directory can be found, Pyright attempts to run the configured Python interpreter and ask it for its search paths. If no Python environment is configured, Pyright will use the default Python interpreter by invoking `python`.
|
||||
|
||||
* For a given package, try to resolve first using a **stub package**. Stub packages, as defined in [PEP 561](https://www.python.org/dev/peps/pep-0561/#type-checker-module-resolution-order), are named the same as the original package but with “-stubs” appended.
|
||||
* Try to resolve using an **inline stub**, a “.pyi” file that ships within the package.
|
||||
* If the package contains a “py.typed” file as described in [PEP 561](https://www.python.org/dev/peps/pep-0561/), use inlined type annotations provided in “.py” files within the package.
|
||||
* If the `python.analysis.useLibraryCodeForTypes` setting is set to true, try to resolve using the **library implementation** (“.py” file). Some “.py” files may contain partial or complete type annotations. Pyright will use type annotations that are provided and do its best to infer any missing type information.
|
||||
|
||||
4. Try to resolve using a **stdlib typeshed stub**. If the `typeshedPath` is configured, use this instead of the typeshed stubs that are packaged with Pyright. This allows for the use of a newer or a patched version of the typeshed stdlib stubs.
|
||||
|
||||
5. Try to resolve using a **third-party typeshed** stub. If the `typeshedPath` is configured, use this instead of the typeshed stubs that are packaged with Pyright. This allows for the use of a newer or a patched version of the typeshed third-party stubs.
|
||||
|
||||
6. For an absolute import, if all of the above attempts fail, attempt to import a module from the same directory as the importing file and parent directories that are also children of the root workspace. This accommodates cases where it is assumed that a Python script will be executed from one of these subdirectories rather than from the root directory.
|
||||
|
||||
|
||||
### Configuring Your Python Environment
|
||||
Pyright does not require a Python environment to be configured if all imports can be resolved using local files and type stubs. If a Python environment is configured, it will attempt to use the packages installed in the `site-packages` subdirectory during import resolution.
|
||||
|
||||
Pyright uses the following mechanisms (in priority order) to determine which Python environment to use:
|
||||
|
||||
1. If a `venv` name is specified along with a `python.venvPath` setting (or a `--venvpath` command-line argument), it appends the venv name to the specified venv path. This mechanism is not recommended for most users because it is less robust than the next two options because it relies on pyright’s internal logic to determine the import resolution paths based on the virtual environment directories and files. The other two mechanisms (2 and 3 below) use the configured python interpreter to determine the import resolution paths (the value of `sys.path`).
|
||||
|
||||
2. Use the `python.pythonPath` setting. This setting is defined by the VS Code Python extension and can be configured using the Python extension’s environment picker interface. More recent versions of the Python extension no longer store the selected Python environment in the `python.pythonPath` setting and instead use a storage mechanism that is private to the extension. Pyright is able to access this through an API exposed by the Python extension.
|
||||
|
||||
3. As a fallback, use the default Python environment (i.e. the one that is invoked when typing `python` in the shell).
|
||||
|
||||
### Editable installs
|
||||
If you want to use static analysis tools with an editable install, you should configure the editable install to use `.pth` files that contain file paths rather than executable lines (prefixed with `import`) that install import hooks.
|
||||
|
||||
Import hooks can provide an editable installation that is a more accurate representation of your real installation. However, because resolving module locations using an import hook requires executing Python code, they are not usable by Pyright and other static analysis tools. Therefore, if your editable install is configured to use import hooks, Pyright will be unable to find the corresponding source files.
|
||||
|
||||
Notably, setuptools uses import hooks by default. For setuptools-based editable installs to be usable with Pyright, setuptools needs to be configured to use path-based `.pth` files through the build frontend.
|
||||
|
||||
#### pip with setuptools
|
||||
`pip` with `setuptools` supports two ways to avoid import hooks:
|
||||
- [compat mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior)
|
||||
- [strict mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs)
|
||||
|
||||
#### uv with setuptools
|
||||
When using uv with setuptools, uv can be [configured](https://docs.astral.sh/uv/reference/settings/#config-settings) to avoid import hooks:
|
||||
|
||||
```toml
|
||||
[tool.uv]
|
||||
config-settings = { editable_mode = "compat" }
|
||||
```
|
||||
|
||||
The `uv_build` backend always uses path-based `.pth` files.
|
||||
|
||||
#### Hatch / Hatchling
|
||||
[Hatchling](https://hatch.pypa.io/latest/config/build/#dev-mode) uses path-based `.pth` files by
|
||||
default. It will only use import hooks if you set `dev-mode-exact` to `true`.
|
||||
|
||||
#### PDM
|
||||
[PDM](https://pdm.fming.dev/latest/pyproject/build/#editable-build-backend) uses path-based `.pth`
|
||||
files by default. It will only use import hooks if you set `editable-backend` to
|
||||
`"editables"`.
|
||||
|
||||
### Debugging Import Resolution Problems
|
||||
The import resolution mechanisms in Python are complicated, and Pyright offers many configuration options. If you are encountering problems with import resolution, Pyright provides additional logging that may help you identify the cause. To enable verbose logging, pass `--verbose` as a command-line argument or add the following entry to the config file `"verboseOutput": true`. If you are using the Pyright VS Code extension, the additional logging will appear in the Output tab (select “Pyright” from the menu). Please include this verbose logging when reporting import resolution bugs.
|
||||
31
docs/import-statements.md
Normal file
31
docs/import-statements.md
Normal file
@@ -0,0 +1,31 @@
|
||||
## Import Statements
|
||||
|
||||
### Loader Side Effects
|
||||
|
||||
An import statement instructs the Python import loader to perform several operations. For example, the statement `from a.b import Foo as Bar` causes the following steps to be performed at runtime:
|
||||
1. Load and execute module `a` if it hasn’t previously been loaded. Cache a reference to `a`.
|
||||
2. Load and execute submodule `b` if it hasn’t previously been loaded.
|
||||
3. Store a reference to submodule `b` to the variable `b` within module `a`’s namespace.
|
||||
4. Look up attribute `Foo` within module `b`.
|
||||
5. Assign the value of attribute `Foo` to a local variable called `Bar`.
|
||||
|
||||
If another source file were to subsequently execute the statement `import a`, it would observe `b` in the namespace of `a` as a side effect of step 3 in the earlier import operation. Relying on such side effects leads to fragile code because a change in execution ordering or a modification to one module can break code in another module. Reliance on such side effects is therefore considered a bug by Pyright, which intentionally does not attempt to model such side effects.
|
||||
|
||||
### Implicit Module Loads
|
||||
|
||||
Pyright models two loader side effects that are considered safe and are commonly used in Python code.
|
||||
|
||||
1. If an import statement targets a multi-part module name and does not use an alias, all modules within the multi-part module name are assumed to be loaded. For example, the statement `import a.b.c` is treated as though it is three back-to-back import statements: `import a`, `import a.b` and `import a.b.c`. This allows for subsequent use of all symbols in `a`, `a.b`, and `a.b.c`. If an alias is used (e.g. `import a.b.c as abc`), this is assumed to load only module `c`. A subsequent `import a` would not provide access to `a.b` or `a.b.c`.
|
||||
|
||||
2. If an `__init__.py` file includes an import statement of the form `from . import a`, the local variable `a` is assigned a reference to submodule `a`. Similarly, if an `__init__.py` file includes an import statement of the form `from .a import b`, the local variable `a` is assigned a reference to submodule `a`. This statement form is treated as though it is two back-to-back import statements: `from . import a` followed by `from .a import b`.
|
||||
|
||||
|
||||
### Unsupported Loader Side Effects
|
||||
|
||||
All other module loader side effects are intentionally _not_ modeled by Pyright and should not be relied upon in code. Examples include:
|
||||
|
||||
- If one module contains the statement `import a.b` and a second module includes `import a`, the second module should not rely on the fact that `a.b` is now accessible as a side effect of the first module’s import.
|
||||
|
||||
- If a module contains the statement `import a.b` in the global scope and a function that includes the statement `import a` or `import a.c`, the function should not assume that it can access `a.b`. This assumption might or might not be safe depending on execution order.
|
||||
|
||||
- If a module contains the statements `import a.b as foo` and `import a`, code within that module should not assume that it can access `a.b`. Such an assumption might be safe depending on the relative order of the statements and the order in which they are executed, but it leads to fragile code.
|
||||
46
docs/index.html
Normal file
46
docs/index.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Pyright</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="Description" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: '',
|
||||
repo: '',
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
name: 'Pyright',
|
||||
nameLink: 'https://microsoft.github.io/pyright',
|
||||
search: 'auto',
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
auto2top: true,
|
||||
|
||||
search: {
|
||||
maxAge: 86400000, // Expiration time, the default one day
|
||||
paths: 'auto',
|
||||
placeholder: 'Type to search',
|
||||
noData: 'No Results',
|
||||
depth: 4, // Headline depth, 1 - 6
|
||||
hideOtherSidebarContent: true,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-yml.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-json.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-toml.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
49
docs/installation.md
Normal file
49
docs/installation.md
Normal file
@@ -0,0 +1,49 @@
|
||||
## Installation
|
||||
|
||||
### Language Server
|
||||
|
||||
#### VS Code
|
||||
For most VS Code users, we recommend using the Pylance extension rather than Pyright. Pylance incorporates the Pyright type checker but features additional capabilities such as semantic token highlighting and symbol indexing. You can install the latest-published version of the Pylance VS Code extension directly from VS Code. Simply open the extensions panel and search for “Pylance”.
|
||||
|
||||
#### Vim
|
||||
Vim/neovim users can install [coc-pyright](https://github.com/fannheyward/coc-pyright), the Pyright extension for coc.nvim.
|
||||
|
||||
Alternatively, [ALE](https://github.com/dense-analysis/ale) will automatically check your code with Pyright if added to the linters list.
|
||||
|
||||
#### Sublime Text
|
||||
Sublime text users can install the [LSP-pyright](https://github.com/sublimelsp/LSP-pyright) plugin from [package control](https://packagecontrol.io/packages/LSP-pyright).
|
||||
|
||||
#### Emacs
|
||||
Emacs users can install [eglot](https://github.com/joaotavora/eglot) or [lsp-mode](https://github.com/emacs-lsp/lsp-mode) with [lsp-pyright](https://github.com/emacs-lsp/lsp-pyright).
|
||||
|
||||
#### PyCharm
|
||||
PyCharm users can enable native Pyright support in the settings.
|
||||
For more information, refer to [PyCharm documentation](https://www.jetbrains.com/help/pycharm/lsp-tools.html#pyright).
|
||||
|
||||
### Command-line
|
||||
|
||||
#### Python Package
|
||||
A [community-maintained](https://github.com/RobertCraigie/pyright-python) Python package by the name of “pyright” is available on pypi and conda-forge. This package will automatically install node (which Pyright requires) and keep Pyright up to date.
|
||||
|
||||
`pip install pyright`
|
||||
|
||||
or
|
||||
|
||||
`conda install pyright`
|
||||
|
||||
Once installed, you can run the tool from the command line as follows:
|
||||
`pyright <options>`
|
||||
|
||||
|
||||
#### NPM Package
|
||||
Alternatively, you can install the command-line version of Pyright directly from npm, which is part of node. If you don't have a recent version of node on your system, install that first from [nodejs.org](https://nodejs.org).
|
||||
|
||||
To install pyright globally:
|
||||
`npm install -g pyright`
|
||||
|
||||
On MacOS or Linux, sudo may be required to install globally:
|
||||
`sudo npm install -g pyright`
|
||||
|
||||
To update to the latest version:
|
||||
`sudo npm update -g pyright`
|
||||
|
||||
38
docs/internals.md
Normal file
38
docs/internals.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Pyright Internals
|
||||
|
||||
## Code Structure
|
||||
|
||||
* packages/vscode-pyright/src/extension.ts: Language Server Protocol (LSP) client entry point for VS Code extension.
|
||||
* packages/pyright-internal/typeshed-fallback/: Recent copy of Typeshed type stub files for Python stdlib
|
||||
* packages/pyright-internal/src/pyright.ts: Main entry point for command-line tool
|
||||
* packages/pyright-internal/src/server.ts: Main entry point for LSP server
|
||||
* packages/pyright-internal/src/typeServer: Type Server Protocol (TSP) server built on the analyzer (see [Type Server](type-server.md))
|
||||
* packages/pyright-internal/src/analyzer: Modules that perform analysis passes over Python parse tree
|
||||
* packages/pyright-internal/src/common: Modules that are common to the parser and analyzer
|
||||
* packages/pyright-internal/src/parser: Modules that perform tokenization and parsing of Python source
|
||||
* packages/pyright-internal/src/tests: Tests for the parser and analyzer
|
||||
|
||||
|
||||
## Core Concepts
|
||||
|
||||
Pyright implements a [service](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/service.ts), a persistent in-memory object that controls the order of analysis and provides an interface for the language server. For multi-root workspaces, each workspace gets its own service instance.
|
||||
|
||||
The service owns an instance of a [program](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/program.ts), which tracks the configuration file and all of the source files that make up the source base that is to be analyzed. A source file can be added to a program if it is a) referenced by the config file, b) currently open in the editor, or c) imported directly or indirectly by another source file. The program object is responsible for setting up file system watchers and updating the program as files are added, deleted, or edited. The program is also responsible for prioritizing all phases of analysis for all files, favoring files that are open in the editor (and their import dependencies).
|
||||
|
||||
The program tracks multiple [sourceFile](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/sourceFile.ts) objects. Each source file represents the contents of one Python source file on disk. It tracks the status of analysis for the file, including any intermediate or final results of the analysis and the diagnostics (errors and warnings) that result.
|
||||
|
||||
The program makes use of an [importResolver](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/importResolver.ts) to resolve the imported modules referenced within each source file.
|
||||
|
||||
|
||||
## Analysis Phases
|
||||
|
||||
Pyright performs the following analysis phases for each source file.
|
||||
|
||||
The [tokenizer](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/parser/tokenizer.ts) is responsible for converting the file’s string contents into a stream of tokens. White space, comments, and some end-of-line characters are ignored, as they are not needed by the parser.
|
||||
|
||||
The [parser](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/parser/parser.ts) is responsible for converting the token stream into a parse tree. A generalized [parseTreeWalker](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/parseTreeWalker.ts) provides a convenient way to traverse the parse tree. All subsequent analysis phases utilize the parseTreeWalker.
|
||||
|
||||
The [binder](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/binder.ts) is responsible for building scopes and populating the symbol table for each scope. It does not perform any type checking, but it detects and reports some semantic errors that will result in unintended runtime exceptions. It also detects and reports inconsistent name bindings (e.g. a variable that uses both a global and nonlocal binding in the same scope). The binder also builds a “reverse code flow graph” for each scope, allowing the type analyzer to determine a symbol’s type at any point in the code flow based on its antecedents.
|
||||
|
||||
The [checker](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/checker.ts) is responsible for checking all of the statements and expressions within a source file. It relies heavily on the [typeEvaluator](https://github.com/microsoft/pyright/blob/main/packages/pyright-internal/src/analyzer/typeEvaluator.ts) module, which performs most of the heavy lifting. The checker doesn’t run on all files, only those that require full diagnostic output. For example, if a source file is not part of the program but is imported by the program, the checker doesn’t need to run on it.
|
||||
|
||||
435
docs/mypy-comparison.md
Normal file
435
docs/mypy-comparison.md
Normal file
@@ -0,0 +1,435 @@
|
||||
## Differences Between Pyright and Mypy
|
||||
|
||||
### What is Mypy?
|
||||
|
||||
Mypy is the “OG” in the world of Python type checkers. It was started by Jukka Lehtosalo in 2012 with contributions from Guido van Rossum, Ivan Levkivskyi, and many others over the years. For a detailed history, refer to [this documentation](http://mypy-lang.org/about.html). The code for mypy can be found in [this github project](https://github.com/python/mypy).
|
||||
|
||||
|
||||
### Why Does Pyright’s Behavior Differ from Mypy’s?
|
||||
|
||||
Mypy served as a reference implementation of [PEP 484](https://www.python.org/dev/peps/pep-0484/), which defines standard behaviors for Python static typing. Although PEP 484 spells out many type checking behaviors, it intentionally leaves many other behaviors undefined. This approach has allowed different type checkers to innovate and differentiate.
|
||||
|
||||
Pyright generally adheres to the official [Python typing specification](https://typing.readthedocs.io/en/latest/spec/index.html), which incorporates and builds upon PEP 484 and other typing-related PEPs. The typing spec is accompanied by an ever-expanding suite of conformance tests. For the latest conformance test results for pyright, mypy and other type checkers, refer to [this page](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html).
|
||||
|
||||
For behaviors that are not explicitly spelled out in the typing spec, pyright generally tries to adhere to mypy’s behavior unless there is a compelling justification for deviating. This document discusses these differences and provides the reasoning behind each design choice.
|
||||
|
||||
|
||||
### Design Goals
|
||||
|
||||
Pyright was designed with performance in mind. It is not unusual for pyright to be 3x to 5x faster than mypy when type checking large code bases. Some of its design decisions were motivated by this goal.
|
||||
|
||||
Pyright was also designed to be used as the foundation for a Python [language server](https://microsoft.github.io/language-server-protocol/). Language servers provide interactive programming features such as completion suggestions, function signature help, type information on hover, semantic-aware search, semantic-aware renaming, semantic token coloring, refactoring tools, etc. For a good user experience, these features require highly responsive type evaluation performance during interactive code modification. They also require type evaluation to work on code that is incomplete and contains syntax errors.
|
||||
|
||||
To achieve these design goals, pyright is implemented as a “lazy” or “just-in-time” type evaluator. Rather than analyzing all code in a module from top to bottom, it is able to evaluate the type of an arbitrary identifier anywhere within a module. If the type of that identifier depends on the types of other expressions or symbols, pyright recursively evaluates those in turn until it has enough information to determine the type of the target identifier. By comparison, mypy uses a more traditional multi-pass architecture where semantic analysis is performed multiple times on a module from the top to the bottom until all types converge.
|
||||
|
||||
Pyright implements its own parser, which recovers gracefully from syntax errors and continues parsing the remainder of the source file. By comparison, mypy uses the parser built in to the Python interpreter, and it does not support recovery after a syntax error. This also means that when you run mypy on an older version of Python, it cannot support newer language features that require grammar changes.
|
||||
|
||||
|
||||
### Type Checking Unannotated Code
|
||||
|
||||
By default, pyright performs type checking for all code regardless of whether it contains type annotations. This is important for language server features. It is also important for catching bugs in code that is unannotated.
|
||||
|
||||
By default, mypy skips all functions or methods that do not have type annotations. This is a common source of confusion for mypy users who are surprised when type violations in unannotated functions go unreported. If the option `--check-untyped-defs` is enabled, mypy performs type checking for all functions and methods.
|
||||
|
||||
|
||||
### Inferred Return Types
|
||||
|
||||
If a function or method lacks a return type annotation, pyright infers the return type from `return` and `yield` statements within the function’s body (including the implied `return None` at the end of the function body). This is important for supporting completion suggestions. It also improves type checking coverage and eliminates the need for developers to needlessly supply return type annotations for trivial return types.
|
||||
|
||||
By comparison, mypy never infers return types and assumes that functions without a return type annotation have a return type of `Any`. This was an intentional design decision by mypy developers and is explained in [this thread](https://github.com/python/mypy/issues/10149).
|
||||
|
||||
|
||||
### Unions vs Joins
|
||||
|
||||
When merging two types during code flow analysis or widening types during constraint solving, pyright always uses a union operation. Mypy typically (but not always) uses a “join” operation, which merges types by finding a common supertype. The use of joins discards valuable type information and leads to many false positive errors that are [well documented within the mypy issue tracker](https://github.com/python/mypy/issues?q=is%3Aissue+is%3Aopen+label%3Atopic-join-v-union).
|
||||
|
||||
```python
|
||||
def func1(val: object):
|
||||
if isinstance(val, str):
|
||||
pass
|
||||
elif isinstance(val, int):
|
||||
pass
|
||||
else:
|
||||
return
|
||||
reveal_type(val) # mypy: object, pyright: str | int
|
||||
```
|
||||
|
||||
|
||||
### Variable Type Declarations
|
||||
|
||||
Pyright treats variable type annotations as type declarations. If a variable is not annotated, pyright allows any value to be assigned to that variable, and its type is inferred to be the union of all assigned types.
|
||||
|
||||
Mypy’s behavior for variables depends on whether [`--allow-redefinition`](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-allow-redefinition) is specified. If redefinitions are not allowed, then mypy typically treats the first assignment (the one with the smallest line number) as though it is an implicit type declaration.
|
||||
|
||||
```python
|
||||
def func1(condition: bool):
|
||||
if condition:
|
||||
x = 3 # Mypy treats this as an implicit type declaration
|
||||
else:
|
||||
x = "" # Mypy treats this as an error because `x` is implicitly declared as `int`
|
||||
|
||||
def func2(condition: bool):
|
||||
x = None # Mypy provides some exceptions; this is not considered an implicit type declaration
|
||||
|
||||
if condition:
|
||||
x = "" # This is not considered an error
|
||||
|
||||
def func3(condition: bool):
|
||||
x = [] # Mypy doesn't treat this as a declaration
|
||||
|
||||
if condition:
|
||||
x = [1, 2, 3] # The type of `x` is declared as `list[int]`
|
||||
```
|
||||
|
||||
Pyright’s behavior is more consistent, is conceptually simpler and more natural for Python developers, leads to fewer false positives, and eliminates the need for many otherwise-necessary variable type annotations.
|
||||
|
||||
|
||||
### Class and Instance Variable Inference
|
||||
|
||||
Pyright handles instance and class variables consistently with local variables. If a type annotation is provided for an instance or class variable (either within the class or one of its base classes), pyright treats this as a type declaration and enforces it accordingly. If a class implementation does not provide a type annotation for an instance or class variable and its base classes likewise do not provide a type annotation, the variable’s type is inferred from all assignments within the class implementation.
|
||||
|
||||
```python
|
||||
class A:
|
||||
def method1(self) -> None:
|
||||
self.x = 1
|
||||
|
||||
def method2(self) -> None:
|
||||
self.x = "" # Mypy treats this as an error because `x` is implicitly declared as `int`
|
||||
|
||||
a = A()
|
||||
reveal_type(a.x) # pyright: int | str
|
||||
|
||||
a.x = "" # Pyright allows this because the type of `x` is `int | str`
|
||||
a.x = 3.0 # Pyright treats this as an error because the type of `x` is `int | str`
|
||||
```
|
||||
|
||||
|
||||
### Class and Instance Variable Enforcement
|
||||
|
||||
Pyright distinguishes between “pure class variables”, “regular class variables”, and “pure instance variable”. For a detailed explanation, refer to [this documentation](type-concepts-advanced.md#class-and-instance-variables).
|
||||
|
||||
Mypy does not distinguish between class variables and instance variables in all cases. This is a [known issue](https://github.com/python/mypy/issues/240).
|
||||
|
||||
```python
|
||||
class A:
|
||||
x: int = 0 # Regular class variable
|
||||
y: ClassVar[int] = 0 # Pure class variable
|
||||
|
||||
def __init__(self):
|
||||
self.z = 0 # Pure instance variable
|
||||
|
||||
print(A.x)
|
||||
print(A.y)
|
||||
print(A.z) # pyright: error, mypy: no error
|
||||
```
|
||||
|
||||
|
||||
### Assignment-based Type Narrowing
|
||||
|
||||
Pyright applies type narrowing for variable assignments. This is done regardless of whether the assignment statement includes a variable type annotation. Mypy skips assignment-based type narrowing when the target variable includes a type annotation. The consensus of the typing community is that mypy’s behavior here is inconsistent, and there are [plans to eliminate this inconsistency](https://github.com/python/mypy/issues/2008).
|
||||
|
||||
```python
|
||||
v1: Sequence[int]
|
||||
v1 = [1, 2, 3]
|
||||
reveal_type(v1) # mypy and pyright both reveal `list[int]`
|
||||
|
||||
v2: Sequence[int] = [1, 2, 3]
|
||||
reveal_type(v2) # mypy reveals `Sequence[int]` rather than `list[int]`
|
||||
```
|
||||
|
||||
|
||||
### Type Guards
|
||||
|
||||
Pyright supports several built-in type guards that mypy does not currently support. For a full list of type guard expression forms supported by pyright, refer to [this documentation](type-concepts-advanced.md#type-guards).
|
||||
|
||||
The following expression forms are not currently supported by mypy as type guards:
|
||||
* `x == L` and `x != L` (where L is an expression with a literal type)
|
||||
* `x in y` or `x not in y` (where y is instance of list, set, frozenset, deque, tuple, dict, defaultdict, or OrderedDict)
|
||||
* `bool(x)` (where x is any expression that is statically verifiable to be truthy or falsey in all cases)
|
||||
|
||||
|
||||
### Aliased Conditional Expressions
|
||||
|
||||
Pyright supports the [aliasing of conditional expressions](type-concepts-advanced.md#aliased-conditional-expression) used for type guards. Mypy does not currently support this, but it is a frequently-requested feature.
|
||||
|
||||
|
||||
### Narrowing Any
|
||||
|
||||
Pyright never narrows `Any` when performing type narrowing for assignments. Mypy is inconsistent about when it applies type narrowing to `Any` type arguments.
|
||||
|
||||
```python
|
||||
b: list[Any]
|
||||
|
||||
b = [1, 2, 3]
|
||||
reveal_type(b) # pyright: list[Any], mypy: list[Any]
|
||||
|
||||
c = [1, 2, 3]
|
||||
b = c
|
||||
reveal_type(b) # pyright: list[Any], mypy: list[int]
|
||||
```
|
||||
|
||||
|
||||
### Inference of List, Set, and Dict Expressions
|
||||
|
||||
Pyright’s inference rules for [list, set and dict expressions](type-inference.md#list-expressions) differ from mypy’s when values with heterogeneous types are used. Mypy uses a join operator to combine the types. Pyright uses either an `Unknown` or a union depending on configuration settings. A join operator often produces a type that is not what was intended, and this leads to false positive errors.
|
||||
|
||||
```python
|
||||
x = [1, 3.4, ""]
|
||||
reveal_type(x) # mypy: list[object], pyright: list[Unknown] or list[int | float | str]
|
||||
```
|
||||
|
||||
For these mutable container types, pyright does not retain literal types when inferring the container type. Mypy is inconsistent, sometimes retaining literal types and sometimes not.
|
||||
|
||||
```python
|
||||
def func(one: Literal[1]):
|
||||
reveal_type(one) # Literal[1]
|
||||
reveal_type([one]) # pyright: list[int], mypy: list[Literal[1]]
|
||||
|
||||
reveal_type(1) # Literal[1]
|
||||
reveal_type([1]) # pyright: list[int], mypy: list[int]
|
||||
```
|
||||
|
||||
|
||||
### Inference of Tuple Expressions
|
||||
|
||||
Pyright’s inference rules for [tuple expressions](type-inference.md#tuple-expressions) differ from mypy’s when tuple entries contain literals. Pyright retains these literal types, but mypy widens the types to their non-literal type. Pyright retains the literal types in this case because tuples are immutable, and more precise (narrower) types are almost always beneficial in this situation.
|
||||
|
||||
```python
|
||||
x = (1, "stop")
|
||||
reveal_type(x[1]) # pyright: Literal["stop"], mypy: str
|
||||
|
||||
y: Literal["stop", "go"] = x[1] # mypy: type error
|
||||
```
|
||||
|
||||
|
||||
### Assignment-Based Narrowing for Literals
|
||||
|
||||
When assigning a literal value to a variable, pyright narrows the type to reflect the literal. Mypy does not. Pyright retains the literal types in this case because more precise (narrower) types are typically beneficial and have little or no downside.
|
||||
|
||||
```python
|
||||
x: str | None
|
||||
x = 'a'
|
||||
reveal_type(x) # pyright: Literal['a'], mypy: str
|
||||
```
|
||||
|
||||
Pyright also supports “literal math” for simple operations involving literals.
|
||||
|
||||
```python
|
||||
def func1(a: Literal[1, 2], b: Literal[2, 3]):
|
||||
c = a + b
|
||||
reveal_type(c) # Literal[3, 4, 5]
|
||||
|
||||
def func2():
|
||||
c = "hi" + " there"
|
||||
reveal_type(c) # Literal['hi there']
|
||||
```
|
||||
|
||||
|
||||
### Type Narrowing for Asymmetric Descriptors
|
||||
|
||||
When pyright evaluates a write to a class variable that contains a descriptor object (including properties), it normally applies assignment-based type narrowing. However, when the descriptor is asymmetric — that is, its “getter” type is different from its “setter” type, pyright refrains from applying assignment-based type narrowing. For a full discussion of this, refer to [this issue](https://github.com/python/mypy/issues/3004). Mypy has not yet implemented the agreed-upon behavior, so its type narrowing behavior may differ from pyright’s in this case.
|
||||
|
||||
|
||||
### Parameter Type Inference
|
||||
|
||||
Mypy infers the type of `self` and `cls` parameters in methods but otherwise does not infer any parameter types.
|
||||
|
||||
Pyright implements several parameter type inference techniques that improve type checking and language service features in the absence of explicit parameter type annotations. For details, refer to [this documentation](type-inference.md#parameter-type-inference).
|
||||
|
||||
|
||||
### Constructor Calls
|
||||
|
||||
When pyright evaluates a call to a constructor, it attempts to follow the runtime behavior as closely as possible. At runtime, when a constructor is called, it invokes the `__call__` method of the metaclass. Most classes use `type` as their metaclass. (Even when a different metaclasses is used, it typically does not override `type.__call__`.) The `type.__call__` method calls the `__new__` method for the class and passes all of the arguments (both positional and keyword) that were passed to the constructor call. If the `__new__` method returns an instance of the class (or a child class), `type.__call__` then calls the `__init__` method on the class. Pyright follows this same flow for evaluating the type of a constructor call. If a custom metaclass is present, pyright evaluates its `__call__` method to determine whether it returns an instance of the class. If not, it assumes that the metaclass has custom behavior that overrides `type.__call__`. Likewise, if a class provides a `__new__` method that returns a type other than the class being constructed (or a child class thereof), it assumes that `__init__` will not be called.
|
||||
|
||||
By comparison, mypy first evaluates the `__init__` method if present, and it ignores the annotated return type of the `__new__` method.
|
||||
|
||||
|
||||
### `None` Return Type
|
||||
|
||||
If the return type of a function is declared as `None`, an attempt to call that function and consume the returned value is flagged as an error by mypy. The justification is that this is a common source of bugs.
|
||||
|
||||
Pyright does not special-case `None` in this manner because there are legitimate use cases, and in our experience, this class of bug is rare.
|
||||
|
||||
|
||||
### Constraint Solver Behaviors
|
||||
|
||||
When evaluating a call expression that invokes a generic class constructor or a generic function, a type checker performs a process called “constraint solving” to solve the type variables found within the target function signature. The solved type variables are then applied to the return type of that function to determine the final type of the call expression. This process is called “constraint solving” because it takes into account various constraints that are specified for each type variable. These constraints include variance rules and type variable bounds.
|
||||
|
||||
Many aspects of constraint solving are unspecified in PEP 484. This includes behaviors around literals, whether to use unions or joins to widen types, and how to handle cases where multiple types could satisfy all type constraints.
|
||||
|
||||
#### Constraint Solver: Literals
|
||||
|
||||
Pyright’s constraint solver retains literal types only when they are required to satisfy constraints. In other cases, it widens the type to a non-literal type. Mypy is inconsistent in its handling of literal types.
|
||||
|
||||
```python
|
||||
T = TypeVar("T")
|
||||
def identity(x: T) -> T:
|
||||
return x
|
||||
|
||||
def func(one: Literal[1]):
|
||||
reveal_type(one) # Literal[1]
|
||||
v1 = identity(one)
|
||||
reveal_type(v1) # pyright: int, mypy: Literal[1]
|
||||
|
||||
reveal_type(1) # Literal[1]
|
||||
v2 = identity(1)
|
||||
reveal_type(v2) # pyright: int, mypy: int
|
||||
```
|
||||
|
||||
#### Constraint Solver: Type Widening
|
||||
|
||||
As mentioned previously, pyright always uses unions rather than joins. Mypy typically uses joins. This applies to type widening during the constraint solving process.
|
||||
|
||||
```python
|
||||
T = TypeVar("T")
|
||||
def func(val1: T, val2: T) -> T:
|
||||
...
|
||||
|
||||
reveal_type(func("", 1)) # mypy: object, pyright: str | int
|
||||
```
|
||||
|
||||
#### Constraint Solver: Ambiguous Solution Scoring
|
||||
|
||||
In cases where more than one solution is possible for a type variable, both pyright and mypy employ various heuristics to pick the “best” solution. These heuristics are complex and difficult to document in their fullness. Pyright’s general strategy is to return the “simplest” type that meets the constraints.
|
||||
|
||||
Consider the expression `make_list(x)` in the example below. The type constraints for `T` could be satisfied with either `int` or `list[int]`, but it’s much more likely that the developer intended the former (simpler) solution. Pyright calculates all possible solutions and “scores” them according to complexity, then picks the type with the best score. In rare cases, there can be two results with the same score, in which chase pyright arbitrarily picks one as the winner.
|
||||
|
||||
Mypy produces errors with this sample.
|
||||
|
||||
```python
|
||||
T = TypeVar("T")
|
||||
|
||||
def make_list(x: T | Iterable[T]) -> list[T]:
|
||||
return list(x) if isinstance(x, Iterable) else [x]
|
||||
|
||||
def func2(x: list[int], y: list[str] | int):
|
||||
v1 = make_list(x)
|
||||
reveal_type(v1) # pyright: "list[int]" ("list[list[T]]" is also a valid answer)
|
||||
|
||||
v2 = make_list(y)
|
||||
reveal_type(v2) # pyright: "list[int | str]" ("list[list[str] | int]" is also a valid answer)
|
||||
```
|
||||
|
||||
### Value-Constrained Type Variables
|
||||
|
||||
When mypy analyzes a class or function that has in-scope value-constrained TypeVars, it analyzes the class or function multiple times, once for each constraint. This can produce multiple errors.
|
||||
|
||||
```python
|
||||
T = TypeVar("T", list[Any], set[Any])
|
||||
|
||||
def func(a: AnyStr, b: T):
|
||||
reveal_type(a) # Mypy reveals 2 different types ("str" and "bytes"), pyright reveals "AnyStr"
|
||||
return a + b # Mypy reports 4 errors
|
||||
```
|
||||
|
||||
Pyright cannot use the same multi-pass technique as mypy in this case. It needs to produce a single type for any given identifier to support language server features. Pyright instead uses a mechanism called [conditional types](type-concepts-advanced.md#conditional-types-and-type-variables). This approach allows pyright to handle some value-constrained TypeVar use cases that mypy cannot, but there are conversely other use cases that mypy can handle and pyright cannot.
|
||||
|
||||
|
||||
### “Unknown” Type and Strict Mode
|
||||
|
||||
Pyright differentiates between explicit and implicit forms of `Any`. The implicit form is referred to as [`Unknown`](type-inference.md#unknown-type). For example, if a parameter is annotated as `list[Any]`, that is a use of an explicit `Any`, but if a parameter is annotated as `list`, that is an implicit `Any`, so pyright refers to this type as `list[Unknown]`. Pyright implements several checks that are enabled in “strict” type-checking modes that report the use of an `Unknown` type. Such uses can mask type errors.
|
||||
|
||||
Mypy does not track the difference between explicit and implicit `Any` types, but it supports various checks that report the use of values whose type is `Any`: `--warn-return-any` and `--disallow-any-*`. For details, refer to [this documentation](https://mypy.readthedocs.io/en/stable/command_line.html#disallow-dynamic-typing).
|
||||
|
||||
Pyright’s approach gives developers more control. It provides a way to be explicit about `Any` where that is the intent. When an `Any` is implicitly produced due to an missing type argument or some other condition that produces an `Any` within the type checker logic, the developer is alerted to that condition.
|
||||
|
||||
|
||||
### Overload Resolution
|
||||
|
||||
Overload resolution rules are under-specified in PEP 484. Pyright and mypy apply similar rules, but there are inevitably cases where different results will be produced. For full documentation of pyright’s overload behaviors, refer to [this documentation](type-concepts-advanced.md#overloads).
|
||||
|
||||
One known difference is in the handling of ambiguous overloads due to `Any` argument types where one return type is the supertype of all other return types. In this case, pyright evaluates the resulting return type as the supertype, but mypy evaluates the return type as `Any`. Pyright’s behavior here tries to preserve as much type information as possible, which is important for completion suggestions.
|
||||
|
||||
```python
|
||||
@overload
|
||||
def func1(x: int) -> int: ...
|
||||
|
||||
@overload
|
||||
def func1(x: str) -> float: ...
|
||||
|
||||
def func2(val: Any):
|
||||
reveal_type(func1(val)) # mypy: Any, pyright: float
|
||||
```
|
||||
|
||||
|
||||
### Import Statements
|
||||
|
||||
Pyright intentionally does not model implicit side effects of the Python import loading mechanism. In general, such side effects cannot be modeled statically because they depend on execution order. Dependency on such side effects leads to fragile code, so pyright treats these as errors. For more details, refer to [this documentation](import-statements.md).
|
||||
|
||||
Mypy models side effects of the import loader that are potentially unsafe.
|
||||
|
||||
```python
|
||||
import http
|
||||
|
||||
def func():
|
||||
import http.cookies
|
||||
|
||||
# The next line raises an exception at runtime
|
||||
x = http.cookies # mypy allows, pyright flags as error
|
||||
```
|
||||
|
||||
### Ellipsis in Function Body
|
||||
|
||||
If Pyright encounters a function body whose implementation is `...`, it does not enforce the return type annotation. The `...` semantically means “this is a code placeholder” — a convention established in type stubs, protocol definitions, and elsewhere.
|
||||
|
||||
Mypy treats `...` function bodies as though they are executable and enforces the return type annotation. This was a recent change in mypy — made long after Pyright established a different behavior. Prior to mypy’s recent change, it did not enforce return types for function bodies consisting of either `...` or `pass`. Now it enforces both.
|
||||
|
||||
|
||||
### Circular References
|
||||
|
||||
Because mypy is a multi-pass analyzer, it is able to deal with certain forms of circular references that pyright cannot handle. Here are several examples of circularities that mypy resolves without errors but pyright does not.
|
||||
|
||||
1. A class declaration that references a metaclass whose declaration depends on the class.
|
||||
|
||||
```python
|
||||
T = TypeVar("T")
|
||||
class MetaA(type, Generic[T]): ...
|
||||
class A(metaclass=MetaA["A"]): ...
|
||||
```
|
||||
|
||||
2. A class declaration that uses a TypeVar whose bound or constraint depends on the class.
|
||||
|
||||
```python
|
||||
T = TypeVar("T", bound="A")
|
||||
class A(Generic[T]): ...
|
||||
```
|
||||
|
||||
3. A class that is decorated with a class decorator that uses the class in the decorator’s own signature.
|
||||
|
||||
```python
|
||||
def my_decorator(x: Callable[..., "A"]) -> Callable[..., "A"]:
|
||||
return x
|
||||
|
||||
@my_decorator
|
||||
class A: ...
|
||||
```
|
||||
|
||||
### Class Decorator Evaluation
|
||||
|
||||
Pyright honors class decorators. Mypy largely ignores them. See [this issue](https://github.com/python/mypy/issues/3135) for details.
|
||||
|
||||
|
||||
### Support for Type Comments
|
||||
|
||||
Versions of Python prior to 3.0 did not have a dedicated syntax for supplying type annotations. Annotations therefore needed to be supplied using “type comments” of the form `# type: <annotation>`. Python 3.6 added the ability to supply type annotations for variables.
|
||||
|
||||
Mypy has full support for type comments. Pyright supports type comments only in locations where there is a way to provide an annotation using modern syntax. Pyright was written to assume Python 3.5 and newer, so support for older versions was not a priority.
|
||||
|
||||
```python
|
||||
# The following type comment is supported by
|
||||
# mypy but is rejected by pyright.
|
||||
x, y = (3, 4) # type: (float, float)
|
||||
|
||||
# Using Python syntax from Python 3.6, this
|
||||
# would be annotated as follows:
|
||||
x: float
|
||||
y: float
|
||||
x, y = (3, 4)
|
||||
```
|
||||
|
||||
### Plugins
|
||||
|
||||
Mypy supports a plug-in mechanism, whereas pyright does not. Mypy plugins allow developers to extend mypy’s capabilities to accommodate libraries that rely on behaviors that cannot be described using the standard type checking mechanisms.
|
||||
|
||||
Pyright maintainers have made the decision not to support plug-ins because of their many downsides: discoverability, maintainability, cost of development for the plug-in author, cost of maintenance for the plug-in object model and API, security, performance (especially latency — which is critical for language servers), and robustness. Instead, we have taken the approach of working with the typing community and library authors to extend the type system so it can accommodate more use cases. An example of this is [PEP 681](https://peps.python.org/pep-0681/), which introduced `dataclass_transform`.
|
||||
|
||||
44
docs/settings.md
Normal file
44
docs/settings.md
Normal file
@@ -0,0 +1,44 @@
|
||||
## Pyright Settings
|
||||
|
||||
The Pyright language server honors the following settings.
|
||||
|
||||
**pyright.disableLanguageServices** [boolean]: Disables all language services. This includes hover text, type completion, signature completion, find definition, find references, etc. This option is useful if you want to use pyright only as a type checker but want to run another Python language server for language service features.
|
||||
|
||||
**pyright.disableOrganizeImports** [boolean]: Disables the “Organize Imports” command. This is useful if you are using another extension that provides similar functionality and you don’t want the two extensions to fight each other.
|
||||
|
||||
**pyright.disableTaggedHints** [boolean]: Disables the use of hint diagnostics with special tags to tell the client to display text ranges in a "grayed out" manner (to indicate unreachable code or unreferenced symbols) or in a "strike through" manner (to indicate use of a deprecated feature).
|
||||
|
||||
**pyright.openFilesOnly** [boolean]: Determines whether pyright analyzes (and reports errors for) all files in the workspace, as indicated by the config file. If this option is set to true, pyright analyzes only open files. This setting is deprecated in favor of python.analysis.diagnosticMode. It will be removed at a future time.
|
||||
|
||||
**pyright.useLibraryCodeForTypes** [boolean]: This setting is deprecated in favor of python.analysis.useLibraryCodeForTypes. It will be removed at a future time.
|
||||
|
||||
**python.analysis.autoImportCompletions** [boolean]: Determines whether pyright offers auto-import completions.
|
||||
|
||||
**python.analysis.autoSearchPaths** [boolean]: Determines whether pyright automatically adds common search paths like "src" if there are no execution environments defined in the config file.
|
||||
|
||||
**python.analysis.diagnosticMode** ["openFilesOnly", "workspace"]: Determines whether pyright analyzes (and reports errors for) all files in the workspace, as indicated by the config file. If this option is set to "openFilesOnly", pyright analyzes only open files.
|
||||
|
||||
**python.analysis.diagnosticSeverityOverrides** [map]: Allows a user to override the severity levels for individual diagnostic rules. "reportXXX" rules in the type check diagnostics settings in [configuration](configuration.md#type-check-diagnostics-settings) are supported. Use the rule name as a key and one of "error," "warning," "information," "true," "false," or "none" as value.
|
||||
|
||||
**python.analysis.exclude** [array of paths]: Paths of directories or files that should not be included. This can be overridden in the configuration file.
|
||||
|
||||
**python.analysis.extraPaths** [array of paths]: Paths to add to the default execution environment extra paths if there are no execution environments defined in the config file.
|
||||
|
||||
**python.analysis.ignore** [array of paths]: Paths of directories or files whose diagnostic output (errors and warnings) should be suppressed. This can be overridden in the configuration file.
|
||||
|
||||
**python.analysis.include** [array of paths]: Paths of directories or files that should be included. This can be overridden in the configuration file.
|
||||
|
||||
**python.analysis.logLevel** ["Error", "Warning", "Information", or "Trace"]: Level of logging for Output panel. The default value for this option is "Information".
|
||||
|
||||
**python.analysis.stubPath** [path]: Path to directory containing custom type stub files.
|
||||
|
||||
**python.analysis.typeCheckingMode** ["off", "basic", "standard", "strict"]: Determines the default type-checking level used by pyright. This can be overridden in the configuration file. (Note: This setting used to be called "pyright.typeCheckingMode". The old name is deprecated but is still currently honored.)
|
||||
|
||||
**python.analysis.typeshedPaths** [array of paths]: Paths to look for typeshed modules. Pyright currently honors only the first path in the array.
|
||||
|
||||
**python.analysis.useLibraryCodeForTypes** [boolean]: Determines whether pyright reads, parses and analyzes library code to extract type information in the absence of type stub files. Type information will typically be incomplete. We recommend using type stubs where possible. The default value for this option is true.
|
||||
|
||||
**python.pythonPath** [path]: Path to Python interpreter. This setting is being deprecated by the VS Code Python extension in favor of a setting that is stored in the Python extension’s internal configuration store. Pyright supports both mechanisms but prefers the new one if both settings are present.
|
||||
|
||||
**python.venvPath** [path]: Path to folder with subdirectories that contain virtual environments. The `python.pythonPath` setting is recommended over this mechanism for most users. For more details, refer to the [import resolution](import-resolution.md#configuring-your-python-environment) documentation.
|
||||
|
||||
660
docs/type-concepts-advanced.md
Normal file
660
docs/type-concepts-advanced.md
Normal file
@@ -0,0 +1,660 @@
|
||||
## Static Typing: Advanced Topics
|
||||
|
||||
### Type Narrowing
|
||||
|
||||
Pyright uses a technique called “type narrowing” to track the type of an expression based on code flow. Consider the following code:
|
||||
|
||||
```python
|
||||
val_str: str = "hi"
|
||||
val_int: int = 3
|
||||
|
||||
def func(val: float | str | complex, test: bool):
|
||||
reveal_type(val) # int | str | complex
|
||||
|
||||
val = val_int # Type is narrowed to int
|
||||
reveal_type(val) # int
|
||||
|
||||
if test:
|
||||
val = val_str # Type is narrowed to str
|
||||
reveal_type(val) # str
|
||||
|
||||
reveal_type(val) # int | str
|
||||
|
||||
if isinstance(val, int):
|
||||
reveal_type(val) # int
|
||||
print(val)
|
||||
else:
|
||||
reveal_type(val) # str
|
||||
print(val)
|
||||
```
|
||||
|
||||
At the start of this function, the type checker knows nothing about `val` other than that its declared type is `float | str | complex`. Then it is assigned a value that has a known type of `int`. This is a legal assignment because `int` is considered a subclass of `float`. At the point in the code immediately after the assignment, the type checker knows that the type of `val` is an `int`. This is a “narrower” (more specific) type than `float | str | complex`. Type narrowing is applied whenever a symbol is assigned a new value.
|
||||
|
||||
Another assignment occurs several lines further down, this time within a conditional block. The symbol `val` is assigned a value known to be of type `str`, so the narrowed type of `val` is now `str`. Once the code flow of the conditional block merges with the main body of the function, the narrowed type of `val` becomes `int | str` because the type checker cannot statically predict whether the conditional block will be executed at runtime.
|
||||
|
||||
Another way that types can be narrowed is through the use of conditional code flow statements like `if`, `while`, and `assert`. Type narrowing applies to the block of code that is “guarded” by that condition, so type narrowing in this context is sometimes referred to as a “type guard”. For example, if you see the conditional statement `if x is None:`, the code within that `if` statement can assume that `x` contains `None`. Within the code sample above, we see an example of a type guard involving a call to `isinstance`. The type checker knows that `isinstance(val, int)` will return True only in the case where `val` contains a value of type `int`, not type `str`. So the code within the `if` block can assume that `val` contains a value of type `int`, and the code within the `else` block can assume that `val` contains a value of type `str`. This demonstrates how a type (in this case `int | str`) can be narrowed in both a positive (`if`) and negative (`else`) test.
|
||||
|
||||
The following expression forms support type narrowing:
|
||||
|
||||
* `<ident>` (where `<ident>` is an identifier)
|
||||
* `<expr>.<member>` (member access expression where `<expr>` is a supported expression form)
|
||||
* `<ident> := <expr>` (assignment expression where `<expr>` is a supported expression form)
|
||||
* `<expr>[<int>]` (subscript expression where `<int>` is a non-negative integer)
|
||||
* `<expr>[<str>]` (subscript expression where `<str>` is a string literal)
|
||||
|
||||
Examples of expressions that support type narrowing:
|
||||
|
||||
* `my_var`
|
||||
* `employee.name`
|
||||
* `a.foo.next`
|
||||
* `args[3]`
|
||||
* `kwargs["bar"]`
|
||||
* `a.b.c[3]["x"].d`
|
||||
|
||||
|
||||
### Type Guards
|
||||
|
||||
In addition to assignment-based type narrowing, Pyright supports the following type guards.
|
||||
|
||||
* `x is None` and `x is not None`
|
||||
* `x == None` and `x != None`
|
||||
* `x is ...` and `x is not ...` (where `...` is an ellipsis token)
|
||||
* `x == ...` and `x != ...` (where `...` is an ellipsis token)
|
||||
* `x is S` and `x is not S` (where S is a Sentinel)
|
||||
* `type(x) is T` and `type(x) is not T`
|
||||
* `type(x) == T` and `type(x) != T`
|
||||
* `x is L` and `x is not L` (where L is an expression that evaluates to a literal type)
|
||||
* `x is C` and `x is not C` (where C is a class)
|
||||
* `x == L` and `x != L` (where L is an expression that evaluates to a literal type)
|
||||
* `x.y is None` and `x.y is not None` (where x is a type that is distinguished by a field with a None)
|
||||
* `x.y is E` and `x.y is not E` (where E is a literal enum or bool and x is a type that is distinguished by a field with a literal type)
|
||||
* `x.y == LN` and `x.y != LN` (where LN is a literal expression or `None` and x is a type that is distinguished by a field or property with a literal type)
|
||||
* `x[K] == V`, `x[K] != V`, `x[K] is V`, and `x[K] is not V` (where K and V are literal expressions and x is a type that is distinguished by a TypedDict field with a literal type)
|
||||
* `x[I] == V` and `x[I] != V` (where I and V are literal expressions and x is a known-length tuple that is distinguished by the index indicated by I)
|
||||
* `x[I] is B` and `x[I] is not B` (where I is a literal expression, B is a `bool` or enum literal, and x is a known-length tuple that is distinguished by the index indicated by I)
|
||||
* `x[I] is None` and `x[I] is not None` (where I is a literal expression and x is a known-length tuple that is distinguished by the index indicated by I)
|
||||
* `len(x) == L`, `len(x) != L`, `len(x) < L`, etc. (where x is tuple and L is an expression that evaluates to an int literal type)
|
||||
* `x in y` or `x not in y` (where y is instance of list, set, frozenset, deque, tuple, dict, defaultdict, or OrderedDict)
|
||||
* `S in D` and `S not in D` (where S is a string literal and D is a TypedDict)
|
||||
* `isinstance(x, T)` (where T is a type or a tuple of types)
|
||||
* `issubclass(x, T)` (where T is a type or a tuple of types)
|
||||
* `f(x)` (where f is a user-defined type guard as defined in [PEP 647](https://www.python.org/dev/peps/pep-0647/) or [PEP 742](https://www.python.org/dev/peps/pep-0742))
|
||||
* `bool(x)` (where x is any expression that is statically verifiable to be truthy or falsey in all cases)
|
||||
* `x` (where x is any expression that is statically verifiable to be truthy or falsey in all cases)
|
||||
|
||||
Expressions supported for type guards include simple names, member access chains (e.g. `a.b.c.d`), the unary `not` operator, the binary `and` and `or` operators, subscripts that are integer literals (e.g. `a[2]` or `a[-1]`), and call expressions. Other operators (such as arithmetic operators or other subscripts) are not supported.
|
||||
|
||||
Some type guards are able to narrow in both the positive and negative cases. Positive cases are used in `if` statements, and negative cases are used in `else` statements. (Positive and negative cases are flipped if the type guard expression is preceded by a `not` operator.) In some cases, the type can be narrowed only in the positive or negative case but not both. Consider the following examples:
|
||||
|
||||
```python
|
||||
class Foo: pass
|
||||
class Bar: pass
|
||||
|
||||
def func1(val: Foo | Bar):
|
||||
if isinstance(val, Bar):
|
||||
reveal_type(val) # Bar
|
||||
else:
|
||||
reveal_type(val) # Foo
|
||||
|
||||
def func2(val: float | None):
|
||||
if val:
|
||||
reveal_type(val) # float
|
||||
else:
|
||||
reveal_type(val) # float | None
|
||||
```
|
||||
|
||||
In the example of `func1`, the type was narrowed in both the positive and negative cases. In the example of `func2`, the type was narrowed only the positive case because the type of `val` might be either `float` (specifically, a value of 0.0) or `None` in the negative case.
|
||||
|
||||
### Aliased Conditional Expression
|
||||
|
||||
Pyright also supports a type guard expression `c`, where `c` is an identifier that refers to a local variable that is assigned one of the above supported type guard expression forms. These are called “aliased conditional expressions”. Examples include `c = a is not None` and `c = isinstance(a, str)`. When “c” is used within a conditional check, it can be used to narrow the type of expression `a`.
|
||||
|
||||
This pattern is supported only in cases where `c` is a local variable within a module or function scope and is assigned a value only once. It is also limited to cases where expression `a` is a simple identifier (as opposed to a member access expression or subscript expression), is local to the function or module scope, and is assigned only once within the scope. Unary `not` operators are allowed for expression `a`, but binary `and` and `or` are not.
|
||||
|
||||
```python
|
||||
def func1(x: str | None):
|
||||
is_str = x is not None
|
||||
|
||||
if is_str:
|
||||
reveal_type(x) # str
|
||||
else:
|
||||
reveal_type(x) # None
|
||||
```
|
||||
|
||||
```python
|
||||
def func2(val: str | bytes):
|
||||
is_str = not isinstance(val, bytes)
|
||||
|
||||
if not is_str:
|
||||
reveal_type(val) # bytes
|
||||
else:
|
||||
reveal_type(val) # str
|
||||
```
|
||||
|
||||
```python
|
||||
def func3(x: list[str | None]) -> str:
|
||||
is_str = x[0] is not None
|
||||
|
||||
if is_str:
|
||||
# This technique doesn't work for subscript expressions,
|
||||
# so x[0] is not narrowed in this case.
|
||||
reveal_type(x[0]) # str | None
|
||||
```
|
||||
|
||||
```python
|
||||
def func4(x: str | None):
|
||||
is_str = x is not None
|
||||
|
||||
if is_str:
|
||||
# This technique doesn't work in cases where the target
|
||||
# expression is assigned elsewhere. Here `x` is assigned
|
||||
# elsewhere in the function, so its type is not narrowed
|
||||
# in this case.
|
||||
reveal_type(x) # str | None
|
||||
|
||||
x = ""
|
||||
```
|
||||
|
||||
### Narrowing for Implied Else
|
||||
|
||||
When an “if” or “elif” clause is used without a corresponding “else”, Pyright will generally assume that the code can “fall through” without executing the “if” or “elif” block. However, there are cases where the analyzer can determine that a fall-through is not possible because the “if” or “elif” is guaranteed to be executed based on type analysis.
|
||||
|
||||
```python
|
||||
def func1(x: int):
|
||||
if x == 1 or x == 2:
|
||||
y = True
|
||||
|
||||
print(y) # Error: "y" is possibly unbound
|
||||
|
||||
def func2(x: Literal[1, 2]):
|
||||
if x == 1 or x == 2:
|
||||
y = True
|
||||
|
||||
print(y) # No error
|
||||
```
|
||||
|
||||
This can be especially useful when exhausting all members in an enum or types in a union.
|
||||
|
||||
```python
|
||||
from enum import Enum
|
||||
|
||||
class Color(Enum):
|
||||
RED = 1
|
||||
BLUE = 2
|
||||
GREEN = 3
|
||||
|
||||
def func3(color: Color) -> str:
|
||||
if color == Color.RED or color == Color.BLUE:
|
||||
return "yes"
|
||||
elif color == Color.GREEN:
|
||||
return "no"
|
||||
|
||||
def func4(value: str | int) -> str:
|
||||
if isinstance(value, str):
|
||||
return "received a str"
|
||||
elif isinstance(value, int):
|
||||
return "received an int"
|
||||
```
|
||||
|
||||
If you later added another color to the `Color` enumeration above (e.g. `YELLOW = 4`), Pyright would detect that `func3` no longer exhausts all members of the enumeration and possibly returns `None`, which violates the declared return type. Likewise, if you modify the type of the `value` parameter in `func4` to expand the union, a similar error will be produced.
|
||||
|
||||
This “narrowing for implied else” technique works for all narrowing expressions listed above with the exception of simple falsey/truthy statements and type guards. It is also limited to simple names and doesn’t work with member access or index expressions, and it requires that the name has a declared type (an explicit type annotation). These limitations are imposed because this functionality would otherwise have significant impact on analysis performance.
|
||||
|
||||
|
||||
### Narrowing Any
|
||||
|
||||
In general, the type `Any` is not narrowed. The only exceptions to this rule are the built-in `isinstance` and `issubclass` type guards, class pattern matching in “match” statements, and user-defined type guards. In all other cases, `Any` is left as is, even for assignments.
|
||||
|
||||
```python
|
||||
a: Any = 3
|
||||
reveal_type(a) # Any
|
||||
|
||||
a = "hi"
|
||||
reveal_type(a) # Any
|
||||
```
|
||||
|
||||
The same applies to `Any` when it is used as a type argument.
|
||||
|
||||
```python
|
||||
b: Iterable[Any] = [1, 2, 3]
|
||||
reveal_type(b) # list[Any]
|
||||
|
||||
c: Iterable[str] = [""]
|
||||
b = c
|
||||
reveal_type(b) # list[Any]
|
||||
```
|
||||
|
||||
### Narrowing for Captured Variables
|
||||
|
||||
If a variable’s type is narrowed in an outer scope and the variable is subsequently captured by an inner-scoped function or lambda, Pyright retains the narrowed type if it can determine that the value of the captured variable is not modified on any code path after the inner-scope function or lambda is defined and is not modified in another scope via a `nonlocal` or `global` binding.
|
||||
|
||||
```python
|
||||
def func(val: int | None):
|
||||
if val is not None:
|
||||
|
||||
def inner_1() -> None:
|
||||
reveal_type(val) # int
|
||||
print(val + 1)
|
||||
|
||||
inner_2 = lambda: reveal_type(val) + 1 # int
|
||||
|
||||
inner_1()
|
||||
inner_2()
|
||||
```
|
||||
|
||||
### Value-Constrained Type Variables
|
||||
|
||||
When a TypeVar is defined, it can be constrained to two or more types (values).
|
||||
|
||||
```python
|
||||
# Example of unconstrained type variable
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# Example of value-constrained type variables
|
||||
_StrOrFloat = TypeVar("_StrOrFloat", str, float)
|
||||
```
|
||||
|
||||
When a value-constrained TypeVar appears more than once within a function signature, the type provided for all instances of the TypeVar must be consistent.
|
||||
|
||||
```python
|
||||
def add(a: _StrOrFloat, b: _StrOrFloat) -> _StrOrFloat:
|
||||
return a + b
|
||||
|
||||
# The arguments for `a` and `b` are both `str`
|
||||
v1 = add("hi", "there")
|
||||
reveal_type(v1) # str
|
||||
|
||||
# The arguments for `a` and `b` are both `float`
|
||||
v2 = add(1.3, 2.4)
|
||||
reveal_type(v2) # float
|
||||
|
||||
# The arguments for `a` and `b` are inconsistent types
|
||||
v3 = add(1.3, "hi") # Error
|
||||
```
|
||||
|
||||
### Conditional Types and Type Variables
|
||||
|
||||
When checking the implementation of a function that uses type variables in its signature, the type checker must verify that type consistency is guaranteed. Consider the following example, where the input parameter and return type are both annotated with a type variable. The type checker must verify that if a caller passes an argument of type `str`, then all code paths must return a `str`. Likewise, if a caller passes an argument of type `float`, all code paths must return a `float`.
|
||||
|
||||
```python
|
||||
def add_one(value: _StrOrFloat) -> _StrOrFloat:
|
||||
if isinstance(value, str):
|
||||
sum = value + "1"
|
||||
else:
|
||||
sum = value + 1
|
||||
|
||||
reveal_type(sum) # str* | float*
|
||||
return sum
|
||||
```
|
||||
|
||||
The type of variable `sum` is reported with a star (`*`). This indicates that internally the type checker is tracking the type as a “conditional” type. In this particular example, it indicates that `sum` is a `str` type if the parameter `value` is a `str` but is a `float` if `value` is a `float`. By tracking these conditional types, the type checker can verify that the return type is consistent with the return type `_StrOrFloat`. Conditional types are a form of _intersection_ type, and they are considered subtypes of both the concrete type and the type variable.
|
||||
|
||||
|
||||
### Inferred Type of “self” and “cls” Parameters
|
||||
|
||||
When a type annotation for a method’s `self` or `cls` parameter is omitted, pyright will infer its type based on the class that contains the method. The inferred type is internally represented as a type variable that is bound to the class.
|
||||
|
||||
The type of `self` is represented as `Self@ClassName` where `ClassName` is the class that contains the method. Likewise, the `cls` parameter in a class method will have the type `Type[Self@ClassName]`.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
def method1(self):
|
||||
reveal_type(self) # Self@Parent
|
||||
return self
|
||||
|
||||
@classmethod
|
||||
def method2(cls):
|
||||
reveal_type(cls) # Type[Self@Parent]
|
||||
return cls
|
||||
|
||||
class Child(Parent):
|
||||
...
|
||||
|
||||
reveal_type(Child().method1()) # Child
|
||||
reveal_type(Child.method2()) # Type[Child]
|
||||
```
|
||||
|
||||
### Overloads
|
||||
|
||||
Some functions or methods can return one of several different types. In cases where the return type depends on the types of the input arguments, it is useful to specify this using a series of `@overload` signatures. When Pyright evaluates a call expression, it determines which overload signature best matches the supplied arguments.
|
||||
|
||||
[PEP 484](https://www.python.org/dev/peps/pep-0484/#function-method-overloading) introduced the `@overload` decorator and described how it can be used, but the PEP did not specify precisely how a type checker should choose the “best” overload. Pyright uses the following rules.
|
||||
|
||||
1. Pyright first filters the list of overloads based on simple “arity” (number of arguments) and keyword argument matching. For example, if one overload requires two positional arguments but only one positional argument is supplied by the caller, that overload is eliminated from consideration. Likewise, if the call includes a keyword argument but no corresponding parameter is included in the overload, it is eliminated from consideration.
|
||||
|
||||
2. Pyright next considers the types of the arguments and compares them to the declared types of the corresponding parameters. If the types do not match for a given overload, that overload is eliminated from consideration. Bidirectional type inference is used to determine the types of the argument expressions.
|
||||
|
||||
3. If only one overload remains, it is the “winner”.
|
||||
|
||||
4. If more than one overload remains, the “winner” is chosen based on the order in which the overloads are declared. In general, the first remaining overload is the “winner”. There are two exceptions to this rule.
|
||||
Exception 1: When an `*args` (unpacked) argument matches a `*args` parameter in one of the overload signatures, this overrides the normal order-based rule.
|
||||
Exception 2: When two or more overloads match because an argument evaluates to `Any` or `Unknown`, the matching overload is ambiguous. In this case, pyright examines the return types of the remaining overloads and eliminates types that are duplicates or are subsumed by (i.e. proper subtypes of) other types in the list. If only one type remains after this coalescing step, that type is used. If more than one type remains after this coalescing step, the type of the call expression evaluates to `Unknown`. For example, if two overloads are matched due to an argument that evaluates to `Any`, and those two overloads have return types of `str` and `LiteralString`, pyright will coalesce this to just `str` because `LiteralString` is a proper subtype of `str`. If the two overloads have return types of `str` and `bytes`, the call expression will evaluate to `Unknown` because `str` and `bytes` have no overlap.
|
||||
|
||||
5. If no overloads remain, Pyright considers whether any of the arguments are union types. If so, these union types are expanded into their constituent subtypes, and the entire process of overload matching is repeated with the expanded argument types. If two or more overloads match, the union of their respective return types form the final return type for the call expression. This "union expansion" can result in a combinatoric explosion if many arguments evaluate to union types. For example, if four arguments are present, and they all evaluate to unions that expand to ten subtypes, this could result in 10^4 combinations. Pyright expands unions for arguments left to right and halts expansion when the number of signatures exceeds 64.
|
||||
|
||||
6. If no overloads remain and all unions have been expanded, a diagnostic is generated indicating that the supplied arguments are incompatible with all overload signatures.
|
||||
|
||||
|
||||
### Class and Instance Variables
|
||||
|
||||
Most object-oriented languages clearly differentiate between class variables and instance variables. Python is a bit looser in that it allows an object to overwrite a class variable with an instance variable of the same name.
|
||||
|
||||
```python
|
||||
class A:
|
||||
my_var = 0
|
||||
|
||||
def my_method(self):
|
||||
self.my_var = "hi!"
|
||||
|
||||
a = A()
|
||||
print(A.my_var) # Class variable value of 0
|
||||
print(a.my_var) # Class variable value of 0
|
||||
|
||||
A.my_var = 1
|
||||
print(A.my_var) # Updated class variable value of 1
|
||||
print(a.my_var) # Updated class variable value of 1
|
||||
|
||||
a.my_method() # Writes to the instance variable my_var
|
||||
print(A.my_var) # Class variable value of 1
|
||||
print(a.my_var) # Instance variable value of "hi!"
|
||||
|
||||
A.my_var = 2
|
||||
print(A.my_var) # Updated class variable value of 2
|
||||
print(a.my_var) # Instance variable value of "hi!"
|
||||
```
|
||||
|
||||
Pyright differentiates between three types of variables: pure class variables, regular class variables, and pure instance variables.
|
||||
|
||||
#### Pure Class Variables
|
||||
If a class variable is declared with a `ClassVar` annotation as described in [PEP 526](https://peps.python.org/pep-0526/#class-and-instance-variable-annotations), it is considered a “pure class variable” and cannot be overwritten by an instance variable of the same name.
|
||||
|
||||
```python
|
||||
from typing import ClassVar
|
||||
|
||||
class A:
|
||||
x: ClassVar[int] = 0
|
||||
|
||||
def instance_method(self):
|
||||
self.x = 1 # Type error: Cannot overwrite class variable
|
||||
|
||||
@classmethod
|
||||
def class_method(cls):
|
||||
cls.x = 1
|
||||
|
||||
a = A()
|
||||
print(A.x)
|
||||
print(a.x)
|
||||
|
||||
A.x = 1
|
||||
a.x = 2 # Type error: Cannot overwrite class variable
|
||||
```
|
||||
|
||||
#### Regular Class Variables
|
||||
If a class variable is declared without a `ClassVar` annotation, it can be overwritten by an instance variable of the same name. The declared type of the instance variable is assumed to be the same as the declared type of the class variable.
|
||||
|
||||
Regular class variables can also be declared within a class method using a `cls` member access expression, but declaring regular class variables within the class body is more common and generally preferred for readability.
|
||||
|
||||
```python
|
||||
class A:
|
||||
x: int = 0
|
||||
y: int
|
||||
|
||||
def instance_method(self):
|
||||
self.x = 1
|
||||
self.y = 2
|
||||
|
||||
@classmethod
|
||||
def class_method(cls):
|
||||
cls.z: int = 3
|
||||
|
||||
A.y = 0
|
||||
A.z = 0
|
||||
print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 0
|
||||
|
||||
A.class_method()
|
||||
print(f"{A.x}, {A.y}, {A.z}") # 0, 0, 3
|
||||
|
||||
a = A()
|
||||
print(f"{a.x}, {a.y}, {a.z}") # 0, 0, 3
|
||||
a.instance_method()
|
||||
print(f"{a.x}, {a.y}, {a.z}") # 1, 2, 3
|
||||
|
||||
a.x = "hi!" # Error: Incompatible type
|
||||
```
|
||||
|
||||
#### Pure Instance Variables
|
||||
If a variable is not declared within the class body but is instead declared within a class method using a `self` member access expression, it is considered a “pure instance variable”. Such variables cannot be accessed through a class reference.
|
||||
|
||||
```python
|
||||
class A:
|
||||
def __init__(self):
|
||||
self.x: int = 0
|
||||
self.y: int
|
||||
|
||||
print(A.x) # Error: 'x' is not a class variable
|
||||
|
||||
a = A()
|
||||
print(a.x)
|
||||
|
||||
a.x = 1
|
||||
a.y = 2
|
||||
print(f"{a.x}, {a.y}") # 1, 2
|
||||
|
||||
print(a.z) # Error: 'z' is not an known member
|
||||
```
|
||||
|
||||
#### Inheritance of Class and Instance Variables
|
||||
Class and instance variables are inherited from parent classes. If a parent class declares the type of a class or instance variable, a derived class must honor that type when assigning to it.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
x: int | str | None
|
||||
y: int
|
||||
|
||||
class Child(Parent):
|
||||
x = "hi!"
|
||||
y = None # Error: Incompatible type
|
||||
```
|
||||
|
||||
The derived class can redeclare the type of a class or instance variable. If `reportIncompatibleVariableOverride` is enabled, the redeclared type must be the same as the type declared by the parent class. If the variable is immutable (as in a frozen `dataclass`), it is considered covariant, and it can be redeclared as a subtype of the type declared by the parent class.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
x: int | str | None
|
||||
y: int
|
||||
|
||||
class Child(Parent):
|
||||
x: int # Type error: 'x' cannot be redeclared with subtype because variable is mutable and therefore invariant
|
||||
y: str # Type error: 'y' cannot be redeclared with an incompatible type
|
||||
```
|
||||
|
||||
If a parent class declares the type of a class or instance variable and a derived class does not redeclare it but does assign a value to it, the declared type is retained from the parent class. It is not overridden by the inferred type of the assignment in the derived class.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
x: object
|
||||
|
||||
class Child(Parent):
|
||||
x = 3
|
||||
|
||||
reveal_type(Parent.x) # object
|
||||
reveal_type(Child.x) # object
|
||||
```
|
||||
|
||||
If neither the parent nor the derived class declare the type of a class or instance variable, the type is inferred within each class.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
x = object()
|
||||
|
||||
class Child(Parent):
|
||||
x = 3
|
||||
|
||||
reveal_type(Parent.x) # object
|
||||
reveal_type(Child.x) # int
|
||||
```
|
||||
|
||||
#### Type Variable Scoping
|
||||
|
||||
A type variable must be bound to a valid scope (a class, function, or type alias) before it can be used within that scope.
|
||||
|
||||
Pyright displays the bound scope for a type variable using an `@` symbol. For example, `T@func` means that type variable `T` is bound to function `func`.
|
||||
|
||||
```python
|
||||
S = TypeVar("S")
|
||||
T = TypeVar("T")
|
||||
|
||||
def func(a: T) -> T:
|
||||
b: T = a # T refers to T@func
|
||||
reveal_type(b) # T@func
|
||||
|
||||
c: S # Error: S has no bound scope in this context
|
||||
return b
|
||||
```
|
||||
|
||||
When a TypeVar or ParamSpec appears within parameter or return type annotations for a function and it is not already bound to an outer scope, it is normally bound to the function. As an exception to this rule, if the TypeVar or ParamSpec appears only within the return type annotation of the function and only within a single Callable in the return type, it is bound to that Callable rather than the function. This allows a function to return a generic Callable.
|
||||
|
||||
```python
|
||||
# T is bound to func1 because it appears in a parameter type annotation.
|
||||
def func1(a: T) -> Callable[[T], T]:
|
||||
a: T # OK because T is bound to func1
|
||||
|
||||
# T is bound to the return callable rather than func2 because it appears
|
||||
# only within a return Callable.
|
||||
def func2() -> Callable[[T], T]:
|
||||
a: T # Error because T has no bound scope in this context
|
||||
|
||||
# T is bound to func3 because it appears outside of a Callable.
|
||||
def func3() -> Callable[[T], T] | T:
|
||||
...
|
||||
|
||||
# This scoping logic applies also to type aliases used within a return
|
||||
# type annotation. T is bound to the return Callable rather than func4.
|
||||
Transform = Callable[[S], S]
|
||||
def func4() -> Transform[T]:
|
||||
...
|
||||
```
|
||||
|
||||
### Type Annotation Comments
|
||||
Versions of Python prior to 3.6 did not support type annotations for variables. Pyright honors type annotations found within a comment at the end of the same line where a variable is assigned.
|
||||
|
||||
```python
|
||||
offsets = [] # type: list[int]
|
||||
|
||||
self._target = 3 # type: int | str
|
||||
```
|
||||
|
||||
Future versions of Python will likely deprecate support for type annotation comments. The “reportTypeCommentUsage” diagnostic will report usage of such comments so they can be replaced with inline type annotations.
|
||||
|
||||
|
||||
### Literal Math Inference
|
||||
When inferring the type of some unary and binary operations that involve operands with literal types, pyright computes the result of operations on the literal values, producing a new literal type in the process. For example:
|
||||
|
||||
```python
|
||||
def func(x: Literal[1, 3], y: Literal[4, 7]):
|
||||
z = x + y
|
||||
reveal_type(z) # Literal[5, 8, 7, 10]
|
||||
|
||||
z = x * y
|
||||
reveal_type(z) # Literal[4, 7, 12, 21]
|
||||
|
||||
z = (x | y) ^ 1
|
||||
reveal_type(z) # Literal[4, 6]
|
||||
|
||||
z = x ** y
|
||||
reveal_type(z) # Literal[1, 81, 2187]
|
||||
```
|
||||
|
||||
Literal math also works on `str` literals.
|
||||
|
||||
```python
|
||||
reveal_type("a" + "b") # Literal["ab"]
|
||||
```
|
||||
|
||||
The result of a literal math operation can result in large unions. Pyright limits the number of subtypes in the resulting union to 64. If the union grows beyond that, the corresponding non-literal type is inferred.
|
||||
|
||||
```python
|
||||
def func(x: Literal[1, 2, 3, 4, 5]):
|
||||
y = x * x
|
||||
reveal_type(y) # Literal[1, 2, 3, 4, 5, 6, 8, 10, 9, 12, 15, 16, 20, 25]
|
||||
z = y * x
|
||||
reveal_type(z) # int
|
||||
```
|
||||
|
||||
Literal math inference is disabled within loops and lambda expressions.
|
||||
|
||||
|
||||
### Static Conditional Evaluation
|
||||
Pyright performs static evaluation of several conditional expression forms. This includes several forms that are mandated by the [Python typing spec](https://typing.readthedocs.io/en/latest/spec/directives.html#version-and-platform-checking).
|
||||
|
||||
* `sys.version_info <comparison> <tuple>`
|
||||
* `sys.version_info[0] >= <number>`
|
||||
* `sys.platform == <string literal>`
|
||||
* `os.name == <string literal>`
|
||||
* `typing.TYPE_CHECKING` or `typing_extensions.TYPE_CHECKING`
|
||||
* `True` or `False`
|
||||
* An identifier defined with the "defineConstant" configuration option
|
||||
* A `not` unary operator with any of the above forms
|
||||
* An `and` or `or` binary operator with any of the above forms
|
||||
|
||||
If one of these conditional expressions evaluates statically to false, pyright does not analyze any of the code within it other than checking for and reporting syntax errors.
|
||||
|
||||
|
||||
### Reachability
|
||||
Pyright performs “reachability analysis” to determine whether statements will be executed at runtime and whether it should analyze and report errors in code.
|
||||
|
||||
Reachability analysis is based on both non-type and type information. Non-type information includes statements that affect code structure such as `continue`, `raise` and `return`. It also includes conditional statements (`if`, `elif`, or `while`) where the conditional expression is one of these [supported expression forms](type-concepts-advanced#static-conditional-evaluation). Type analysis is not performed on code determined to be unreachable using non-type information. Therefore, language server features like completion suggestions are not available for this code.
|
||||
|
||||
Here are some examples of code determined to be unreachable using non-type information.
|
||||
|
||||
```python
|
||||
from typing import TYPE_CHECKING
|
||||
import sys
|
||||
|
||||
if False:
|
||||
print('unreachable')
|
||||
|
||||
if not TYPE_CHECKING:
|
||||
print('unreachable')
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
print('unreachable')
|
||||
|
||||
if sys.platform == 'ENIAC':
|
||||
print('unreachable')
|
||||
|
||||
def func1():
|
||||
return
|
||||
print('unreachable')
|
||||
|
||||
def func2():
|
||||
raise NotImplemented
|
||||
print('unreachable')
|
||||
```
|
||||
|
||||
Pyright can also detect code that is unreachable based on static type analysis. This analysis is based on the assumption that any provided type annotations are accurate.
|
||||
|
||||
Here are some examples of code determined to be unreachable using type analysis.
|
||||
|
||||
```python
|
||||
from typing import Literal, NoReturn
|
||||
|
||||
def always_raise() -> NoReturn:
|
||||
raise ValueError
|
||||
|
||||
def func1():
|
||||
always_raise()
|
||||
print('unreachable')
|
||||
|
||||
def func2(x: str):
|
||||
if not isinstance(x, str):
|
||||
print('unreachable')
|
||||
|
||||
def func3(x: Literal[1, 2]):
|
||||
if x == 1 or x == 2:
|
||||
return
|
||||
|
||||
print("unreachable")
|
||||
```
|
||||
|
||||
Code that is determined to be unreachable is reported through the use of “tagged hints”. These are special diagnostics that tell a language client to display the code in a visually distinctive manner, typically with a grayed-out appearance. Code determined to be unreachable using non-type information is always reported through this mechanism. Code determined to be unreachable using type analysis is reported only if “enableReachabilityAnalysis” is enabled in the configuration.
|
||||
104
docs/type-concepts.md
Normal file
104
docs/type-concepts.md
Normal file
@@ -0,0 +1,104 @@
|
||||
## Static Typing: The Basics
|
||||
|
||||
Getting started with static type checking in Python is easy, but it’s important to understand a few simple concepts. In addition to the documentation below, you may also find the community-maintained [Static Typing Documentation](https://typing.readthedocs.io/en/latest/) to be of use. That site also includes the official [Specification for the Python Type System](https://typing.readthedocs.io/en/latest/spec/index.html).
|
||||
|
||||
|
||||
### Type Declarations
|
||||
When you add a type annotation to a variable or a parameter in Python, you are _declaring_ that the symbol will be assigned values that are compatible with that type. You can think of type annotations as a powerful way to comment your code. Unlike text-based comments, these comments are readable by both humans and enforceable by type checkers.
|
||||
|
||||
If a variable or parameter has no type annotation, Pyright will assume that any value can be assigned to it.
|
||||
|
||||
|
||||
### Type Assignability
|
||||
When your code assigns a value to a symbol (in an assignment expression) or a parameter (in a call expression), the type checker first determines the type of the value being assigned. It then determines whether the target has a declared type. If so, it verifies that the type of the value is _assignable_ to the declared type.
|
||||
|
||||
Let’s look at a few simple examples. In this first example, the declared type of `a` is `float`, and it is assigned a value that is an `int`. This is permitted because `int` is assignable to `float`.
|
||||
|
||||
```python
|
||||
a: float = 3
|
||||
```
|
||||
|
||||
In this example, the declared type of `b` is `int`, and it is assigned a value that is a `float`. This is flagged as an error because `float` is not assignable to `int`.
|
||||
|
||||
```python
|
||||
b: int = 3.4 # Error
|
||||
```
|
||||
|
||||
This example introduces the notion of a _Union type_, which specifies that a value can be one of several distinct types. A union type can be expressed using the `|` operator to combine individual types.
|
||||
|
||||
```python
|
||||
c: int | float = 3.4
|
||||
c = 5
|
||||
c = a
|
||||
c = b
|
||||
c = None # Error
|
||||
c = "" # Error
|
||||
```
|
||||
|
||||
This example introduces the _Optional_ type, which is the same as a union with `None`.
|
||||
|
||||
```python
|
||||
d: Optional[int] = 4
|
||||
d = b
|
||||
d = None
|
||||
d = "" # Error
|
||||
```
|
||||
|
||||
Those examples are straightforward. Let’s look at one that is less intuitive. In this example, the declared type of `f` is `list[int | None]`. A value of type `list[int]` is being assigned to `f`. As we saw above, `int` is assignable to `int | None`. You might therefore assume that `list[int]` is assignable to `list[int | None]`, but this is an incorrect assumption. To understand why, we need to understand generic types and type arguments.
|
||||
|
||||
```python
|
||||
e: list[int] = [3, 4]
|
||||
f: list[int | None] = e # Error
|
||||
```
|
||||
|
||||
### Generic Types
|
||||
|
||||
A _generic type_ is a class that is able to handle different types of inputs. For example, the `list` class is generic because it is able to operate on different types of elements. The type `list` by itself does not specify what is contained within the list. Its element type must be specified as a _type argument_ using the indexing (square bracket) syntax in Python. For example, `list[int]` denotes a list that contains only `int` elements whereas `list[int | float]` denotes a list that contains a mixture of int and float elements.
|
||||
|
||||
We noted above that `list[int]` is not assignable to `list[int | None]`. Why is this the case? Consider the following example.
|
||||
|
||||
```python
|
||||
my_list_1: list[int] = [1, 2, 3]
|
||||
my_list_2: list[int | None] = my_list_1 # Error
|
||||
my_list_2.append(None)
|
||||
|
||||
for elem in my_list_1:
|
||||
print(elem + 1) # Runtime exception
|
||||
```
|
||||
|
||||
The code is appending the value `None` to the list `my_list_2`, but `my_list_2` refers to the same object as `my_list_1`, which has a declared type of `list[int]`. The code has violated the type of `my_list_1` because it no longer contains only `int` elements. This broken assumption results in a runtime exception. The type checker detects this broken assumption when the code attempts to assign `my_list_1` to `my_list_2`.
|
||||
|
||||
`list` is an example of a _mutable container type_. It is mutable in that code is allowed to modify its contents — for example, add or remove items. The type parameters for mutable container types are typically marked as _invariant_, which means that an exact type match is enforced. This is why the type checker reports an error when attempting to assign a `list[int]` to a variable of type `list[int | None]`.
|
||||
|
||||
Most mutable container types also have immutable counterparts.
|
||||
|
||||
| Mutable Type | Immutable Type |
|
||||
| ----------------- | -------------- |
|
||||
| list | Sequence |
|
||||
| dict | Mapping |
|
||||
| set | Container |
|
||||
| n/a | tuple |
|
||||
|
||||
|
||||
Switching from a mutable container type to a corresponding immutable container type is often an effective way to resolve type errors relating to assignability. Let’s modify the example above by changing the type annotation for `my_list_2`.
|
||||
|
||||
```python
|
||||
my_list_1: list[int] = [1, 2, 3]
|
||||
my_list_2: Sequence[int | None] = my_list_1 # No longer an error
|
||||
```
|
||||
|
||||
The type error on the second line has now gone away.
|
||||
|
||||
For more details about generic types, type parameters, and invariance, refer to [PEP 483 — The Theory of Type Hints](https://www.python.org/dev/peps/pep-0483/).
|
||||
|
||||
|
||||
### Debugging Types
|
||||
|
||||
When you want to know the type that the type checker has evaluated for an expression, you can use the special `reveal_type()` function:
|
||||
|
||||
```python
|
||||
x = 1
|
||||
reveal_type(x) # Type of "x" is "Literal[1]"
|
||||
```
|
||||
|
||||
This function is always available and does not need to be imported. When you use Pyright within an IDE, you can also simply hover over an identifier to see its evaluated type.
|
||||
373
docs/type-inference.md
Normal file
373
docs/type-inference.md
Normal file
@@ -0,0 +1,373 @@
|
||||
## Understanding Type Inference
|
||||
|
||||
### Symbols and Scopes
|
||||
|
||||
In Python, a _symbol_ is any name that is not a keyword. Symbols can represent classes, functions, methods, variables, parameters, modules, type aliases, type variables, etc.
|
||||
|
||||
Symbols are defined within _scopes_. A scope is associated with a block of code and defines which symbols are visible to that code block. Scopes can be “nested” allowing code to see symbols within its immediate scope and all “outer” scopes.
|
||||
|
||||
The following constructs within Python define a scope:
|
||||
1. The “builtins” scope is always present and is always the outermost scope. It is pre-populated by the Python interpreter with symbols like “int” and “list”.
|
||||
2. The module scope (sometimes called the “global” scope) is defined by the current source code file.
|
||||
3. Each class defines its own scope. Symbols that represent methods, class variables, or instance variables appear within a class scope.
|
||||
4. Each function and lambda defines its own scope. The function’s parameters are symbols within its scope, as are any variables defined within the function.
|
||||
5. List comprehensions define their own scope.
|
||||
|
||||
### Type Declarations
|
||||
|
||||
A symbol can be declared with an explicit type. The “def” and “class” keywords, for example, declare a symbol as a function or a class. Other symbols in Python can be introduced into a scope with no declared type. Newer versions of Python have introduced syntax for declaring the types of input parameters, return parameters, and variables.
|
||||
|
||||
When a parameter or variable is annotated with a type, the type checker verifies that all values assigned to that parameter or variable conform to that type.
|
||||
|
||||
Consider the following example:
|
||||
```python
|
||||
def func1(p1: float, p2: str, p3, **p4) -> None:
|
||||
var1: int = p1 # This is a type violation
|
||||
var2: str = p2 # This is allowed because the types match
|
||||
var2: int # This is an error because it redeclares var2
|
||||
var3 = p1 # var3 does not have a declared type
|
||||
return var1 # This is a type violation
|
||||
```
|
||||
|
||||
Symbol | Symbol Category | Scope | Declared Type
|
||||
----------|-----------------|-----------|----------------------------------------------------
|
||||
func1 | Function | Module | (float, str, Any, dict[str, Any]) -> None
|
||||
p1 | Parameter | func1 | float
|
||||
p2 | Parameter | func1 | str
|
||||
p3 | Parameter | func1 | <none>
|
||||
p4 | Parameter | func1 | <none>
|
||||
var1 | Variable | func1 | int
|
||||
var2 | Variable | func1 | str
|
||||
var3 | Variable | func1 | <none>
|
||||
|
||||
|
||||
Note that once a symbol’s type is declared, it cannot be redeclared to a different type.
|
||||
|
||||
### Type Inference
|
||||
|
||||
Some languages require every symbol to be explicitly typed. Python allows a symbol to be bound to different values at runtime, so its type can change over time. A symbol’s type doesn’t need to be declared statically.
|
||||
|
||||
When Pyright encounters a symbol with no type declaration, it attempts to _infer_ the type based on the values assigned to it. As we will see below, type inference cannot always determine the correct (intended) type, so type annotations are still required in some cases. Furthermore, type inference can require significant computation, so it is much less efficient than when type annotations are provided.
|
||||
|
||||
### “Unknown” Type
|
||||
|
||||
If a symbol’s type cannot be inferred, Pyright sets its type to “Unknown”, which is a special form of “Any”. The “Unknown” type allows Pyright to optionally warn when types are not declared and cannot be inferred, thus leaving potential “blind spots” in type checking.
|
||||
|
||||
#### Single-Assignment Type Inference
|
||||
|
||||
The simplest form of type inference is one that involves a single assignment to a symbol. The inferred type comes from the type of the source expression. Examples include:
|
||||
|
||||
```python
|
||||
var1 = 3 # Inferred type is int
|
||||
var2 = "hi" # Inferred type is str
|
||||
var3 = list() # Inferred type is list[Unknown]
|
||||
var4 = [3, 4] # Inferred type is list[int]
|
||||
for var5 in [3, 4]: ... # Inferred type is int
|
||||
var6 = [p for p in [1, 2, 3]] # Inferred type is list[int]
|
||||
```
|
||||
|
||||
#### Multi-Assignment Type Inference
|
||||
|
||||
When a symbol is assigned values in multiple places within the code, those values may have different types. The inferred type of the variable is the union of all such types.
|
||||
|
||||
```python
|
||||
# In this example, symbol var1 has an inferred type of `str | int`.
|
||||
class Foo:
|
||||
def __init__(self):
|
||||
self.var1 = ""
|
||||
|
||||
def do_something(self, val: int):
|
||||
self.var1 = val
|
||||
|
||||
# In this example, symbol var2 has an inferred type of `Foo | None`.
|
||||
if __debug__:
|
||||
var2 = None
|
||||
else:
|
||||
var2 = Foo()
|
||||
```
|
||||
|
||||
#### Ambiguous Type Inference
|
||||
|
||||
In some cases, an expression’s type is ambiguous. For example, what is the type of the expression `[]`? Is it `list[None]`, `list[int]`, `list[Any]`, `Sequence[Any]`, `Iterable[Any]`? These ambiguities can lead to unintended type violations. Pyright uses several techniques for reducing these ambiguities based on contextual information. In the absence of contextual information, heuristics are used.
|
||||
|
||||
#### Bidirectional Type Inference (Expected Types)
|
||||
|
||||
One powerful technique Pyright uses to eliminate type inference ambiguities is _bidirectional inference_. This technique makes use of an “expected type”.
|
||||
|
||||
As we saw above, the type of the expression `[]` is ambiguous, but if this expression is passed as an argument to a function, and the corresponding parameter is annotated with the type `list[int]`, Pyright can now assume that the type of `[]` in this context must be `list[int]`. Ambiguity eliminated!
|
||||
|
||||
This technique is called “bidirectional inference” because type inference for an assignment normally proceeds by first determining the type of the right-hand side (RHS) of the assignment, which then informs the type of the left-hand side (LHS) of the assignment. With bidirectional inference, if the LHS of an assignment has a declared type, it can influence the inferred type of the RHS.
|
||||
|
||||
Let’s look at a few examples:
|
||||
|
||||
```python
|
||||
var1 = [] # Type of RHS is ambiguous
|
||||
var2: list[int] = [] # Type of LHS now makes type of RHS unambiguous
|
||||
var3 = [4] # Type is assumed to be list[int]
|
||||
var4: list[float] = [4] # Type of RHS is now list[float]
|
||||
var5 = (3,) # Type is assumed to be tuple[Literal[3]]
|
||||
var6: tuple[float, ...] = (3,) # Type of RHS is now tuple[float, ...]
|
||||
```
|
||||
|
||||
#### Empty List and Dictionary Type Inference
|
||||
|
||||
It is common to initialize a local variable or instance variable to an empty list (`[]`) or empty dictionary (`{}`) on one code path but initialize it to a non-empty list or dictionary on other code paths. In such cases, Pyright will infer the type based on the non-empty list or dictionary and suppress errors about a “partially unknown type”.
|
||||
|
||||
```python
|
||||
if some_condition:
|
||||
my_list = []
|
||||
else:
|
||||
my_list = ["a", "b"]
|
||||
|
||||
reveal_type(my_list) # list[str]
|
||||
```
|
||||
|
||||
|
||||
#### Return Type Inference
|
||||
|
||||
As with variable assignments, function return types can be inferred from the `return` statements found within that function. The returned type is assumed to be the union of all types returned from all `return` statements. If a `return` statement is not followed by an expression, it is assumed to return `None`. Likewise, if the function does not end in a `return` statement, and the end of the function is reachable, an implicit `return None` is assumed.
|
||||
|
||||
```python
|
||||
# This function has two explicit return statements and one implicit
|
||||
# return (at the end). It does not have a declared return type,
|
||||
# so Pyright infers its return type based on the return expressions.
|
||||
# In this case, the inferred return type is `str | bool | None`.
|
||||
|
||||
def func1(val: int):
|
||||
if val > 3:
|
||||
return ""
|
||||
elif val < 1:
|
||||
return True
|
||||
```
|
||||
|
||||
#### NoReturn return type
|
||||
|
||||
If there is no code path that returns from a function (e.g. all code paths raise an exception), Pyright infers a return type of `NoReturn`. As an exception to this rule, if the function is decorated with `@abstractmethod`, the return type is not inferred as `NoReturn` even if there is no return. This accommodates a common practice where an abstract method is implemented with a `raise` statement that raises an exception of type `NotImplementedError`.
|
||||
|
||||
```python
|
||||
class Foo:
|
||||
# The inferred return type is NoReturn.
|
||||
def method1(self):
|
||||
raise Exception()
|
||||
|
||||
# The inferred return type is Unknown.
|
||||
@abstractmethod
|
||||
def method2(self):
|
||||
raise NotImplementedError()
|
||||
```
|
||||
|
||||
#### Generator return types
|
||||
|
||||
Pyright can infer the return type for a generator function from the `yield` statements contained within that function.
|
||||
|
||||
#### Call-site Return Type Inference
|
||||
|
||||
It is common for input parameters to be unannotated. This can make it difficult for Pyright to infer the correct return type for a function. For example:
|
||||
|
||||
```python
|
||||
# The return type of this function cannot be fully inferred based
|
||||
# on the information provided because the types of parameters
|
||||
# a and b are unknown. In this case, the inferred return
|
||||
# type is `Unknown | None`.
|
||||
|
||||
def func1(a, b, c):
|
||||
if c:
|
||||
return a
|
||||
elif c > 3:
|
||||
return b
|
||||
else:
|
||||
return None
|
||||
```
|
||||
|
||||
In cases where all parameters are unannotated, Pyright uses a technique called _call-site return type inference_. It performs type inference using the the types of arguments passed to the function in a call expression. If the unannotated function calls other functions, call-site return type inference can be used recursively. Pyright limits this recursion to a small number for practical performance reasons.
|
||||
|
||||
```python
|
||||
def func2(p_int: int, p_str: str, p_flt: float):
|
||||
# The type of var1 is inferred to be `int | None` based
|
||||
# on call-site return type inference.
|
||||
var1 = func1(p_int, p_int, p_int)
|
||||
|
||||
# The type of var2 is inferred to be `str | float | None`.
|
||||
var2 = func1(p_str, p_flt, p_int)
|
||||
```
|
||||
|
||||
#### Parameter Type Inference
|
||||
|
||||
Input parameters for functions and methods typically require type annotations. There are several cases where Pyright may be able to infer a parameter’s type if it is unannotated.
|
||||
|
||||
For instance methods, the first parameter (named `self` by convention) is inferred to be type `Self`.
|
||||
|
||||
For class methods, the first parameter (named `cls` by convention) is inferred to be type `type[Self]`.
|
||||
|
||||
For other unannotated parameters within a method, Pyright looks for a method of the same name implemented in a base class. If the corresponding method in the base class has the same signature (the same number of parameters with the same names), no overloads, and annotated parameter types, the type annotation from this method is “inherited” for the corresponding parameter in the child class method.
|
||||
|
||||
```python
|
||||
class Parent:
|
||||
def method1(self, a: int, b: str) -> float:
|
||||
...
|
||||
|
||||
|
||||
class Child(Parent):
|
||||
def method1(self, a, b):
|
||||
return a
|
||||
|
||||
reveal_type(Child.method1) # (self: Child, a: int, b: str) -> int
|
||||
```
|
||||
|
||||
When parameter types are inherited from a base class method, the return type is not inherited. Instead, normal return type inference techniques are used.
|
||||
|
||||
If the type of an unannotated parameter cannot be inferred using any of the above techniques and the parameter has a default argument expression associated with it, the parameter type is inferred from the default argument type. If the default argument is `None`, the inferred type is `Unknown | None`.
|
||||
|
||||
```python
|
||||
def func(a, b=0, c=None):
|
||||
pass
|
||||
|
||||
reveal_type(func) # (a: Unknown, b: int, c: Unknown | None) -> None
|
||||
```
|
||||
|
||||
This inference technique also applies to lambdas whose input parameters include default arguments.
|
||||
|
||||
```python
|
||||
cb = lambda x = "": x
|
||||
reveal_type(cb) # (x: str = "" -> str)
|
||||
```
|
||||
|
||||
#### Literals
|
||||
|
||||
Python 3.8 introduced support for _literal types_. This allows a type checker like Pyright to track specific literal values of str, bytes, int, bool, and enum values. As with other types, literal types can be declared.
|
||||
|
||||
```python
|
||||
# This function is allowed to return only values 1, 2 or 3.
|
||||
def func1() -> Literal[1, 2, 3]:
|
||||
...
|
||||
|
||||
# This function must be passed one of three specific string values.
|
||||
def func2(mode: Literal["r", "w", "rw"]) -> None:
|
||||
...
|
||||
```
|
||||
|
||||
When Pyright is performing type inference, it generally does not infer literal types. Consider the following example:
|
||||
|
||||
```python
|
||||
# If Pyright inferred the type of var1 to be list[Literal[4]],
|
||||
# any attempt to append a value other than 4 to this list would
|
||||
# generate an error. Pyright therefore infers the broader
|
||||
# type list[int].
|
||||
var1 = [4]
|
||||
```
|
||||
|
||||
#### Tuple Expressions
|
||||
|
||||
When inferring the type of a tuple expression (in the absence of bidirectional inference hints), Pyright assumes that the tuple has a fixed length, and each tuple element is typed as specifically as possible.
|
||||
|
||||
```python
|
||||
# The inferred type is tuple[Literal[1], Literal["a"], Literal[True]].
|
||||
var1 = (1, "a", True)
|
||||
|
||||
def func1(a: int):
|
||||
# The inferred type is tuple[int, int].
|
||||
var2 = (a, a)
|
||||
|
||||
# If you want the type to be tuple[int, ...]
|
||||
# (i.e. a homogeneous tuple of indeterminate length),
|
||||
# use a type annotation.
|
||||
var3: tuple[int, ...] = (a, a)
|
||||
```
|
||||
|
||||
Because tuples are typed as specifically as possible, literal types are normally retained. However, as an exception to this inference rule, if the tuple expression is nested within another tuple, set, list or dictionary expression, literal types are not retained. This is done to avoid the inference of complex types (e.g. unions with many subtypes) when evaluating tuple statements with many entries.
|
||||
|
||||
```python
|
||||
# The inferred type is list[tuple[int, str, bool]].
|
||||
var4 = [(1, "a", True), (2, "b", False), (3, "c", False)]
|
||||
```
|
||||
|
||||
#### List Expressions
|
||||
|
||||
When inferring the type of a list expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics:
|
||||
|
||||
1. If the list is empty (`[]`), assume `list[Unknown]` (unless a known list type is assigned to the same variable along another code path).
|
||||
2. If the list contains at least one element and all elements are the same type T, infer the type `list[T]`.
|
||||
3. If the list contains multiple elements that are of different types, the behavior depends on the `strictListInference` configuration setting. By default this setting is off.
|
||||
|
||||
* If `strictListInference` is off, infer `list[Unknown]`.
|
||||
* Otherwise use the union of all element types and infer `list[Union[(elements)]]`.
|
||||
|
||||
These heuristics can be overridden through the use of bidirectional inference hints (e.g. by providing a declared type for the target of the assignment expression).
|
||||
|
||||
```python
|
||||
var1 = [] # Infer list[Unknown]
|
||||
|
||||
var2 = [1, 2] # Infer list[int]
|
||||
|
||||
# Type depends on strictListInference config setting
|
||||
var3 = [1, 3.4] # Infer list[Unknown] (off)
|
||||
var3 = [1, 3.4] # Infer list[int | float] (on)
|
||||
|
||||
var4: list[float] = [1, 3.4] # Infer list[float]
|
||||
```
|
||||
|
||||
|
||||
#### Set Expressions
|
||||
|
||||
When inferring the type of a set expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics:
|
||||
|
||||
1. If the set contains at least one element and all elements are the same type T, infer the type `set[T]`.
|
||||
2. If the set contains multiple elements that are of different types, the behavior depends on the `strictSetInference` configuration setting. By default this setting is off.
|
||||
|
||||
* If `strictSetInference` is off, infer `set[Unknown]`.
|
||||
* Otherwise use the union of all element types and infer `set[Union[(elements)]]`.
|
||||
|
||||
These heuristics can be overridden through the use of bidirectional inference hints (e.g. by providing a declared type for the target of the assignment expression).
|
||||
|
||||
```python
|
||||
var1 = {1, 2} # Infer set[int]
|
||||
|
||||
# Type depends on strictSetInference config setting
|
||||
var2 = {1, 3.4} # Infer set[Unknown] (off)
|
||||
var2 = {1, 3.4} # Infer set[int | float] (on)
|
||||
|
||||
var3: set[float] = {1, 3.4} # Infer set[float]
|
||||
```
|
||||
|
||||
|
||||
#### Dictionary Expressions
|
||||
|
||||
When inferring the type of a dictionary expression (in the absence of bidirectional inference hints), Pyright uses the following heuristics:
|
||||
|
||||
1. If the dict is empty (`{}`), assume `dict[Unknown, Unknown]`.
|
||||
2. If the dict contains at least one element and all keys are the same type K and all values are the same type V, infer the type `dict[K, V]`.
|
||||
3. If the dict contains multiple elements where the keys or values differ in type, the behavior depends on the `strictDictionaryInference` configuration setting. By default this setting is off.
|
||||
|
||||
* If `strictDictionaryInference` is off, infer `dict[Unknown, Unknown]`.
|
||||
* Otherwise use the union of all key and value types `dict[Union[(keys)], Union[(values)]]`.
|
||||
|
||||
|
||||
```python
|
||||
var1 = {} # Infer dict[Unknown, Unknown]
|
||||
|
||||
var2 = {1: ""} # Infer dict[int, str]
|
||||
|
||||
# Type depends on strictDictionaryInference config setting
|
||||
var3 = {"a": 3, "b": 3.4} # Infer dict[str, Unknown] (off)
|
||||
var3 = {"a": 3, "b": 3.4} # Infer dict[str, int | float] (on)
|
||||
|
||||
var4: dict[str, float] = {"a": 3, "b": 3.4}
|
||||
```
|
||||
|
||||
#### Lambdas
|
||||
|
||||
Lambdas present a particular challenge for a Python type checker because there is no provision in the Python syntax for annotating the types of a lambda’s input parameters. The types of these parameters must therefore be inferred based on context using bidirectional type inference. Absent this context, a lambda’s input parameters (and often its return type) will be unknown.
|
||||
|
||||
```python
|
||||
# The type of var1 is (a: Unknown, b: Unknown) -> Unknown.
|
||||
var1 = lambda a, b: a + b
|
||||
|
||||
# This function takes a comparison function callback.
|
||||
def float_sort(list: list[float], comp: Callable[[float, float], bool]): ...
|
||||
|
||||
# In this example, the types of the lambda’s input parameters
|
||||
# a and b can be inferred to be float because the float_sort
|
||||
# function expects a callback that accepts two floats as
|
||||
# inputs.
|
||||
float_sort([2, 1.3], lambda a, b: False if a < b else True)
|
||||
```
|
||||
49
docs/type-server.md
Normal file
49
docs/type-server.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Pyright Type Server
|
||||
|
||||
In addition to the [command-line tool](command-line.md) and the [language server](settings.md), Pyright ships a **type server** that speaks the Type Server Protocol (TSP). It is distributed as a separate npm package, `pyright-typeserver`, and is exposed through the `pyright-typeserver` executable.
|
||||
|
||||
## What is the Type Server Protocol?
|
||||
|
||||
The Language Server Protocol (LSP) is designed around editor features (completions, hover, go-to-definition, and so on). Some tools instead need direct access to a Python type checker's *type information* — the inferred type of an expression, the declared type of a symbol, resolved imports, and search paths — without going through editor-oriented requests.
|
||||
|
||||
The Type Server Protocol is a JSON-RPC protocol, layered on top of the same transport as LSP, that exposes this type information directly. A client can open Python documents in the usual LSP way (`textDocument/didOpen`, `textDocument/didChange`, …) and then ask the type server questions such as:
|
||||
|
||||
* `typeServer/getComputedType` — the inferred type at a parse node.
|
||||
* `typeServer/getDeclaredType` — the declared type of a declaration.
|
||||
* `typeServer/getExpectedType` — the expected (contextual) type at a node.
|
||||
* `typeServer/resolveImport` — resolve an import to a file on disk.
|
||||
* `typeServer/getPythonSearchPaths` — the search paths used for import resolution.
|
||||
* `typeServer/getSnapshot` — the current analysis snapshot version, used to keep type queries consistent with the document state.
|
||||
|
||||
## Running the type server
|
||||
|
||||
The type server communicates over stdio, just like the language server:
|
||||
|
||||
```bash
|
||||
pyright-typeserver --stdio
|
||||
```
|
||||
|
||||
It is not intended to be run interactively; it is started by a client (for example, an editor extension or a code-generation tool) that drives it over the protocol.
|
||||
|
||||
## Notebook support
|
||||
|
||||
The type server understands Jupyter notebooks. When a client sends `notebookDocument/didOpen`, `notebookDocument/didChange`, and `notebookDocument/didClose`, the server models the notebook as a linear chain of chained cell source files so that names defined in earlier cells are visible in later cells, matching notebook execution semantics.
|
||||
|
||||
## Virtual file redirection
|
||||
|
||||
The type server supports redirecting the contents of a file on disk to a virtual document supplied by the client. This is used, for example, by stub generators that synthesize a merged view of a module and want the type server to analyze the synthesized contents in place of the file on disk. Clients drive this through the `pyright/setVirtualFileRedirect` and `pyright/removeVirtualFileRedirect` notifications.
|
||||
|
||||
## Relationship to Pyright
|
||||
|
||||
The type server is built on the same analyzer, binder, and type evaluator as the Pyright command-line tool and language server. It reuses Pyright's `Service` / `Program` / `SourceFile` infrastructure, so type results are identical to what Pyright's other front ends produce.
|
||||
|
||||
### Code layout: two packages
|
||||
|
||||
The type server is split across two packages, following the same convention Pyright uses for its command-line tool and language server:
|
||||
|
||||
| Package | Role |
|
||||
| --- | --- |
|
||||
| `packages/pyright-internal/src/typeServer/` | **All of the actual code.** The server, protocol definitions, notebook support, virtual-file redirection, the file system layer, and the tests all live here. This is the only package with real implementation. |
|
||||
| `packages/pyright-typeserver/` | **The distributable wrapper.** A thin bundling shim (rspack config, `package.json`, and a bin entry point) that packages the code above into the publishable `pyright-typeserver` npm package. It contains no logic — its `nodeMain.ts` simply calls `main()` from `pyright-internal`. |
|
||||
|
||||
This mirrors how `pyright-internal` holds all of the parser/checker/evaluator logic while the `pyright` package is just the thin CLI and language-server bundle. Keeping the code in `pyright-internal` means the type server shares the exact same `vscode-languageserver` copy and analyzer internals as the rest of Pyright, rather than pulling in a duplicate or mismatched set of dependencies.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user