Open ParetoOptimalDev opened 2 years ago
I just installed vscode and didn't have a ~/.config/Code/User/settings.json
file. This seemed to fix things:
echo "{}" > ~/.config/Code/User/settings.json
At least no errors on talon startup, will report back after trying more stuff.
Yes sorry that's a known issue that should be fixed soon. Just to check: was everything still working even though you had this error in your logs?
I got another error after that one, but I think maybe users installing extensions the expected vscode way might not run into the error below where I don't have command-server
.
For context to understand how I run into it I'm installing vscode with nixos where I list out the extensions and only had talon
, parse-tree
, and cursorless
.
2022-02-03 16:22:14 INFO Startup warnings displayed at 3.5035s
2022-02-03 16:22:40 WARNING list 'user.punctuation' skipped unknown tokens: [',', '`']
2022-02-03 16:22:40 WARNING list 'user.symbol_key' skipped unknown tokens: [',', '`']
2022-02-03 16:23:28 ERROR 19: talon/scripting/talon_script.py:590|
18: talon/scripting/talon_script.py:297|
17: talon/scripting/talon_script.py:557|
16: talon/scripting/actions.py:78 |
15: talon/scripting/types.py:383|
14: user/cursorless-talon/src/actions/actions.py:65 | return actions.user.cursorless_command..
13: talon/scripting/actions.py:78 |
12: talon/scripting/types.py:383|
11: user/cursorless-talon/src/actions/actions.py:54 | return actions.user.cursorless_single_..
10: talon/scripting/actions.py:78 |
9: talon/scripting/types.py:383|
8: user/cursorless-talon/src/command.py:32 | actions.user.cursorless_multiple_targe..
7: talon/scripting/actions.py:78 |
6: talon/scripting/types.py:383|
5: user/cursorless-talon/src/command.py:93 | actions.user.vscode_with_plugin_and_wa..
4: talon/scripting/actions.py:78 |
3: talon/scripting/types.py:383|
2: user/knausj_talon/apps/vscode/command_client/command_client.py:331| run_vscode_command(
1: user/knausj_talon/apps/vscode/command_client/command_client.py:154| raise Exception("Must use command-server extension for advanced commands")
Exception: Must use command-server extension for advanced commands
My latest issue is:
2022-02-03 16:51:55 WARNING actions: skipped because they have no matching declaration: (user.code_type_dictionary)
That appears to be in knausj_talon under the javascript
tag, so I'll add that to settings.talon.
I'm still getting:
2022-02-03 17:10:05 WARNING actions: skipped because they have no matching declaration: (user.code_type_dictionary)
Even though I've enabled that tag and restarted talon:
$ cat ~/.talon/user/settings.talon
settings():
speech.record_all = 1
tag(): user.i3wm
tag(): user.javascript
Things seem to work now despite that warning, but I'm just slow at understanding how to use things :)
Should I close this or leave it open until the fix you referred to is merged?
I got another error after that one, but I think maybe users installing extensions the expected vscode way might not run into the error below where I don't have
command-server
.For context to understand how I run into it I'm installing vscode with nixos where I list out the extensions and only had
talon
,parse-tree
, andcursorless
.
I'm a bit surprised you have the talon
extension but not command-server
. The talon
extension bundles the command-server
extension
I'm still getting:
2022-02-03 17:10:05 WARNING actions: skipped because they have no matching declaration: (user.code_type_dictionary)
Yes, as you discovered, that warning isn't actually a problem. It's actually a knausj thing, so you might file that there
Even though I've enabled that tag and restarted talon:
$ cat ~/.talon/user/settings.talon settings(): speech.record_all = 1 tag(): user.i3wm tag(): user.javascript
You should remove that user.javascript
tag. Talon will automatically detect when you're in a javascript file and activate the user.javascript
tag for you
Should I close this or leave it open until the fix you referred to is merged?
Yeah I think we can close this one; Cursorless already does its best to handle this case using the current infrastructure, and it won't be a problem with the next version, which should be shipping soon
I am still getting this warning. In my Linux distribution (Arch) the settings paths are ~/.config/Code - OSS/User/settings.json
for the stable and ~/.config/Code - Insiders/User/settings.json
for the beta version. I guess this is not covered yet: https://github.com/cursorless-dev/cursorless/blob/main/cursorless-talon/src/marks/vscode_settings.py#L87-L94 . Despite the warning everything is working fine.
I'm also getting this warning on arch Linux, similarly as far as I can tell everything is working
Yeah maybe let's reopen, since this one is still an issue, even though it's not severe
I think probably the thing to do for now is to show a better error / warning, with an explanation and a link to this issue
Just to say that i had this error with latest talon beta and latest cursorless on a Ubuntu 22.04 and it was indeed due to the missing vscode setting file:
2023-05-10 12:23:01 IO Error finding color enablement; falling back to full enablement
2023-05-10 12:23:01 IO Traceback (most recent call last):
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 60, in vscode_get_setting_with_fallback
return actions.user.vscode_get_setting(key, default_value), False
2023-05-10 12:23:01 IO File "talon/scripting/actions.py", line 88, in __call__
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 34, in vscode_get_setting
path: Path = actions.user.vscode_settings_path()
2023-05-10 12:23:01 IO File "talon/scripting/actions.py", line 88, in __call__
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 91, in vscode_settings_path
return pick_path(
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 69, in pick_path
return max(existing_paths, key=lambda path: path.stat().st_mtime)
2023-05-10 12:23:01 IO ValueError: max() arg is an empty sequence
2023-05-10 12:23:01 IO Error finding shape enablement; falling back to full enablement
2023-05-10 12:23:01 IO Traceback (most recent call last):
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 60, in vscode_get_setting_with_fallback
return actions.user.vscode_get_setting(key, default_value), False
2023-05-10 12:23:01 IO File "talon/scripting/actions.py", line 88, in __call__
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 34, in vscode_get_setting
path: Path = actions.user.vscode_settings_path()
2023-05-10 12:23:01 IO File "talon/scripting/actions.py", line 88, in __call__
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 91, in vscode_settings_path
return pick_path(
2023-05-10 12:23:01 IO File "/home/user/.talon/user/cursorless-talon/src/apps/vscode_settings.py", line 69, in pick_path
return max(existing_paths, key=lambda path: path.stat().st_mtime)
2023-05-10 12:23:01 IO ValueError: max() arg is an empty sequence
2023-05-10 12:23:01 ERROR cb error topic="ready" cb=on_ready
11: lib/python3.9/threading.py:937* # loader thread
10: lib/python3.9/threading.py:980*
9: lib/python3.9/threading.py:917*
8: app/resources/loader.py:889|
7: app/resources/loader.py:835|
6: -----------------------------------------------------# [stack splice]
5: talon/scripting/dispatch.py:134| # 'ready' user.cursorless-talon.src.marks.mark:on_ready()
4: user/cursorless-talon/src/marks/mark.py:242| vscode_settings_path: Path = actions.u..
3: talon/scripting/actions.py:88 |
2: user/cursorless-talon/src/apps/vscode_settings.py:91 | return pick_path(
1: user/cursorless-talon/src/apps/vscode_settings.py:69 | return max(existing_paths, key=lambda path: path.stat().st_mtime)
ValueError: max() arg is an empty sequence
2023-05-10 12:23:02 DEBUG Dispatched launch events at 6.8212s, done at 11.5318s
2023-05-10 12:23:02 ERROR [!] 1 error(s) during startup (shown earlier in log)
The fix:
$ echo "{}" > ~/.config/Code/User/settings.json
I would be a bit careful with that fix, though, because the message can appear for one of two reasons:
@auscompgeek @AndreasArvidsson does that sound right?
Sounds right. In any case, opening the VSCode user settings JSON using the VSCode command and saving it would be the guaranteed correct way to create the settings file.
Yeah good call. Can just say "show settings json" with VSCode focused and then save it. Not sure if it automatically inserts a {}
, but can just say "inside braces" and then save if not
In case anyone else is using VS Code Insiders on a Mac, you will get this error as well, as src/apps/vscode_settings.py
does not check for the Insiders settings which are at Code - Insiders/User/settings.json
instead of Code/User/settings.json
Not sure if anything should be done about it officially, as Insiders is beta for a reason, but good to know that it's an easy manual fix.
Oh yeah that's a bug we should file and fix separately. should be super easy
Hi! I just helped a friend who's getting into coding set up Cursorless and fae ran into this same bug -- Talon wouldn't start up because cursorless-talon couldn't find settings.json
.
Changing a setting in VS Code created the file and fixed the problem, but I had to dig into cursorless-talon's source code a little to figure out what it was looking for, and guess that changing a setting would fix it.
It would be nice if you could add a quick note to the installation page making sure that users have changed a setting -- even just flipping the color scheme back and forth -- so other folks don't get caught on this.
@AndreasArvidsson I wonder if we could actually ensure the file is there automatically. Eg on Cursorless start-up the first time, just set and unset some dummy cursorless setting to make sure the file appears?
Or we could just gracefully handle that it doesn't exist?
The thing is we don't actually know that it doesn't exist, because there are several places it could be, including places we don't know about, as has happened before
That's not to say we shouldn't also gracefully handle it not existing, but ensuring it exists should help too
Sure. We can just toggle the Cursorless debug setting or something.
I guess we should check that toggling leaves an empty (or just {}
) file there. I would guess it does tho
Talon: v0.2.0-305-g968a (305) Knausj: 3e57e0165257cf07b0e21880d44a91e79cb3ef16 pokey/talon: 0.2.0 pokey/parse-tree: 0.14.0 pokey/cursorless: 0.25.271