talonvoice / beta

Issue tracker for the private Talon Beta
10 stars 0 forks source link

Custom python-defined context not present in registry.contexts on cold start #83

Closed knausj85 closed 4 years ago

knausj85 commented 4 years ago

v1357, OSX

This python-defined context for vscode doesn't appear in registry.contexts in the repl on cold start of talon https://github.com/knausj85/knausj_talon/blob/95c91c034e584bc7344cbd7eb735ec1d08e7f93e/apps/vscode/vscode.py#L14

As such, title tracking for code.language doesn't function for VSCode, as it leverages the win.filename & win.file_ext actions now. With Talon running, modifying and saving vscode.py will result in the context appearing, and then things work as expected.

Cold start registry.contexts

'user.knausj_talon.apps.vscode.vscode.linux.talon': Context(user.knausj_talon.apps.vscode.vscode.linux.talon), 'user.knausj_talon.apps.vscode.vscode.mac.talon': Context(user.knausj_talon.apps.vscode.vscode.mac.talon), 'user.knausj_talon.apps.vscode.vscode.win.talon': Context(user.knausj_talon.apps.vscode.vscode.win.talon),

After saving or moving the file:

user.knausj_talon.apps.vscode.vscode.linux.talon': Context(user.knausj_talon.apps.vscode.vscode.linux.talon), 'user.knausj_talon.apps.vscode.vscode.mac.talon': Context(user.knausj_talon.apps.vscode.vscode.mac.talon), 'user.knausj_talon.apps.vscode.vscode.win.talon': Context(user.knausj_talon.apps.vscode.vscode.win.talon), Context(user.knausj_talon.text.symbols.talon), 'user.knausj_talon.apps.vscode.vscode': Context(user.knausj_talon.apps.vscode.vscode)

user.knausj_talon.apps.vscode.vscode is missing in the first instance

knausj85 commented 4 years ago

Testing a few permutations, it looks like this combination of files is the culprit.

https://github.com/knausj85/knausj_talon/blob/95c91c034e584bc7344cbd7eb735ec1d08e7f93e/apps/vscode/vscode.mac.talon

https://github.com/knausj85/knausj_talon/blob/95c91c034e584bc7344cbd7eb735ec1d08e7f93e/apps/vscode/vscode.py#L14

So maybe some sort conflict between the two? If vscode.mac.talon is removed, vscode.py will be present and function on cold start.

knausj85 commented 4 years ago

This issue appears to be caused by the naming convention of the files.

vscode.mac.talon
vscode.linux.talon
vscode.win.talon
vscode.py

If any one of the vscode.{platform}.talon files are present, the vscode.py context is not present on startup.

If I rename the files as such, the vscode.py context is present.

mac.talon
linux.talon
win.talon
vscode.py
lunixbochs commented 4 years ago

oh, I don't know why you'd name it vscode/vscode.mac.talon anyway

knausj85 commented 4 years ago

it's sort-of convenient for readily finding all vscode-related things in most any app (e.g., windows explorer).

lunixbochs commented 4 years ago

fixed in 1365