nutti / fake-bpy-module

Fake Blender Python API module collection for the code completion.
MIT License
1.35k stars 96 forks source link

VS Code warnings on poll_message_set #133

Closed Andrej730 closed 1 year ago

Andrej730 commented 1 year ago

System Information

Noted some issue causing warnings atleast in VS Code. Since all modules are pre-generated I guess it could lead to more general issue.

poll_message_set - add classmethod. VS Code problem: "Argument missing for parameter "message"" image

What helps is changing code in types.py from

    def poll_message_set(self, message: typing.Optional[str], *args):
        ''' Set the message to show in the tool-tip when poll fails. When message is callable, additional user defined positional arguments are passed to the message function.

        :param message: The message or a function that returns the message.
        :type message: typing.Optional[str]
        '''
        pass

to

    @classmethod
    def poll_message_set(self, message: typing.Optional[str], *args):
        ''' Set the message to show in the tool-tip when poll fails. When message is callable, additional user defined positional arguments are passed to the message function.

        :param message: The message or a function that returns the message.
        :type message: typing.Optional[str]
        '''
        pass
nutti commented 1 year ago

This issue needs to be fixed from Blender. I have submitted the PR to fix this issue. https://projects.blender.org/blender/blender/pulls/108854

nutti commented 1 year ago

The patch is now merged. https://projects.blender.org/blender/blender/commit/61ead957a0129cce141c2aa1a3e65cb378eb8437

I will close this issue.