-
Notifications
You must be signed in to change notification settings - Fork 6
/
Symbol List - Function.tmPreferences
74 lines (61 loc) · 1.95 KB
/
Symbol List - Function.tmPreferences
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<!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><![CDATA[
source.swift meta.entity.name.function,
source.swift meta.entity.name.init,
source.swift meta.entity.name.subscript
]]></string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
<key>showInIndexedReferenceList</key>
<integer>1</integer>
<!-- Tested with .swiftinterface files shipped with Swift version 5.6 -->
<key>symbolTransformation</key>
<string><![CDATA[
# Remove comments
s/\s*\/\/.*$//g
# Regularize spaces in advance
s/\n//g
s/^\s+//g
s/\s+/ /g
# Remove [], <Generics>, @attributes and return-arrow ->
s/\[.*?\]//g
s/<[<:&\.,\w\s`>\?\!\(\)]+?>//g
s/@\w+?\b\s?//g
s/->//g
# Remove attributes (e.g. inout)
s/:\s*\b\w+?\b/:/g
s/:\s*\b\w+?\b/:/g
s/:\s*\b\w+?\b/:/g
s/:\s*\b\w+?\b/:/g
# Remove inner parens (This might seem dumb but reliable)
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
s/^(.+)\s*\(.*?\)\s*(.+)$/\1\2/g
# Remove parameter type
s/:.+?,/:/g
s/(.+):.*?\)/\1:\)/g
# Remove local parameter-name: /label (label)/
s/(\w+)\s+?\w+:/\1:/g;
# Remove remaining comma
s/,//g
# Remove spaces
s/\s//g
# Add space after operator
s/^([^\w]+)\(/\1 \(/g
]]></string>
</dict>
</dict>
</plist>