Skip to content

Instantly share code, notes, and snippets.

@OdatNurd
Created February 22, 2017 04:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OdatNurd/57c1b2ccdb5fb656b4d334a6063e06e0 to your computer and use it in GitHub Desktop.
Save OdatNurd/57c1b2ccdb5fb656b4d334a6063e06e0 to your computer and use it in GitHub Desktop.
Goto Definition and symbols containing a period
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- lang
scope: source.lang
contexts:
main:
- match: '//'
scope: punctuation.definition.comment.lang
push: line_comment
- match: '([\w.]+):{'
captures:
1: entity.name.function
- match: '([\w.]+)(\[)'
captures:
1: support.function.call
line_comment:
- meta_scope: comment.line.lang
- match: $
pop: true
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>source.lang entity.name.function</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
// Function 1
function.name1:{}
// Function 2
function.name2:{}
// Function 3
function.name3:{}
// Function 4
function.name4:{}
// Function 4
function.name5:{}
.namespace.function:{}
function.name1[]
function.name2[]
function.name3[]
function.name4[]
function.name5[]
.namespace.function[]
@OdatNurd
Copy link
Author

As defined, the goto definition code will not work with this syntax unless you select the entirety of the symbol before invoking it. This is because the method symbol_at_point in Packages\Default\symbol.py is hard coded to assume various word characters (instead of pulling them from a setting or some such).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment