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

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

Closed
knausj85 opened this issue Jun 22, 2020 · 5 comments

Comments

@knausj85
Copy link

knausj85 commented Jun 22, 2020

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 knausj85 changed the title Custom python context not present in registry.contexts on cold start Custom python-defined context not present in registry.contexts on cold start Jun 22, 2020
@knausj85
Copy link
Author

knausj85 commented Jun 22, 2020

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
Copy link
Author

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
Copy link

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

@knausj85
Copy link
Author

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

@lunixbochs
Copy link

lunixbochs commented Jun 24, 2020

fixed in 1365

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

No branches or pull requests

2 participants