Skip to content

Commit

Permalink
Merge pull request #212 from lushang/master
Browse files Browse the repository at this point in the history
bug fixing and refinements
  • Loading branch information
lushang authored Jan 13, 2021
2 parents 255ca63 + 0e428ae commit 3ee198c
Show file tree
Hide file tree
Showing 10 changed files with 894 additions and 546 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sublime IDE for Salesforce
This plugin supports [Sublime Text 3](http://www.sublimetext.com/3) for windows and OSX, not tested for Linux.
This plugin supports [Sublime Text 3](http://www.sublimetext.com/3) for windows and OSX, has not enough testing for Linux yet.

All of my motivation on this plugin come from your star, if you think this plugin is helpful in your daily work, please **star** this plugin.
All of our motivation on this plugin come from your star, if you think this plugin is helpful in your daily work, please **star** this plugin.

# Installation

Expand All @@ -14,7 +14,7 @@ Or, You can follow the step-by-step [instruction](https://meighanrockssf.wordpre
# Project Configuration
After you have installed this plugin successfully, you can follow <a href="/docs/project.md" target="_blank">Project Configuration</a> to configure your own project.

If you don't want to keep your user credential information in the plugin , you just need to do it as below format, plugin will lanuch the browser to start OAuth2 Login process,
If you don't want to keep your user credential information in the plugin , you just need to do it as below format, plugin will launch the browser to start OAuth2 Login process,
```javascript
"projects": {
"pro-sublime": {
Expand Down Expand Up @@ -64,6 +64,12 @@ If you don't want to keep your user credential information in the plugin , you j
> - [Salesforce oAuth2](https://github.com/neworganizing/salesforce-oauth2)
> - [SalesforceXyTools](https://github.com/exiahuang/SalesforceXyTools)
# Feedback & Contribution
Feel free to open issues, but you should refer to the <a href="/docs/issue.md" target="_blank">Raise Issue</a> before
reporting any bug.

well welcome to any contribution, open an issue for discussion before draft you code.

# Q&A
+ ``Refresh Package`` vs ``Update Project``
* ``Refresh Package`` can update the project by the ``package.xml`` in the project folder or ``project/src`` folder
Expand All @@ -78,7 +84,7 @@ If you don't want to keep your user credential information in the plugin , you j
* ``Deploy to Server`` is achieved by ``Metadata API`` tech, which is usually used to develop none-apex in sandbox, deploy any components into different org or production

+ What's the usage of ``Update Project Pattern`` command?
* Everytime when you udpate the ``file_exclude_patterns`` or ``folder_exclude_patterns``, you must execute ``Update Project Pattern`` command to ensure it is working.
* Everytime when you update the ``file_exclude_patterns`` or ``folder_exclude_patterns``, you must execute ``Update Project Pattern`` command to ensure it is working.
* Everytime when the default project doesn't appeared in the sidebar panel, you an use this command to show the default project.

+ If you failed to deploy package after release 3.3.7
Expand Down
17 changes: 9 additions & 8 deletions aura.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ def __init__(self, *args, **kwargs):
super(DestructLightningFromServer, self).__init__(*args, **kwargs)

def run(self, dirs):
if sublime.ok_cancel_dialog("This will Delete the whole folder both from the server and local!" +
" Confirm to continue?"):
_, bundle_name = os.path.split(dirs[0])
if sublime.ok_cancel_dialog("This will Delete %s !" % bundle_name + " Confirm to continue?"):
processor.handle_destructive_files(dirs, ignore_folder=False)

def is_visible(self, dirs):
if len(dirs) == 0: return False
if len(dirs) == 0:
return False
self.settings = context.get_settings()
for _dir in dirs:
attributes = util.get_file_attributes(_dir)
Expand All @@ -226,7 +227,7 @@ def run(self, dirs, element=""):
template = templates.get("AuraElement").get(element)
settings = context.get_settings()
templates_path = os.path.join(settings["workspace"],
".templates", template["directory"])
".templates", template["directory"])
with open(templates_path) as fp:
body = fp.read()

Expand Down Expand Up @@ -297,15 +298,15 @@ def __init__(self, *args, **kwargs):
def run(self, _type=""):
self._type = _type
self.window.show_input_panel("Please Input %s Name: " % _type,
"", self.on_input, None, None)
"", self.on_input, None, None)

def on_input(self, lightning_name):
# Create component to local according to user input
if not re.match('^[a-zA-Z]+\\w+$', lightning_name):
message = 'Invalid format, do you want to try again?'
if not sublime.ok_cancel_dialog(message): return
self.window.show_input_panel("Please Input %s Name: " % self._type,
"", self.on_input, None, None)
"", self.on_input, None, None)
return

# Get settings
Expand All @@ -326,10 +327,10 @@ def on_input(self, lightning_name):
message = "%s is already exist, do you want to try again?" % lightning_name
if not sublime.ok_cancel_dialog(message, "Try Again?"): return
self.window.show_input_panel("Please Input Lightning Name: ",
"", self.on_input, None, None)
"", self.on_input, None, None)
return

lightning_file = os.path.join(component_dir, lightning_name+template["extension"])
lightning_file = os.path.join(component_dir, lightning_name + template["extension"])

# Create Aura lightning file
with open(lightning_file, "w") as fp:
Expand Down
6 changes: 5 additions & 1 deletion completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ def load_sobject_cache(reload_cache=False, username=None):


class PackageCompletions(sublime_plugin.EventListener):
"""
Completions for Package.xml
"""
def on_query_completions(self, view, prefix, locations):
if not view.match_selector(locations[0], "text.xml"):
return []

# Check whether current file is package file
pattern = "<types>[\\s.*<>\\-\\w/\\%1-9]+</types>"
if not view.find_all(pattern): return
if not view.find_all(pattern):
return

location = locations[0]
pt = locations[0] - len(prefix) - 1
Expand Down
30 changes: 30 additions & 0 deletions docs/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Raise Issue

Create an [Issue][1] for following situations:
- Find a bug
- Have a good idea about any enhancement/new feature

### Report a Bug ###

For better investigation, you should include following message:

1. Title: a concise summary about the bug
2. Description about the bug
- Details with text description, provide screenshot if necessary.
- Steps to recur the bug.
- Any workaround you have tried.
3. Context information
- Operation System and version. e.g *Windows 10, version 1903*
- Sublime Test 3 version. e.g *Version 3.2.2 Build 3211*
- Your HaoIDE version. e.g *Build 3.6.0*
- Sublime Text 3 console log. You can press `Ctrl+~` to open the console panel.
- Your user settings if necessary.
- Any other necessary information.

### Propose an Enhancement or a New Feature

Just open an issue to discuss it!

If you want to contribute, also open an issue before draft the code!

[1]: https://github.com/xjsender/haoide/issues
3 changes: 2 additions & 1 deletion lwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def create_resource(self, js_file_name=None):
".templates", template["directory"])

extension = template["extension"]
element_name = (self.lwc_name if js_file_name is None else self.lwc_name + js_file_name) + extension
element_name = self.lwc_name if js_file_name is None else js_file_name
element_name += extension

# Combine lwc element component name
element_file = os.path.join(self._dir, element_name)
Expand Down
Loading

0 comments on commit 3ee198c

Please sign in to comment.