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

Add "Execute Document" command that always executes the entire file #6

Open
zdoek001 opened this issue Mar 13, 2023 · 9 comments
Open
Labels
enhancement New feature or request

Comments

@zdoek001
Copy link

zdoek001 commented Mar 13, 2023

If the code contains Chinese characters, or the comment contains Chinese characters, LogPython will be prompted in the UE output: Error: File "Vscode extensions nilssoderman. ue-python-0.2.0 python vscode_execute. py", line 69, in main
LogPython: Error: execute_ code(vscode_in_file.read(), exec_ origin, is_ debugging)
LogPython: Error: UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 98: illegal multibyte sequence

@nils-soderman
Copy link
Owner

Hi,

Thanks for reporting this issue, I believe this should've been fixed with the release of 0.2.1 since it's now using UTF-8 to decode the files.

Make sure your running the latest version then please give it another try, and do let me know if the issue persist!

Cheers,
Nils

@zdoek001
Copy link
Author

zdoek001 commented Mar 19, 2023

Hi,

Thanks for reporting this issue, I believe this should've been fixed with the release of 0.2.1 since it's now using UTF-8 to decode the files.

Make sure your running the latest version then please give it another try, and do let me know if the issue persist!

Cheers, Nils

Hello,
I have tried version 0.2.1 and this issue has been resolved. Thank you for your plug-in, which is very convenient.

At the same time, after using it for a period of time, I have three suggestions for your reference:

1:When clicking on the end of a line, pressing the shortcut key can automatically send a single line without selecting it.
Sometimes when selecting rows, if there are spaces in front of them, it will fail to execute, and I always need to be careful to select them.

2:After selecting multiple lines in the box, press the shortcut key to send multiple lines (now implemented)

3: Press the shortcut key to automatically send all code content under the current. py file without selecting all codes

Because now you always need to select rows, or select all to send.. I hope you can set different shortcut keys to distinguish them, so that it can be more convenient to send them to the UE.
Another advantage of using different shortcut keys to distinguish them is that I don't have to worry about incorrect operations all the time, resulting in sending the full text to the UE.

I got inspiration for this usage in vscode to 3dsmax maxscript. More convenient.
I use translation software. The description may not be accurate.
thank you.

@nils-soderman
Copy link
Owner

nils-soderman commented Mar 20, 2023

Hi,

Glad to hear it's working! And thank you for the feedback/ideas!

1: Ideally you shouldn't have to worry about the spaces, however I noticed there's a bug when executing a single line where it takes spaces into account, I will look into this and provide a fix for the next update!

3: Having different shortcuts for Send All / Send Selection/Line might be a good idea, it'd probably be implemented as an optional config though, so you can chose the default behavior if nothing is selected.

I will take a look at the 3dsMax extension as well, to compare and see what that is doing.

Thanks!

@nils-soderman nils-soderman added bug Something isn't working enhancement New feature or request labels Mar 20, 2023
@zdoek001
Copy link
Author

zdoek001 commented Mar 20, 2023

Hi,

Glad to hear it's working! And thank you for the feedback/ideas!

1: Ideally you shouldn't have to worry about the spaces, however I noticed there's a bug when executing a single line where it takes spaces into account, I will look into this and provide a fix for the next update!

3: Having different shortcuts for Send All / Send Selection/Line might be a good idea, it'd probably be implemented as an optional config though, so you can chose the default behavior if nothing is selected.

I will take a look at the 3dsMax extension as well, to compare and see what that is doing.

Thanks!

Thank you for your reply.
They can be divided into three shortcuts:

  1. When selecting a single line or multiple lines in Vscode, press the shortcut key to send the code to UE5(space before code should be considered).
  2. If the line is not selected, but the cursor is on a line, send the line to UE5(need to consider the space before the code).
  3. Send the full text to UE5

thank you

@nils-soderman
Copy link
Owner

Hi,

Version 0.2.2 has now been released, this fixes the bug that would cause the execution to fail if there were spaces in front of a single selected line.

The new commands didn't make this update, needed a bit more time to think about it + I haven't had the time to checkout 3ds max extension yet.

I think three shortcuts are a bit too much for what is essentially the same functionality. I'm currently thinking of splitting it up in two commands:

  1. Execute Document: (Always executes the entire file)
  2. Execute (If something is selected the selection will be executed. If not, it will either execute the entire document or the line where the cursor is depending on a config/setting that can be set to whichever the user prefer).

@nils-soderman nils-soderman removed the bug Something isn't working label Mar 26, 2023
@zdoek001
Copy link
Author

zdoek001 commented Mar 30, 2023 via email

@zdoek001
Copy link
Author

Hi,

Version 0.2.2 has now been released, this fixes the bug that would cause the execution to fail if there were spaces in front of a single selected line.

The new commands didn't make this update, needed a bit more time to think about it + I haven't had the time to checkout 3ds max extension yet.

I think three shortcuts are a bit too much for what is essentially the same functionality. I'm currently thinking of splitting it up in two commands:

  1. Execute Document: (Always executes the entire file)
  2. Execute (If something is selected the selection will be executed. If not, it will either execute the entire document or the line where the cursor is depending on a config/setting that can be set to whichever the user prefer).

Do you have the latest news about these features?

@zdoek001 zdoek001 reopened this Aug 14, 2023
@zdoek001
Copy link
Author

Hi,

Version 0.2.2 has now been released, this fixes the bug that would cause the execution to fail if there were spaces in front of a single selected line.

The new commands didn't make this update, needed a bit more time to think about it + I haven't had the time to checkout 3ds max extension yet.

I think three shortcuts are a bit too much for what is essentially the same functionality. I'm currently thinking of splitting it up in two commands:

  1. Execute Document: (Always executes the entire file)
  2. Execute (If something is selected the selection will be executed. If not, it will either execute the entire document or the line where the cursor is depending on a config/setting that can be set to whichever the user prefer).

Hi, I have followed this project again. Do you have the latest news? It accelerated my testing

@nils-soderman
Copy link
Owner

Hi,

No news on this feature yet. I've been contemplating whether this is a good idea or if it just adds additional complexity that the majority of users won't use.

@nils-soderman nils-soderman changed the title LogPython: Error: UnicodeDecodeError: 'gbk' codec Add "Execute Document" command that always executes the entire file Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants