Skip to content

Commit

Permalink
release v3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed Jul 30, 2015
1 parent 7119ed4 commit 5987261
Show file tree
Hide file tree
Showing 15 changed files with 257 additions and 42 deletions.
15 changes: 15 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Release History

---------------


Release 3.1.6 (2015-07-29)
++++++++++++++++++
* Bug fix:
- If controller name is same with page name, there will have problem when view code coverage
- Fix bug when file is loaded
- Fix issue #62
- Fix issue #63

* Enhancement:
- Deliver enhancement #64
- Deliver enhancement #65
- Deliver enhancement #66


Release 3.1.5 (2015-07-27)
++++++++++++++++++
* New Feature:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ All of my motivation on this plugin come from your star, if you think this plugi
# Quick Link
+ <a href="https://github.com/xjsender/SublimeApexScreenshot" target="_blank">All Demos</a>
+ <a href="/docs/project.md" target="_blank">Project Configuration</a>
+ <a href="/docs/executeAnonymous.md" target="_blank">Execute Anonymous</a>
+ <a href="/docs/debug.md" target="_blank">Execute Anonymous</a>
+ <a href="/docs/completion.md" target="_blank">Code AutoComplete</a>
+ <a href="/docs/snippets.md" target="_blank">Snippets</a>
+ <a href="/docs/tooling.md" target="_blank">Tooling Operation</a>
Expand Down
2 changes: 1 addition & 1 deletion completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def on_query_completions(self, view, prefix, locations):
if matched_region:
matched_tag = view.substr(matched_region)[1:]
tag_name = matched_tag.split(":")[1].strip()
return util.get_component_attributes(settings, tag_name)
completion_list = util.get_component_attributes(settings, tag_name)

##########################################
# HTML Element Attribute Completions
Expand Down
3 changes: 3 additions & 0 deletions config/keymap/Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
// Problem here, don't know why?
{"keys": ["ctrl+alt+t"], "command": "run_test"},

// Run sync tests
{"keys": ["alt+shift+y"], "command": "run_sync_tests"},

// Run sync test
{"keys": ["alt+shift+u"], "command": "run_sync_test"},

Expand Down
3 changes: 3 additions & 0 deletions config/keymap/Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
// Problem here, don't know why?
{"keys": ["super+alt+t"], "command": "run_test"},

// Run sync tests
{"keys": ["command+shift+y"], "command": "run_sync_tests"},

// Run sync test
{"keys": ["command+shift+u"], "command": "run_sync_test"},

Expand Down
3 changes: 3 additions & 0 deletions config/keymap/Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
// Problem here, don't know why?
{"keys": ["ctrl+alt+t"], "command": "run_test"},

// Run sync tests
{"keys": ["alt+shift+y"], "command": "run_sync_tests"},

// Run sync test
{"keys": ["alt+shift+u"], "command": "run_sync_test"},

Expand Down
10 changes: 10 additions & 0 deletions config/menus/Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@
"caption": "Update Project Patterns",
"command": "update_project_patterns"
},
{"caption": "-"},
{
"caption": "Update User Language",
"command": "update_user_language"
},
{
"caption": "Update User Password",
"command": "update_user_password"
}
]
},
Expand Down Expand Up @@ -197,6 +202,11 @@

{"caption": "-"},

{
"caption": "Run Tests",
"command": "run_sync_tests"
},

{
"caption": "Run Test",
"command": "run_one_test"
Expand Down
16 changes: 16 additions & 0 deletions config/messages/3.1.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Build 3.1.6
-----------
Release Date: 30 July 2015

* Bug fix:
- If controller name is same with page name, there will have problem when view code coverage
- Fix bug when file is loaded
- Fix issue #62
- Fix issue #63

* Enhancement:
- Deliver enhancement #64
- Deliver enhancement #65
- Deliver enhancement #66

* Restart your sublime when new version is installed
2 changes: 1 addition & 1 deletion config/settings/package.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HaoIDE",
"version": "3.1.5",
"version": "3.1.6",
"description": "HaoIDE is a Sublime Text 3 plugin for Salesforce and used for swift development on Force.com",
"author": "Hao Liu",
"email": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions events.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def on_load_async(self, view):
util.display_active_project(view)

# Add types settings for build_package_xml command
if view.file_name():
if view.file_name() != None:
cname = os.path.basename(view.file_name())
if "package.xml" in cname.lower():
if cname and "package.xml" in cname.lower():
with open(view.file_name(), "rb") as fp:
content = fp.read()
types = util.build_package_types(content)
Expand Down
146 changes: 137 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ def run(self, callback_options={}):
unsubscripted_items = []
for mo in self.metadata_objects:
if mo["xmlName"] in smo:
item = "%s[√] %s" % (" " * 8, mo["xmlName"])
item = "%s[√] %s" % (" " * 4, mo["xmlName"])
subscribed_items.append(item)
has_subscribed = True
else:
item = "%s[x] %s" % (" " * 8, mo["xmlName"])
item = "%s[x] %s" % (" " * 4, mo["xmlName"])
unsubscripted_items.append(item)
self.item_property[item] = mo["xmlName"]

Expand All @@ -257,7 +257,8 @@ def run(self, callback_options={}):
# Add subscribed ones and unsubscribed ones to list
self.items.extend(sorted(subscribed_items))
self.items.extend(sorted(unsubscripted_items))
self.window.show_quick_panel(self.items, self.on_done)
self.window.show_quick_panel(self.items, self.on_done,
sublime.MONOSPACE_FONT)

def on_done(self, index):
if index == -1:
Expand Down Expand Up @@ -496,18 +497,25 @@ class GotoComponentCommand(sublime_plugin.TextCommand):
the class file will be open, you can custom the bind key in mousemap path
"""

def run(self, edit, is_background=False):
def run(self, edit, is_background=False, allowed_folders=None):
sel = self.view.sel()[0]
sel_text = self.view.substr(self.view.word(sel.begin()))

settings = context.get_settings()
for ct in settings["subscribed_metadata_objects"]:
if "suffix" not in settings[ct]: continue
if "suffix" not in settings[ct]:
continue
suffix = settings[ct]["suffix"]
folder = settings[ct]["directoryName"]
target_file = settings["workspace"] + "/src/%s/%s.%s" % (folder, sel_text, suffix)
target_file = os.path.join(settings["workspace"] + \
"/src/%s/%s.%s" % (folder, sel_text, suffix)
)
if os.path.isfile(target_file):
self.view.window().open_file(target_file)
if allowed_folders:
if folder in allowed_folders:
self.view.window().open_file(target_file)
else:
self.view.window().open_file(target_file)

if is_background: self.view.window().focus_view(self.view)

Expand Down Expand Up @@ -542,8 +550,11 @@ def is_enabled(self):
if self.attributes["metadata_folder"] not in ["classes", "triggers"]:
return False


# Can't be Test Class
self.body = open(self.file_name, encoding="utf-8").read()
with open(self.file_name, encoding="utf-8") as fp:
self.body = fp.read()

if "@istest" in self.body.lower():
return False

Expand All @@ -556,7 +567,8 @@ def run(self, edit):

# Open the related code file
self.view.run_command("goto_component", {
"is_background": False
"is_background": False,
"allowed_folders": ["classes", "triggers"]
})

# Get the view of open code file
Expand Down Expand Up @@ -1190,6 +1202,91 @@ def __init__(self, *args, **kwargs):
def run(self):
pass

class RunSyncTests(sublime_plugin.WindowCommand):
def __init__(self, *args, **kwargs):
super(RunSyncTests, self).__init__(*args, **kwargs)

def run(self):
if not hasattr(self, "chosen_classes"):
self.chosen_classes = []

# Get all classes
self.classes_attr = util.populate_components("ApexClass")

selected_items = []
unselected_items = []
self.classmap = {}
for key, item in self.classes_attr.items():
if not item["is_test"]:
continue
if "namespacePrefix" in item and item["namespacePrefix"]:
cname = "%s.%s" % (
item["namespacePrefix"], item["name"]
)
else:
cname = item["name"]

classItem = "%s[%s] %s" % (
" " * 4,
"√" if cname in self.chosen_classes else "x",
cname
)
if cname in self.chosen_classes:
selected_items.append(classItem)
else:
unselected_items.append(classItem)
self.classmap[classItem] = cname

if not self.classmap:
return Printer.get('error').write("There is no available test class");

# Add `All` Item
allItem = "[%s] All" % (
"√" if self.chosen_classes else "x"
)
self.classmap[allItem] = "*"
self.items = [allItem]

# Add class items
selected_items = sorted(selected_items)
unselected_items = sorted(unselected_items)
self.items.extend(selected_items)
self.items.extend(unselected_items)

selected_index = 0
if hasattr(self, "index"):
selected_index = self.index

self.window.show_quick_panel(self.items, self.on_done,
sublime.MONOSPACE_FONT, selected_index)

def on_done(self, index):
if index == -1:
if self.chosen_classes:
processor.handle_run_sync_test(self.chosen_classes)
delattr(self, "chosen_classes")
return

self.index = index
chosen_item = self.items[index]
class_attr = self.classmap[chosen_item]

if class_attr == "*":
if len(self.chosen_classes) == len(self.items) - 1:
self.chosen_classes = []
else:
self.chosen_classes = []
for k, v in self.classmap.items():
self.chosen_classes.append(v)
else:
class_name = class_attr
if class_name in self.chosen_classes:
self.chosen_classes.remove(class_name)
else:
self.chosen_classes.append(class_name)

sublime.set_timeout_async(self.run, 10)

class RunSyncTest(sublime_plugin.TextCommand):
def run(self, edit):
processor.handle_run_sync_test([self.cname])
Expand Down Expand Up @@ -1768,6 +1865,37 @@ def on_choose(self, index):
def is_enabled(self):
return util.check_action_enabled()

class UpdateUserPassword(sublime_plugin.WindowCommand):
def __init__(self, *args, **kwargs):
super(UpdateUserPassword, self).__init__(*args, **kwargs)

def run(self):
self.users = processor.handle_populate_users("update_user_password")
if not self.users: return # Network Issue Cause
self.users_name = sorted(self.users.keys(), reverse=False)
self.window.show_quick_panel(self.users_name, self.on_done)

def on_done(self, index):
if index == -1: return

user_name = self.users_name[index]
self.user_id = self.users[user_name]

sublime.active_window().show_input_panel("Input New Password: ",
"", self.on_input, None, None)

def on_input(self, password):
if not re.match('[\s\S]{5,22}', password):
message = 'Invalid password, do you want to try again?'
if not sublime.ok_cancel_dialog(message, "Try Again?"): return
return sublime.active_window().show_input_panel("Input New Password: ",
"", self.on_input, None, None)

processor.handle_update_user_password(self.user_id, password)

def is_enabled(self):
return util.check_action_enabled()

class UpdateProjectPatternsCommand(sublime_plugin.WindowCommand):
def __init__(self, *args, **kwargs):
super(UpdateProjectPatternsCommand, self).__init__(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"3.1.3": "config/messages/3.1.3.md",
"3.1.4": "config/messages/3.1.4.md",
"3.1.5": "config/messages/3.1.5.md",
"3.1.6": "config/messages/3.1.6.md",
"install": "config/messages/install.txt"
}
Loading

1 comment on commit 5987261

@xjsender
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix issue #62 , #63 , Deliver enhancement for issue #64 , #65 , #66

Please sign in to comment.