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

[Feature Request] Undefined variable dialog could propose to leave all undeclared as undefined #17460

Open
jecisc opened this issue Nov 26, 2024 · 2 comments · May be fixed by #17482
Open

[Feature Request] Undefined variable dialog could propose to leave all undeclared as undefined #17460

jecisc opened this issue Nov 26, 2024 · 2 comments · May be fixed by #17482

Comments

@jecisc
Copy link
Member

jecisc commented Nov 26, 2024

In a code editor (for example in Calypso) it is possible to write the name of a class that is not present in the system. When we compile the method or execute it, we get a dialog proposing some options such as leaving the variable undeclared or creating a new class of this name.

One of the option is to leave the variable undeclared. But sometimes I have 10 undeclared class in a method to compile and it is a bother to select 10 times this option in the dialog.

It might be nice to have an option to leave all remaining variables undeclared for this compilation.

For this one I am not sure if it is easy to implement it or not

@AlexisCnockaert
Copy link
Collaborator

The compilation works like this : OCASTSemanticAnalyzer >>#undeclaredVariable: adds a OCUndeclaredVariableNotice to the undeclaredVariable, this notice creates a OCCodeReparator that opens the dialog in openMenu:
It is easy to create an option "Leave all variables undeclared" in this menu.
I think a way to implement it would be to create a Flag or something like that and if the user select the option "Leave all variables undeclared", the Flag value becomes true. In OCASTSemanticAnalyzer >>#undeclaredVariable: we can add code that checks if the flag is true or false (to open the dialog or not).
And at the end of the compilation we put the flag back to his default value.
@jecisc what do you think ?

@jecisc
Copy link
Member Author

jecisc commented Nov 27, 2024

This seems good to me thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants