-
Notifications
You must be signed in to change notification settings - Fork 6
/
gn.test.data.ts
142 lines (136 loc) · 3.31 KB
/
gn.test.data.ts
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import * as ls from 'vscode-languageserver/node'
export interface TestDocumentSymbol {
name: string
kind: ls.SymbolKind
children?: TestDocumentSymbol[]
}
export interface TestAnalyzeResultType {
location: string
root: string
token: {
type: string
value: string
range: {
begin: string
end: string
}
}
function: {
name: string
arguments: string[]
}
variable: string
}
//simple_build/BUILD.gn
export const rootGNAnalyzeResult: TestAnalyzeResultType[] = [
{
// ':hello_static' in executable('hello')
location: '10:10',
root: 'addon/gn/examples/simple_build',
token: {type: 'literal', value: '":hello_static"', range: {begin: '10:5', end: '10:20'}},
function: {name: 'executable', arguments: ['"hello"']},
variable: 'deps',
},
{
// 'HELLO_SHARED_IMPLEMENTATION' in shared_library('hello_shared')
location: '20:33',
root: 'addon/gn/examples/simple_build',
token: {
type: 'literal',
value: '"HELLO_SHARED_IMPLEMENTATION"',
range: {begin: '20:15', end: '20:44'},
},
function: {name: 'shared_library', arguments: ['"hello_shared"']},
variable: 'defines',
},
{
// 'hello_static.cc' in static_library('hello_static')
location: '25:13',
root: 'addon/gn/examples/simple_build',
token: {
type: 'literal',
value: '"hello_static.cc"',
range: {begin: '25:5', end: '25:22'},
},
function: {name: 'static_library', arguments: ['"hello_static"']},
variable: 'sources',
},
]
//simple_build/build/BUILD.gn
export const rootGNBuildDocumentSymbolResult: TestDocumentSymbol[] = [
{
name: 'config("compiler_defaults")',
kind: ls.SymbolKind.Function,
children: [
{
name: 'current_os=="linux"',
kind: ls.SymbolKind.Boolean,
children: [
{
name: 'cflags',
kind: ls.SymbolKind.Variable,
},
],
},
],
},
{
name: 'config("executable_ldconfig")',
kind: ls.SymbolKind.Function,
children: [
{
name: '!is_mac',
kind: ls.SymbolKind.Boolean,
children: [
{
name: 'ldflags',
kind: ls.SymbolKind.Variable,
},
],
},
],
},
]
//simple_build/build/toolchain/BUILD.gn
export const toolchainGNAnalyzeResult: TestAnalyzeResultType[] = [
{
location: '42:32',
root: 'addon/gn/examples/simple_build',
token: {
type: 'literal',
value: '"-Wl,-soname=$soname"',
range: {begin: '42:28', end: '42:49'},
},
function: {name: 'tool', arguments: ['"solink"']},
variable: 'os_specific_option',
},
]
//simple_build/build/toolchain/BUILD.gn
export const toolchainGNPartialDocumentSymbolResult: TestDocumentSymbol = {
name: 'toolchain("gcc")',
kind: ls.SymbolKind.Function,
children: [
{
name: 'tool("solink")',
kind: ls.SymbolKind.Function,
children: [
{
name: 'is_mac',
kind: ls.SymbolKind.Boolean,
children: [
{
name: 'else',
kind: ls.SymbolKind.Operator,
children: [
{
name: 'os_specific_option',
kind: ls.SymbolKind.Variable,
},
],
},
],
},
],
},
],
}