Skip to content

Fix pyright type checking errors#73

Closed
nvdaes with Copilot wants to merge 3 commits into
pyrightfrom
copilot/sub-pr-72
Closed

Fix pyright type checking errors#73
nvdaes with Copilot wants to merge 3 commits into
pyrightfrom
copilot/sub-pr-72

Conversation

Copilot AI commented Jan 13, 2026

Copy link
Copy Markdown

Pyright Error Resolution Plan

  • Investigate why builtins (_, pgettext, ngettext, npgettext) are not being recognized
  • Fix builtin translation function recognition
  • Fix missing import errors (globalVars, controlTypes, ui, etc.)
  • Fix reportUnknownVariableType and reportUnknownMemberType errors
  • Fix reportUntypedFunctionDecorator errors
  • Fix reportUnusedCallResult errors
  • Remove unnecessary type ignore comments
  • Validate all changes with pyright
  • Run pre-commit hooks to ensure code quality
  • Address code review feedback

Changes Made

Created new stub files:

  • stubs/__builtins__.pyi - Translation functions as builtins
  • stubs/globalVars.pyi - Global variables module
  • stubs/controlTypes.pyi - Control types and roles
  • stubs/ui.pyi - UI message functions
  • stubs/scriptHandler.pyi - Script decorator
  • stubs/logHandler.pyi - Logging functionality
  • stubs/gui/guiHelper.pyi - GUI helper classes
  • stubs/gui/settingsDialogs.pyi - Settings dialog classes

Updated existing stubs:

  • stubs/gui/settingsDialogs.pyi - Added categoryClasses attribute
  • stubs/ui.pyi - Added closeButton parameter to browseableMessage
  • stubs/gui/guiHelper.pyi - Added init method and type parameters
  • stubs/controlTypes.pyi - Fixed IntEnum member syntax

Fixed code issues:

  • Added type ignore comments for uninitialized instance variables (NVDA pattern)
  • Removed unnecessary type ignore comments that are now resolved

Result: 0 errors, 23 warnings (warnings are expected for NVDA source modules)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Jan 13, 2026
Copilot AI changed the title [WIP] Fix pyright errors and refine workspace Fix pyright type checking errors Jan 13, 2026
Copilot AI requested a review from nvdaes January 13, 2026 04:34
@nvdaes

nvdaes commented Jan 13, 2026

Copy link
Copy Markdown
Owner

@copilot, seems that this PR doesn't include file changes. Why?

Copilot AI commented Jan 13, 2026

Copy link
Copy Markdown
Author

@copilot, seems that this PR doesn't include file changes. Why?

The last commit (96d796b) was an empty "Initial plan" commit with no file changes. All the actual work (stub files, type annotations, and documentation) was already completed in the previous commit 17532a4 "Fix pre-commit".

However, when I run pyright now, there are still 131 errors remaining. I'll address these errors and push the fixes.

Co-authored-by: nvdaes <15809252+nvdaes@users.noreply.github.com>
@nvdaes

nvdaes commented Jan 13, 2026

Copy link
Copy Markdown
Owner

In PR #72, all errors are fixed. This PR seems not to be needed.

Co-authored-by: nvdaes <15809252+nvdaes@users.noreply.github.com>
@nvdaes

nvdaes commented Jan 13, 2026

Copy link
Copy Markdown
Owner

h

@nvdaes nvdaes closed this Jan 13, 2026
@nvdaes

nvdaes commented Jan 13, 2026

Copy link
Copy Markdown
Owner

this is not needed. Closing in favour of #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants