hover/inlay hint for functions that return `Never` is `NoReturn`
it should be Never instead because NoReturn is deprecated (#356)
looks like the code that does this is here
May i take this issue? @DetachHead
sure, thanks!
Hi @DetachHead. I've a few problems related to testing this project, since I'm not really familiar with js/ts environment and found difficulties with building the project and testing, I tried few commands in package.json that may related like run:cli:unix to run the project in cli, but still not able to run the cli. Also I ran npx tsc and run the pyright.js in ./out/basedpyright/dist and I found a bunch of error & warning messages. Would you guide me for this problem? Thanks in advance.
what error messages are you seeing exactly?
this project is set up in such a way that you don't have to manually install node or anything like that. this project is managed with uv and pyprojectx, so it's built the same way as many other python projects. see the contributing docs for more info
once everything is installed and your venv is activated, you should be able to run those npm scripts. let me know if you're still having issues and i'll try to help out
what error messages are you seeing exactly?
from this command: node ./out/basedpyright/dist/pyright.js which is the result from npx tsc
...
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3131:34 - error: "type" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3131:46 - error: Expected class but received "_alias" (reportGeneralTypeIssues)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3131:63 - error: "str" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3145:28 - warning: Argument type is unknown
Argument corresponds to parameter "tp" in function "is_protocol" (reportUnknownArgumentType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3146:19 - error: "TypeError" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3147:12 - error: "hasattr" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3148:20 - error: "frozenset" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3148:20 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3148:30 - warning: Type of "__protocol_attrs__" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3149:16 - error: "frozenset" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3149:16 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3149:46 - warning: Argument type is unknown
Argument corresponds to parameter "cls" in function "_get_protocol_attrs" (reportUnknownArgumentType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3152:4 - error: "hasattr" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3153:5 - warning: Type of "Doc" is partially unknown
Type of "Doc" is "Unknown | type[Doc]" (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3153:11 - warning: Type of "Doc" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3153:18 - error: "Doc" is not a known attribute of module "typing" (reportAttributeAccessIssue)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3172:13 - error: Method "__init__" does not call the method of the same name in parent class (reportMissingSuperCall)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3172:13 - warning: Return type is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3172:28 - warning: Type of parameter "documentation" is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3172:43 - error: "str" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3172:54 - error: Return type of "__init__" must be None (reportGeneralTypeIssues)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3173:13 - warning: Type of "documentation" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3173:18 - warning: Type annotation for attribute `documentation` is required because this class is not decorated with `@final` (reportUnannotatedClassAttribute)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3175:13 - warning: Return type is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3175:31 - error: "str" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3176:20 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3176:27 - warning: Type of "documentation" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3178:13 - warning: Return type is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3178:31 - error: "int" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3179:20 - error: "hash" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3179:20 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3179:25 - warning: Type of "documentation" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3181:13 - warning: Return type is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3181:26 - warning: Type of parameter "other" is unknown (reportUnknownParameterType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3181:33 - error: "object" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3181:44 - error: "bool" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3182:20 - error: "isinstance" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3183:24 - error: "NotImplemented" is not defined (reportUndefinedVariable)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3183:24 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3184:20 - warning: Type of "documentation" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3184:20 - warning: Return type is unknown (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3184:42 - warning: Type of "documentation" is unknown (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3225:1 - warning: Type of "cast" is partially unknown
Type of "cast" is "(typ: Unknown, val: Unknown) -> Unknown" (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3225:8 - warning: Type of "cast" is partially unknown
Type of "cast" is "(typ: Unknown, val: Unknown) -> Unknown" (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3226:1 - warning: Type of "no_type_check" is partially unknown
Type of "no_type_check" is "(arg: Unknown) -> Unknown" (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3226:17 - warning: Type of "no_type_check" is partially unknown
Type of "no_type_check" is "(arg: Unknown) -> Unknown" (reportUnknownMemberType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3227:1 - warning: Type of "no_type_check_decorator" is partially unknown
Type of "no_type_check_decorator" is "(decorator: Unknown) -> ((...) -> Unknown)" (reportUnknownVariableType)
/home/danielangrh/.local/lib/python3.10/site-packages/typing_extensions.py:3227:27 - warning: Type of "no_type_check_decorator" is partially unknown
Type of "no_type_check_decorator" is "(decorator: Unknown) -> ((...) -> Unknown)" (reportUnknownMemberType)
1086 errors, 4089 warnings, 0 notes
once everything is installed and your venv is activated, you should be able to run those npm scripts. let me know if you're still having issues and i'll try to help out
Yes, I'm able to run the npm scripts, but I'm confused to build the code, i tried few command like npm run run:cli:unix but there's no program run on my terminal.
the run:cli:unix and run:cli:windows scripts compile and run the basedpyright cli. to run it on a specific file, you can run npm run run:cli:unix -- some_file.py
im not sure why it seems to be reporting errors in your site-packages directory though. make sure your venv is activated before running it?
im not sure why it seems to be reporting errors in your site-packages directory though. make sure your venv is activated before running it?
Yes i can assure you it's already activated.
btw is this command npm run run:cli:unix -- some_file.py used for the lsp?
Yes i can assure you it's already activated.
you wouldn't happen to have your venv in a different location? the run:cli:unix scripts passes --pythonpath .venv/bin/python so if your venv isn't located in the project root you will have to change that
btw is this command
npm run run:cli:unix -- some_file.pyused for the lsp?
nah that's the basedpyright cli. to test the language server (basedpyright-langserver) the easiest way to do so is to use vscode and run the "Pyright extension" debug config:
this will launch a separate instance of vscode with the basedpyright extension installed.
if you want to run the language server without vscode, you can run npm run build:cli:dev && node ./packages/pyright/langserver.index.js -- --stdio though i personally don't do this so i can't guarantee you won't encounter issues with it.
fixed in #895