Something to note is that the cancelCompletion
setting here stops the autocomplete panel from opening up automatically, but completions are still available; you can press Tab to insert the best completion or cycle between them, or you can can press Ctrl+Space (or Alt+/ on Linux) to open the panel manually):
That said, it’s possible to try the change out locally if you want to. The reason you don’t see the file that you’re looking for is that the packages that ship with Sublime are stored as packed packages in a location outside of the Data
directory, since they’re common to all users on the machine that use Sublime.
The easiest way to effect the change is:
- Install PackageResourceViewer if you don’t already have it installed
- Open the command palette and enter
prvo
and select the PackageResourceViewer: Open Resource
command
- Select
Lua
(the package), then Completion Rules.tmPreferences
(the file)
That will open the file and show you the following:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.lua</string>
<key>settings</key>
<dict>
<key>cancelCompletion</key>
<string>^.*\b(then|end|do|else)$</string>
</dict>
</dict>
</plist>
You want to either erase the inner parts of the settings
dict to remove that setting completely, or if you prefer you can modify the setting to some other regular expression (depending on your testing, etc). An example of the former is:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.lua</string>
<key>settings</key>
<dict>
</dict>
</dict>
</plist>
Once you make the change, save the file. That will create an override
that makes your edited version of the file be usef instead of the one that ships with Sublime. As soon as you save the file the changes will be reloaded, so it should start working for you right away.
What this is doing is creating a folder named Lua
(named after the package) in your Packages
folder, then storing your modified version of the file there.
This override
will remain in effect as long as that file is there, including if you upgrade or reinstall Sublime. If an official fix is made, you’ll want to remove your modified version of the file so that it stops blocking the packed version. The OverrideAudit package will give you a warning if the underlying package is updated so that you can verify if you still need your change or not.