Skip to content

Don't return unconverted float completions for settings values - #455

Open
giampaolo wants to merge 1 commit into
SublimeText:masterfrom
giampaolo:settings-completion-str
Open

giampaolo wants to merge 1 commit into
SublimeText:masterfrom
giampaolo:settings-completion-str

Conversation

@giampaolo

Copy link
Copy Markdown

When editing a float setting in Preferences.sublime-settings, every keystroke prints this traceback in the console, and no value completions are shown:

Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python314/sublime_plugin.py", line 1000, in on_query_completions
    mlist.append(norm_res(callback(prefix, locations)))
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bad argument type for built-in operation

To reproduce it add "ui_scale": 1.0 to your settings and type 1 after the 1.. The list returned by SettingsListener.on_query_completions() contains this item, with a float instead of a str as completion, which makes ST reject the whole list:

CompletionItem('0.0', annotation='(default) ', completion=0.0, completion_format=<CompletionFormat.TEXT: 0>, kind=(<KindId.SNIPPET: 8>, 'f', 'float'), details='', flags=<CompletionItemFlags.NONE: 0>)

Seen on ST 4214 (dev) with Python 3.14.

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

Successfully merging this pull request may close these issues.

1 participant