Skip to content

Commit

Permalink
release 3.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed Jul 27, 2015
1 parent 9951f8b commit 796df0b
Show file tree
Hide file tree
Showing 11 changed files with 697 additions and 12 deletions.
14 changes: 14 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Release History

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

Release 3.1.5 (2015-07-27)
++++++++++++++++++
* New Feature:
- Add bootstrap3 support for html class completion
- Add a new setting ``disable_bootstrap_completion`` to control bootstrap completion

* Update:
- Remove ``Metadata > Describe Metadata`` menu item in the main menu

* Fix Bug:
- Fix bug for running sync test for class with namespace or not
- Fix bug for ``get_file_attributes`` method


Release 3.1.4 (2015-07-25)
++++++++++++++++++
* Bug Fix:
Expand Down
25 changes: 25 additions & 0 deletions completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .salesforce.lib import apex
from .salesforce.lib import vf
from .salesforce.lib import html
from .salesforce.lib import bootstrap

from .salesforce.lib.panel import Printer

Expand Down Expand Up @@ -594,6 +595,19 @@ def on_query_completions(self, view, prefix, locations):
else:
completion_list.append((attr_name + "\tattr", attr_name+'="$1"$0'))

# ##########################################
# Bootstrap3 class name completions
##########################################
if not settings["disable_bootstrap_completion"]:
matched_attribute_regions = view.find_all('\w+="[\w\s]*"')
for mr in matched_attribute_regions:
if not mr.contains(pt): break
className = view.substr(mr).split("=")[0]
if className.lower() == "class":
for className in bootstrap.classes:
completion_list.append(("%s\tBootstrap3" % className, className))
break

# Sort the completion_list by first element
completion_list.sort(key=lambda tup:tup[1])

Expand Down Expand Up @@ -663,6 +677,17 @@ def on_query_completions(self, view, prefix, locations):
apex_class_completion = util.get_component_completion(username, "ApexPage")
completion_list.extend(apex_class_completion)

# 4. Bootstrap3 class name completions
if not settings["disable_bootstrap_completion"]:
matched_attribute_regions = view.find_all('\w+="[\w\s]*"')
for mr in matched_attribute_regions:
if not mr.contains(pt): break
className = view.substr(mr).split("=")[0]
if className.lower() == "class":
for className in bootstrap.classes:
completion_list.append(("%s\tBootstrap3" % className, className))
break

elif ch == ".":
if not view.file_name():
return completion_list
Expand Down
5 changes: 0 additions & 5 deletions config/menus/Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,6 @@

{ "caption": "-" },

{
"caption": "Describe Metadata",
"command": "describe_metadata"
},

{
"caption": "Reload Project Cache",
"command": "reload_project_cache"
Expand Down
16 changes: 16 additions & 0 deletions config/messages/3.1.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Build 3.1.5
-----------
Release Date: 27 July 2015

* New Feature:
- Add bootstrap3 support for html class completion
- Add a new setting ``disable_bootstrap_completion`` to control bootstrap completion

* Update:
- Remove ``Metadata > Describe Metadata`` menu item in the main menu

* Fix Bug:
- Fix bug for running sync test for class with namespace or not
- Fix bug for ``get_file_attributes`` method

* 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.4",
"version": "3.1.5",
"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
3 changes: 3 additions & 0 deletions config/settings/toolingapi.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@
// so this feature is disabled by default
"disable_html_completion": true,

// Flag to disable bootstrap3 completion
"disable_bootstrap_completion": false,

// Indicate whether keep history of execute_anonymous, query and run test to local ``.history`` path
"keep_operation_history" : true,

Expand Down
1 change: 1 addition & 0 deletions context.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def get_settings():
settings["disable_soql_field_completion"] = s.get("disable_soql_field_completion", False)
settings["display_field_name_and_label"] = s.get("display_field_name_and_label", True)
settings["disable_html_completion"] = s.get("disable_html_completion", True)
settings["disable_bootstrap_completion"] = s.get("disable_bootstrap_completion", False)
settings["disable_custom_component_completion"] = s.get("disable_custom_component_completion", False)
settings["disable_component_attribute_completion"] = s.get("disable_component_attribute_completion", False)
settings["disable_component_attribute_value_completion"] = s.get("disable_component_attribute_value_completion", False)
Expand Down
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ def run(self, edit):
"input": formatted_json
})

# If you have installed the htmljs plugin, below statement will work
view.run_command("htmlprettify")

class JsonSerialization(BaseSelection, sublime_plugin.TextCommand):
def run(self, edit):
try:
Expand Down Expand Up @@ -1209,8 +1206,9 @@ def is_enabled(self):
not self.component_attribute["is_test"]:
return False

if "namespacePrefix" in self.component_attribute:
self.cname = "%s.%s" % (
if "namespacePrefix" in self.component_attribute and \
self.component_attribute["namespacePrefix"]:
self.cname = "%s%s" % (
self.component_attribute["namespacePrefix"],
self.cname
)
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"3.1.2": "config/messages/3.1.2.md",
"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",
"install": "config/messages/install.txt"
}
Loading

0 comments on commit 796df0b

Please sign in to comment.