talonhub / community

Voice command set for Talon, community-supported.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSCode issues

nickeubank opened this issue · comments

Hey All!

When I have open a jupyter interactive console, I seem unable to get the usual VSCode operations to work. For example bar switch generates this:

[The below error was raised while handling the above exception(s)]
2021-06-18 16:39:35 ERROR cb error topic="phrase" cb=<bound method SpeechSystem.engine_event of <talon.scripting.speech_system.SpeechSystem object at 0x10b4b6ae0>>
   29:       lib/python3.9/threading.py:912* # cron thread
   28:       lib/python3.9/threading.py:954* 
   27:       lib/python3.9/threading.py:892* 
   26:                    talon/cron.py:145| 
   25:                    talon/cron.py:102| 
   24:          talon/scripting/rctx.py:233| # 'cron' talon_plugins.engines.dragon:<lambda>()
   23:      talon/scripting/dispatch.py:99 | 
   22:      talon/scripting/dispatch.py:105| 
   21:      talon/scripting/dispatch.py:144| 
   20:      talon/scripting/dispatch.py:133| 
   19:          talon/scripting/rctx.py:233| # 'phrase' main:_redispatch()
   18: talon/scripting/speech_system.py:61 | 
   17:      talon/scripting/dispatch.py:105| 
   16:      talon/scripting/dispatch.py:144| 
   15:      talon/scripting/dispatch.py:133| 
   14: ------------------------------------# cron thread
   13:          talon/scripting/rctx.py:233| # 'phrase' main:engine_event()
   12: talon/scripting/speech_system.py:374| 
   11:       talon/scripting/actions.py:75 | 
   10:         talon/scripting/types.py:366| 
    9:     talon/scripting/core/core.py:100| 
    8:       talon/scripting/actions.py:75 | 
    7:         talon/scripting/types.py:366| 
    6:     talon/scripting/core/core.py:131| 
    5:       talon/scripting/actions.py:75 | 
    4:         talon/scripting/types.py:366| 
    3:     talon/scripting/core/core.py:136| 
    2:  talon/scripting/talon_script.py:691| 
    1:  talon/scripting/talon_script.py:594| 
talon.scripting.talon_script.TalonScriptError: 
 in script at /Users/Nick/.talon/user/knausj_talon/apps/vscode/vscode.talon:66:
 > user.vscode('workbench.action.toggleSidebarVisibility')
Exception: This editor is not active

Any suggestions?

macOS, if that helps

And... now it works. OK, so very intermittent. Will dig in more...

There is code in the VSCode extension that tries to prevent the wrong instance of VSCode from trying to execute the given command. However, there seems to be an intermittent bug in VSCode's determination of which editor is active.

How often is this issue occurring?

Pretty frequently for me unfortunately -- at least half the time it seems. Know of any behavioral changes I can make to prevent it?

I can add an option to disable that check. The scenario it protects against is pretty unlikely

Ok @nickeubank you can now disable the command-server.backgroundWindowProtection setting as described here. Lmk if that works and I'll close the issue

Thanks so much! I'll report back after playing around for a while.

Fwiw I have now disabled the background window protection by default, so you should just be able to upgrade your command-server extension

Hmmm.... still running into intermediate problems, though error looks different now:

[The below error was raised while handling the above exception(s)]
2021-06-25 13:42:47 ERROR cb error topic="phrase" cb=<bound method SpeechSystem.engine_event of <talon.scripting.speech_system.SpeechSystem object at 0x113c02cc0>>
   29:       lib/python3.9/threading.py:912* # cron thread
   28:       lib/python3.9/threading.py:954* 
   27:       lib/python3.9/threading.py:892* 
   26:                    talon/cron.py:145| 
   25:                    talon/cron.py:102| 
   24:          talon/scripting/rctx.py:233| # 'cron' talon_plugins.engines.dragon:<lambda>()
   23:      talon/scripting/dispatch.py:99 | 
   22:      talon/scripting/dispatch.py:105| 
   21:      talon/scripting/dispatch.py:144| 
   20:      talon/scripting/dispatch.py:133| 
   19:          talon/scripting/rctx.py:233| # 'phrase' main:_redispatch()
   18: talon/scripting/speech_system.py:61 | 
   17:      talon/scripting/dispatch.py:105| 
   16:      talon/scripting/dispatch.py:144| 
   15:      talon/scripting/dispatch.py:133| 
   14: ------------------------------------# cron thread
   13:          talon/scripting/rctx.py:233| # 'phrase' main:engine_event()
   12: talon/scripting/speech_system.py:374| 
   11:       talon/scripting/actions.py:75 | 
   10:         talon/scripting/types.py:366| 
    9:     talon/scripting/core/core.py:100| 
    8:       talon/scripting/actions.py:75 | 
    7:         talon/scripting/types.py:366| 
    6:     talon/scripting/core/core.py:131| 
    5:       talon/scripting/actions.py:75 | 
    4:         talon/scripting/types.py:366| 
    3:     talon/scripting/core/core.py:136| 
    2:  talon/scripting/talon_script.py:691| 
    1:  talon/scripting/talon_script.py:594| 
talon.scripting.talon_script.TalonScriptError: 
 in script at /Users/Nick/.talon/user/knausj_talon/apps/vscode/vscode.talon:66:
 > user.vscode('workbench.action.toggleSidebarVisibility')
Exception: Found recent request file; vscode is probably hung
2021-06-25 13:42:48 WARNING actions: skipped because they have no matching declaration: (app.window_save)
2021-06-25 13:42:49 WARNING actions: skipped because they have no matching declaration: (app.window_save)

Hmm that shouldn't be happening anymore. Try merging latest knausj and lmk if that fixes it

OK, rebasing with knausj again seems to be helping a lot, thanks! I'll close!

Thanks so much!