Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False error in comments #171

Open
BlackRam-oss opened this issue Jul 18, 2022 · 4 comments
Open

False error in comments #171

BlackRam-oss opened this issue Jul 18, 2022 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers topic:diagnostics

Comments

@BlackRam-oss
Copy link

BlackRam-oss commented Jul 18, 2022

Extension version

2.1.1

Issue description

False error in comments

Scope inspector screenshots

image

Code

init python:
    class NotifyEx(renpy.python.RevertableObject):
        """Notifications, to use: default ... = NotifyEx(msg="...", img="...")"""
        def __init__(self,
                    msg: str,
                    img: str
                    ):
            super(NotifyEx, self).__init__()
            self.msg = msg
            self.img = img
            self.remain = gui.notifyEx_delay


    def notifyEx(msg: str = None, img: str = None):
        notifications.append(NotifyEx(msg, img))
        if len(store.notifications) == 1:
            renpy.show_screen("notifyEx")


    def notifyExClean(value):
        if value in store.notifications:
            store.notifications.remove(value)
        if len(store.notifications) == 0:
            renpy.hide_screen("notifyEx")


    def notify(notific):
        """View defined notifications.
        to use: $ notify(...)"""
        notifications.append(NotifyEx(notific.msg, notific.img))
        if len(store.notifications) == 1:
            renpy.show_screen("notifyEx")
@duckdoom4
Copy link
Collaborator

Thanks for the bug report! This is actually a diagnostics error.

We'll try to fix it as soon as we can, unfortunately because we plan on updating the diagnostics code it's currently not on my personal priority list.

If it's an easy fix, I might look into it when I find the time. But if anyone wants to, feel free to make a PR :)

@duckdoom4 duckdoom4 added bug Something isn't working good first issue Good for newcomers labels Jul 18, 2022
@a2937
Copy link
Contributor

a2937 commented May 6, 2023

Would it be simple enough if it was checked to see if it was part of a string before giving an error?

@duckdoom4
Copy link
Collaborator

Would it be simple enough if it was checked to see if it was part of a string before giving an error?

Yes, but the problem stems from how the 'is it part of a string check' is performed. We need to parse the code using regex expressions. We already have the correct regex expressions in the syntax highlighter, it's just not correct in the diagnostics class. It'd be a matter of copy pasting the correct expression.

The plan is to improve this process as soon as the code parser is fully functional.

@a2937
Copy link
Contributor

a2937 commented May 7, 2023

Actually it doesn't appear possible to solve the current example currently. Your "checkStrayDollarSigns" function is fed line by line. In the example to use: $ notify(...)""" would be fed in there. There's no proper way to determine if a string has both started and ended unless the string was only one line long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers topic:diagnostics
Projects
None yet
Development

No branches or pull requests

3 participants