Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion TailwindCSSAutocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ def get_completions(self, view, folder):
tw_plugin = self.find_node_module(folder, 'tailwindcss')

if tw is not None and tw_plugin is not None:
try:
bundle = sublime.load_resource('Packages/TailwindCSSAutocomplete/dist/bundle.js')
except:
# if this package is not installed via package control, we need to load the bundle locally
bundle = open(os.path.dirname(__file__) + '/dist/bundle.js', 'r', encoding="utf-8").read()

try:
script = 'var sublime={config:"' + tw + '",plugin:"' + tw_plugin + '"};'
script += sublime.load_resource('Packages/TailwindCSSAutocomplete/dist/bundle.js') + '\n'
script += bundle + '\n'
process = subprocess.Popen(
[view.settings().get('node_path', 'node')],
stdin = subprocess.PIPE,
Expand Down