Skip to content

Commit

Permalink
release 2.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed May 22, 2015
1 parent e2be302 commit 9fef53e
Show file tree
Hide file tree
Showing 13 changed files with 253 additions and 40 deletions.
24 changes: 24 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ Release History
---------------


Release 2.9.7 (2015-05-22)
++++++++++++++++++
* Bug Fix:
- Fix issue #36
- Fix bug for ``childXmlNames`` parsing and ``childXmlNames`` completion for package.xml
- Fix bug for timeout exception message for ``query`` method in ``tooling.py``
- Fix NoneType exception for automatic extension or controller creation if current view is not local file
- Tag plugin fix a bug for that tag name contains colon, `see tag issue https://github.com/titoBouzout/Tag/issues/79`_

* Enhancement:
- Enhancement for attribute completion in visualforce page, if attribute value is already exist, it will not insert ``=""`` or ``="{!}"`` again
- Enhancement for ``standardController`` sObject name completion in visualforce page, it will just work when attribute is ``standardController``
- Add custom class completion for ``extension`` and ``controller`` attribute in visualforce page
- Add values completion for some attributes of standard components which type should be picklist, for example, "apiVersion", "layout", "event" or "target" for link and so on, in this time I just updated to apex:composition, I will check the remaining standard component
- Add two missed standard component into ``vf.py``, "apex:component" and "apex:componentBody"
- Add custom page completion for these four attributes: "page", "template", "pageName", "finishLocation", for example, if you input <apex:include, pageName="", you can get custom page completion in the "" for pageName attribute

* New:
- Add commands in command palette for ``reload_project_cache`` and ``build_package_xml``

* Update:
- Update snippet ``Controller - add message in vf.sublime-snippet``


Release 2.9.6 (2015-05-20)
++++++++++++++++++
* Bug Fix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sublime IDE for Salesforce
This plugin supports ```Sublime Text 3``` for windows and OSX, not tested for Linux.
This plugin supports [Sublime Text 3](http://www.sublimetext.com/3) for windows and OSX, not tested for Linux.

# Installation
You can install this plugin by searching ``haoide`` in package control, if you don't know how to use ``package control``, you can refer to [usage of package control](https://packagecontrol.io/docs/usage).
Expand Down
52 changes: 34 additions & 18 deletions completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,20 @@ def on_query_completions(self, view, prefix, locations):
# <name></name> completion
full_line = view.full_line(pt)
if "<name>" in view.substr(full_line):
for component in metadata_objects:
display = "%s\t%s" % (component["xmlName"], "Metadata Type")
completion_list.append((display, component["xmlName"]))
for mo in metadata_objects:
display = "%s\t%s" % (mo["xmlName"], "Metadata Type")
completion_list.append((display, mo["xmlName"]))

# Component Child
if "childXmlNames" in component:
for child in component["childXmlNames"]:
display = "%s\t%s" % (child, component["xmlName"])
if "childXmlNames" in mo:
childXmlNames = mo["childXmlNames"]
if isinstance(childXmlNames, str):
childXmlNames = [childXmlNames]

for child in childXmlNames:
display = "%s\t%s" % (child, mo["xmlName"])
completion_list.append((display, child))

return completion_list

# <members></members> completion
Expand All @@ -65,18 +70,11 @@ def on_query_completions(self, view, prefix, locations):
if not matched_region: return []
matched_content = view.substr(matched_region)
meta_type = matched_content[6:-7].strip()

# Get the _dir, for example: <workspace>/src/classes
if meta_type not in settings: return []
folder = settings[meta_type]["directoryName"]
_type = settings[meta_type]["xmlName"]
_dir = os.path.join(settings["workspace"], "src", folder)

# List all members in `.config/package.json`
if meta_type in package_cache:
for member in package_cache[meta_type]:
completion_list.append(("%s\t%s" % (member, meta_type), member))
return completion_list

return (completion_list, sublime.INHIBIT_WORD_COMPLETIONS or sublime.INHIBIT_EXPLICIT_COMPLETIONS)

Expand Down Expand Up @@ -421,6 +419,11 @@ def on_query_completions(self, view, prefix, locations):
# Get the begin point of current line
cursor_row, cursor_col = view.rowcol(pt)

# Get the two chars after course point
# If these two chars is '="', it means attribute value is already exist
# we will not add ="{!}" or ="" for this attribute
forward_two_chars = view.substr(sublime.Region(pt + 2, pt + 4))

# Get all matched regions
matched_regions = view.find_all("<\\w+:\\w+")

Expand All @@ -445,7 +448,7 @@ def on_query_completions(self, view, prefix, locations):
if matched_tag in vf.tag_defs:
def_entry = vf.tag_defs[matched_tag]
for key, value in def_entry['attribs'].items():
if "values" in value:
if "values" in value or forward_two_chars == '="':
completion_list.append((key + '\t' + value['type'], key))
else:
if value["type"] in ["Object", "ApexPages.Action"]:
Expand Down Expand Up @@ -541,12 +544,25 @@ def on_query_completions(self, view, prefix, locations):
completion_list.sort(key=lambda tup:tup[1])

elif ch == '"':
# 1. sObject completion for standardController
pattern = "<\\w+:\\w+\\s+standardController=\"\\w+\""
matched_region = view.find(pattern, begin, sublime.IGNORECASE)
if not matched_region: return completion_list # If not match, just return
for key in sorted(sobjects_describe.keys()):
sobject_name = sobjects_describe[key]["name"]
completion_list.append((sobject_name + "\tSobject", sobject_name))
if matched_region and matched_region.contains(pt):
for key in sorted(sobjects_describe.keys()):
sobject_name = sobjects_describe[key]["name"]
completion_list.append((sobject_name + "\tSobject", sobject_name))

# 2. Custom class completion for extension or controller
matched_region = view.find('(controller="\\w+"|extensions="\\w+")', begin)
if matched_region and matched_region.contains(pt):
apex_class_completion = util.get_component_completion(username, "ApexClass")
completion_list.extend(apex_class_completion)

# 3. Add page completion
attr_name = variable_name
if attr_name in vf.page_reference_attrs:
apex_class_completion = util.get_component_completion(username, "ApexPage")
completion_list.extend(apex_class_completion)

elif ch == ".":
if not view.file_name(): return completion_list
Expand Down
22 changes: 16 additions & 6 deletions config/commands/main.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
}
},

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

{
"caption": "HaoIDE: New Project",
"command": "describe_metadata",
Expand Down Expand Up @@ -176,7 +171,22 @@
"args": {
"retrieve_all": false
}
},
},

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

{
"caption": "HaoIDE: Reload Project Cache",
"command": "reload_project_cache"
},

{
"caption": "HaoIDE: Build Package Xml",
"command": "build_package_xml"
},

{
"caption": "HaoIDE: Utitlities > Convert 15 Digit Id to 18 Digit",
Expand Down
1 change: 1 addition & 0 deletions config/messages/2.9.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release Date: 20 May 2015

* Bug Fix:
- Fix issue #33
- Fix issue #35

* Enhancement:
- Add required check for XML utilities
Expand Down
28 changes: 28 additions & 0 deletions config/messages/2.9.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Build 2.9.7
-----------
Release Date: 22 May 2015

* Bug Fix:
- Fix issue #36
- Fix bug for ``childXmlNames`` parsing and ``childXmlNames`` completion for package.xml
- Fix bug for timeout exception message for ``query`` method in ``tooling.py``
- Fix NoneType exception for automatic extension or controller creation if current view is not local file
- Tag plugin fix a bug for that tag name contains colon, `see tag issue https://github.com/titoBouzout/Tag/issues/79`_

* Enhancement for visualforce page completion:
- Enhancement for attribute completion in visualforce page, if attribute value is already exist, it will not insert ``=""`` or ``="{!}"`` again
- Enhancement for ``standardController`` sObject name completion in visualforce page, it will just work when attribute is ``standardController``
- Add custom class completion for ``extension`` and ``controller`` attribute in visualforce page
- Add values completion for some attributes of standard components which type should be picklist, for example, "apiVersion", "layout", "event" or "target" for link and so on, in this time I just updated to apex:composition, I will check the remaining standard component
- Add two missed standard component into ``vf.py``, "apex:component" and "apex:componentBody"
- Add custom page completion for these four attributes: "page", "template", "pageName", "finishLocation", for example, if you input ``<apex:include, pageName=""``, you can get custom page completion in the "" for pageName attribute

* New:
- Add commands in command palette for ``reload_project_cache`` and ``build_package_xml``

* Update:
- Update snippet ``Controller - add message in vf.sublime-snippet``

* Notes:
- You should restart your sublime after ``HaoIDE`` is upgraded
-----------
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": "2.9.6",
"version": "2.9.7",
"description": "HaoIDE is a Sublime Text 3 plugin for Salesforce and used for swift development on Force.com",
"author": "Hao Liu",
"email": "mouse.mliu@gmail.com",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<snippet>
<content><![CDATA[
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.${1:INFO-ERROR-CONFIRM-WARNING-FATAL},
${2:MESSAGE}));
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.${1:INFO-ERROR-CONFIRM-WARNING-FATAL}, ${2:MESSAGE}));
]]></content>
<tabTrigger>pm</tabTrigger>
<scope>source.java, source.apex</scope>
Expand Down
2 changes: 1 addition & 1 deletion context.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def build_metadata_objects_settings(settings, metadata_objects):
if isinstance(childXmlNames, str):
childXmlNames = [childXmlNames]

for child in mo["childXmlNames"]:
for child in childXmlNames:
settings[child] = mo

return settings
5 changes: 3 additions & 2 deletions events.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def on_query_completions(self, view, prefix, locations):
location = locations[0]
pt = locations[0] - len(prefix) - 1
ch = view.substr(sublime.Region(pt, pt + 1))

if ch != "#": return

# If char is not # or current view is not file, just skip
if ch != "#" or not view.file_name(): return

begin = view.full_line(pt).begin()
matched_region = view.find('(controller="\\w+#"|extensions="\\w+#")', begin)
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"2.9.4": "config/messages/2.9.4.md",
"2.9.5": "config/messages/2.9.5.md",
"2.9.6": "config/messages/2.9.6.md",
"2.9.7": "config/messages/2.9.7.md",
"install": "config/messages/install.txt"
}
2 changes: 1 addition & 1 deletion salesforce/api/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def query(self, soql, is_toolingapi=False, timeout=120):
headers=self.headers, timeout=timeout)
except requests.exceptions.RequestException as e:
self.result = {
"Error Message": "Network connection timeout when issuing QUICK SEARCH request",
"Error Message": "Network connection timeout when issuing QUERY request",
"success": False
}
return self.result
Expand Down
Loading

0 comments on commit 9fef53e

Please sign in to comment.