Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions RustEnhanced.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
// If `true`, displays diagnostic messages under the cursor in the status bar.
"rust_message_status_bar": false,

// The message to display when the syntax check is running.
"rust_message_status_bar_msg": "Rust check running",

// A list of chars that cycle through in the status bar to indicate progress.
"rust_message_status_bar_chars": [".", "..", "...", ".."],

// How often (ms) should the status bar text be updated when syntax checking.
"rust_message_status_bar_update_delay": 200,

// If your cargo project has several build targets, it's possible to specify mapping of
// source code filenames to the target names to enable syntax checking.
// "projects": {
Expand Down
24 changes: 17 additions & 7 deletions SyntaxCheckPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,23 @@ def run(self):
def update_status(self, count=0):
if self.done:
return
num = count % 4
if num == 3:
num = 1
num += 1
msg = 'Rust check running' + '.' * num
self.window.status_message(msg)
sublime.set_timeout(lambda: self.update_status(count + 1), 200)

status_msg = util.get_setting('rust_message_status_bar_msg')
status_chars = util.get_setting('rust_message_status_bar_chars')
status_update_delay = util.get_setting('rust_message_status_bar_update_delay')

try:
status_chars_len = len(status_chars)
num = count % status_chars_len
if num == status_chars_len - 1:
num = -1
num += 1

self.window.status_message(status_msg + status_chars[num])
sublime.set_timeout(lambda: self.update_status(count + 1), status_update_delay)
except Exception as e:
self.window.status_message('Error setting status text!')
log.critical(self.window, "An error occurred setting status text: " + str(e))

def get_rustc_messages(self):
"""Top-level entry point for generating messages for the given
Expand Down