Description
The "Swap Quotes" function, intended to switch a double-quoted string to a single-quoted string or vice versa, sometimes does nothing, but results in an error dumped to the console. (This does not always occur with every attempt to swap quotes -- sometimes it works. It is inconsistent.)
This is with Sublime Text v3.2.2, build 3211 (which states "no updates available") and BracketHighlighter v2.29.0 (believed to be the most recent version because Package Control says no updates are available).
This occurs in Ruby files (.rb suffix). I am just using the built-in Ruby support in Sublime Text 3, no additional plugins or packages. It seems to occur most-often when I attempt to swap the quotes of a string that is inside another string's interpolation. For example, in the following statement:
config.x.error_source = "#{ENV.fetch('HOSTNAME', "name-of-app")}-#{ENV.fetch('ENVIRONMENT', Rails.env)}"
attempting to swap the quotes of 'HOSTNAME', "name-of-app", or 'ENVIRONMENT' will all fail. This is true for both the single-quoted strings like 'HOSTNAME' as well as the double-quoted string "name-of-app".
Swap Quotes also sometimes fails on strings that are not part of another string's interpolation. For example, attempting to swap the outer double-quotes of the example string above for single-quotes does work on the first try (resulting in '#{ENV.fetch(\'HOSTNAME\', "name-of-app")}-#{ENV.fetch(\'ENVIRONMENT\', Rails.env)}', but attempting to then re-swap those single-quotes back to double-quotes also fails.
Support Info
- ST ver.: 3211
- Platform: osx
- Arch: x64
- Plugin ver.: 2.29.0
- Install via PC: True
- mdpopups ver.: 3.7.5
- backrefs ver.: Version could not be acquired!
- markdown ver.: 3.1.1
- pygments ver.: 2.1a0
- jinja2 ver.: 2.10.1
Steps to Reproduce Issue
- With a ruby file open, place the cursor inside a single-quoted string, especially one that is inside another string's interpolation.
- From the Tools menu, choose Packages --> BracketHighlighter --> Swap Quotes (or use your configured keyboard shortcut.
Expected Behavior
The single-quotes around the string should be replaced with double-quotes.
Actual Behavior
No visible change is made in the open file, but the following error sometimes appears on the Sublime Text console:
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1082, in run_
return self.run(edit, **args)
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 889, in run
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 895, in execute
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 400, in match
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 140, in init_match
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_core.py", line 127, in refresh_rules
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_rules.py", line 206, in load_rules
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_rules.py", line 257, in parse_bracket_definition
File "/Users/andyrusterholz/Library/Application Support/Sublime Text 3/Installed Packages/BracketHighlighter.sublime-package/bh_logging.py", line 19, in debug
AttributeError: 'NoneType' object has no attribute 'load_settings'```
Description
The "Swap Quotes" function, intended to switch a double-quoted string to a single-quoted string or vice versa, sometimes does nothing, but results in an error dumped to the console. (This does not always occur with every attempt to swap quotes -- sometimes it works. It is inconsistent.)
This is with Sublime Text v3.2.2, build 3211 (which states "no updates available") and BracketHighlighter v2.29.0 (believed to be the most recent version because Package Control says no updates are available).
This occurs in Ruby files (.rb suffix). I am just using the built-in Ruby support in Sublime Text 3, no additional plugins or packages. It seems to occur most-often when I attempt to swap the quotes of a string that is inside another string's interpolation. For example, in the following statement:
config.x.error_source = "#{ENV.fetch('HOSTNAME', "name-of-app")}-#{ENV.fetch('ENVIRONMENT', Rails.env)}"attempting to swap the quotes of
'HOSTNAME',"name-of-app", or'ENVIRONMENT'will all fail. This is true for both the single-quoted strings like'HOSTNAME'as well as the double-quoted string"name-of-app".Swap Quotes also sometimes fails on strings that are not part of another string's interpolation. For example, attempting to swap the outer double-quotes of the example string above for single-quotes does work on the first try (resulting in
'#{ENV.fetch(\'HOSTNAME\', "name-of-app")}-#{ENV.fetch(\'ENVIRONMENT\', Rails.env)}', but attempting to then re-swap those single-quotes back to double-quotes also fails.Support Info
Steps to Reproduce Issue
Expected Behavior
The single-quotes around the string should be replaced with double-quotes.
Actual Behavior
No visible change is made in the open file, but the following error sometimes appears on the Sublime Text console: