Skip to content

Commit

Permalink
Pull changes from SammaySarkar
Browse files Browse the repository at this point in the history
  • Loading branch information
Binocular222 committed May 8, 2015
1 parent 50e8d80 commit 474158a
Show file tree
Hide file tree
Showing 29 changed files with 1,404 additions and 1,108 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/tmp/
*.bak
TODO.txt
test.xys
scratch
8 changes: 3 additions & 5 deletions Comments.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>//</string>
<string>// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/*</string>
<string>/* </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>*/</string>
<string> */</string>
</dict>
</array>
</dict>
<key>uuid</key>
<string>77AC23B6-8A90-11D9-BAA4-000A9584EC8X</string>
</dict>
</plist>
15 changes: 13 additions & 2 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[
{"keys": ["ctrl+enter"], "command": "contextual_help_xys", "context": [{"key": "selector", "operator": "equal", "operand": "source.xys"} ]},
]
{
"keys": ["ctrl+enter"],
"command": "contextual_help_xys",
"context":
[
{
"key": "selector",
"operator": "equal",
"operand": "source.xys"
}
]
}
]
14 changes: 7 additions & 7 deletions Icon (xys).tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.xys</string>
<key>settings</key>
<dict>
<key>icon</key>
<string>file_type_xys</string>
</dict>
<key>scope</key>
<string>source.xys</string>
<key>settings</key>
<dict>
<key>icon</key>
<string>file_type_xys</string>
</dict>
</dict>
</plist>
41 changes: 41 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[
{
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"id": "package-settings",
"children":
[
{
"caption": "XYplorer",
"children":
[
{
"command": "open_file",
"args": {"file": "${packages}/XYplorer/Xyplorer.sublime-settings"},
"caption": "Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/XYplorer/XYplorer.sublime-build"},
"caption": "Build Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/Xyplorer.sublime-settings"},
"caption": "Settings – User"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/XYplorer.sublime-build"},
"caption": " Build Settings – User"
}
]
}
]
}
]
}
]
78 changes: 45 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
XYplorer syntax for Sublime Text
================================
##XYplorer
*XYplorer support for Sublime Text*

Installation:
---
- Copy to \Sublime Text\Data\Packages\XYplorer
- Edit file path in XYplorer.sublime-settings and XYplorer.sublime-build
- This package applies to .xys, .inc, .xyi files
Alternative version: https://github.com/SammaySarkar/XYplorer

Contextual help:
---
- Place cursor on any xy-native function such as "replacelist()" > Ctrl+enter will open the corresponding reference in XYplorer help file
- Place cursor on any user-defined function such as "gpc()" > Ctrl+enter (or Goto > Go to definition) will jump to function definition
+ This open included file if necessary.
+ Require files, which contain the function, to be indexed:
+ setting "index_files": true,
+ files, which contain the function, are in a project (Project > Add folder to project => files appear in sidebar)
+ Place cursor on any CommandID such as "#101" > Ctrl+enter will display corresponding command text in statusbar
- ####INSTALL:
+ **With [Package Control](https://packagecontrol.io/)**
- open Command Palette (<kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>P</kbd>) and pick `Package Control: Add Repository`
- Enter `https://github.com/Binocular222/XYplorer/` as the Repository URL
- Now do `Package Control: Install Package`, search for and install `XYplorer`
+ **Without Package Control**
- Download this repo as [zip](https://github.com/Binocular222/XYplorer/archive/master.zip).
There will be a folder inside the zip. Extract and rename the folder to `XYplorer` and move to ` \Data\Packages\ ` .
- ALTERNATIVELY, and *only if running Sublime Text 3*, zip up *the contents* inside of that `XYplorer` folder,
rename the zip file to XYplorer.sublime-package and paste it to ` \Data\Installed Packages\ ` .

Snippet:
---
see tabTrigger in the *.sublime-snippet files: Typing these triggers and press Tab will insert a pre-defined script template. Example:

+ heredoc
+ nowdoc
+ nowdocalternative
+ feselitems: For each <selitems\>
+ foreach: For each $items\
+ function: Insert User defined function
- ####SETUP & USAGE:
+ open `Preferences > Package Settings > XYplorer > Settings - User`
+ and save the opened settings file with following content, using correct path to your XYplorer installation folder.
```js
{
"xypath": "P:\\ath\\to\\XYplorer"
}
```
+ Do the same with `Preferences > Package Settings > XYplorer > Build Settings - User` and this content.
```js
{
"cmd": ["P:\\ath\\to\\XYplorer\\XYplorer.exe", "", "/script=$file", "/flg=2"],
"selector": "source.xys"
}
```
+ the highlighter automatically activates in `*.xys, *.xyi, *.inc` files.
+ **Contextual help**
- CTRL+ENTER activates contextual help. Try it on native commands, Command IDs, control keywords, user-defined functions.
+ Native command or control structures: opens command help
+ Command IDs: associated menu caption is displayed in statusbar
+ UDFs: Go to Definition. (see UDF note below)
+ labels in **sub** and **load**: goto the label. (Work-In-Progress)
- UDF note: add include files to project to use Go to Definition with functions defined in those files.

Build:
---
+ Tool > Build (Ctrl+B) will execute current xys file in XYplorer
+ Doing `Tools > Build` will run the current script file in XYplorer.

Assign XYplorer icon to .xys files in sidebar:
---
+ Create an XYplorer icon in png format and save to \Data\Packages\Theme - Default\icons\file_type_xys.png
+ Filename must be file_type_xys.png because it's defined in "Icon (xys).tmPreferences"
+ **Tips**
- SubScripts, User-Defined Functions and Namespace declarations are listed in Symbols.
- To assign XYplorer icon to .xys files in sidebar:
- Create an XYplorer icon in png format and save to \Data\Packages\Theme - Default\icons\file_type_xys.png
- The filename must be file_type_xys.png because it's defined in "Icon (xys).tmPreferences"
- an example png icon is supplied with this package.

*Happy XYScripting!*
18 changes: 18 additions & 0 deletions Symbols_Hide.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- skip native commands as symbols, for a manageable symbol list. -->
<key>name</key>
<string>SymbolsHidden</string>
<key>scope</key>
<string>source.xys entity.name.function.xys, source.xys entity.name.function.CommandID.xys</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>0</integer>
<key>showInIndexedSymbolList</key>
<integer>0</integer>
</dict>
</dict>
</plist>
20 changes: 20 additions & 0 deletions Symbols_NameSpc.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- index UDFs -->
<key>name</key>
<string>SymbolsNS</string>
<key>scope</key>
<string>source.xys entity.name.section.xys</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string>/^(.*)$/\1 [namespace]/g</string> <!-- Convert to lower case -->
<key>showInIndexedSymbolList</key>
<string>0</string>
</dict>
</dict>
</plist>
20 changes: 20 additions & 0 deletions Symbols_SubScript.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- index labelled scripts -->
<key>name</key>
<string>SymbolsSubScript</string>
<key>scope</key>
<string>source.xys meta.class.scriptcaption.xys</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<!-- <key>symbolTransformation</key>
<string>/"(\w+)"/\1/g</string> --> <!-- extract caption or label -->
<key>showInIndexedSymbolList</key>
<integer>0</integer>
</dict>
</dict>
</plist>
11 changes: 6 additions & 5 deletions Symbols.tmPreferences → Symbols_UDF.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>uuid</key>
<string>01c3e1de-9b7a-4c7c-9d2a-117efacb2100</string>
<!-- index UDFs -->
<key>name</key>
<string>Record Symbols</string>
<string>SymbolsUDF</string>
<key>scope</key>
<string>source.xys meta.class.UDF.xys</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string>/(\w)/\L$1/g</string> <!-- Convert to lower case -->
<string>/(\w)/\L\1/g</string> <!-- Convert to lower case -->
<!-- <string>/^(\w+)$/\L\1 [function]/g</string> -->
<key>showInIndexedSymbolList</key>
<string>1</string>
<key>symbolIndexTransformation</key>
<string>/(\w)/\L$1/g</string>
<string>/(\w)/\L\1/g</string>
<!-- <string>/^(\w+)$/\L\1 [function]/g</string> -->
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion XYplorer.sublime-build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cmd": ["E:\\Utilities\\XYplorer\\XYplorer.exe", "", "/script=$file", "/flg=2"],
"cmd": ["C:\\Program Files\\XYplorer\\XYplorer.exe", "", "/script=$file", "/flg=2"],
"selector": "source.xys"
}
Loading

0 comments on commit 474158a

Please sign in to comment.