forked from niosus/EasyClangComplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EasyClangComplete.sublime-settings
232 lines (198 loc) · 9.37 KB
/
EasyClangComplete.sublime-settings
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
{
// SETTINGS FOR EASY_CLANG_COMPLETE.
// Every path variable in settings can contain wildcards (without the "").
// Most commonly used:
// - "$project_path" <-- replaced by the full path to the project to
// which the currently opened view belongs.
// - "$project_name" <-- replaced by the name of the current project.
// - "$clang_version" <-- replaced by the numeric version of used clang.
// - "~" <-- replaced by the path to user home directory.
// - "*" <-- and other glob wildcards available everywhere.
//
// In addition to these, you can use your environment variables:
// - OSX and Linux: $variable_name or ${variable_name}
// - Windows: $variable_name or ${variable_name} or %variable_name%
//
// Last but not least, you can use *any* Sublime Text variables defined here:
// https://www.sublimetext.com/docs/3/build_systems.html#variables
// Specify common flags that will be passed to clang for EVERY build.
"common_flags" : [
// some example includes
"-I/usr/include",
"-I$project_path/src",
// this is needed to include the correct headers for clang
"-I/usr/lib/clang/$clang_version/include",
// For simple projects, you can add a folder where your current file is
"-I$file_path",
],
// Language-specific flags. Prepend common_flags for files of given language.
// When adapting to your needs, make sure to keep all language keys.
"lang_flags": {
"C": ["-std=c11"],
"CPP": ["-std=c++11"],
"OBJECTIVE_C": ["-std=c11"],
"OBJECTIVE_CPP": ["-std=c++11"],
},
// Define how we search needed flags. Prioritized from top to bottom.
// Possible entries for "file":
// - "CMakeLists.txt"
// - "compile_commands.json"
// - ".clang_complete"
//
// Every entry has an option:
// - "search_in": <path> <-- a path to the folder[s] containing the file.
//
// "cmake" entry has additional options:
// - "flags": [<flags>] <-- Additional flags to pass to cmake.
// - "prefix_paths": [<paths>] <-- array of folders that should be
// appended to CMAKE_PREFIX_PATHS before
// cmake is run.
"flags_sources": [
{"file": "CMakeLists.txt"},
{"file": "compile_commands.json"},
{"file": "CppProperties.json"},
{"file": "c_cpp_properties.json"},
{"file": ".clang_complete"},
],
// When getting flags from a compile_commands.json file defer parsing these
// flags to the time when they are actually needed. This enables much faster
// database loading and allows to work with huge compilation database files.
// The downside is that there is no fallback option, so if your file is not in
// the compilation database it will have no flags.
"lazy_flag_parsing": true,
// Show compile errors on file save or not.
"show_errors": true,
// Show gutter icon for highlighted errors on the side bar.
// Possible styles: "color", "mono", "dot", "none"
"gutter_style": "color",
// Pick style of error line highlighting
// - "outline" : outline regions
// - "fill" : fill regions
// - "solid_underline" : draw a solid underline below regions
// - "stippled_underline" : draw a stippled underline below regions
// - "squiggly_underline" : draw a squiggly underline below regions
// - "none" : do not draw anything on error lines
"linter_mark_style": "outline",
// Maximum width and height for popups eg. declaration info.
"popup_maximum_width": 1800,
"popup_maximum_height": 800,
// Triggers for auto-completion
"triggers" : [ ".", "->", "::", " ", " ", "(", "[" ],
// A dictionary that defines a mapping from language to an array of valid
// syntaxes for it. The values here are good defaults, but feel free to
// customize the list to your liking. When modifying this setting make sure
// that all 4 languages have values.
"valid_lang_syntaxes": {
"C": ["C", "C Improved", "C99"],
"CPP": ["C++", "C++11"],
"OBJECTIVE_C": ["Objective-C"],
"OBJECTIVE_CPP": ["Objective-C++"]
},
// Do not run the plugin for any files that match these paths. Use
// glob/fnmatch shell-style filename expansion. In addition, you can still use
// '~' to mark the home directory.
"ignore_list": [
"~/some_folder/*",
"/some/absolute/file.ext",
"$project_path/some/project/path/*",
],
// Use libclang.
// If set to false will use clang_binary and parse the output of
// `clang_binary -Xclang -code-complete-at...` instead.
"use_libclang" : true,
// Use default includes that we get from running the command:
// `clang_binary -c /tmp/test.cc -v`
"use_default_includes": true,
// Use default -D definitions that we can get by running the command:
// `clang_binary -c /tmp/test.cc -dM -E`
"use_default_definitions": true,
// Make the plugin verbose:
"verbose" : false,
// Pick the clang binary used by the plugin. This is used to determine the
// version of the plugin and pick correct libclang bindings. Note that this
// should either be a full path to the binary or it should be available in
// your PATH.
"clang_binary" : "clang++",
// Pick the binary used for cmake. Please make sure the binary you provide is
// accessible from the command line on your system. Note that this should
// either be a full path to the binary or it should be available in your PATH.
"cmake_binary" : "cmake",
// Ignore triggers and try to complete after each character.
// WARNING: can be very slow
"autocomplete_all" : false,
// Hide the completions generated by other plugins.
"hide_default_completions": false,
// Plugin uses smart caching to not load the data more times than needed.
// Remove cache data older than specified time. Minimum value is 30 seconds.
// Format: <hours>:<minutes>:<seconds>: "HH:MM:SS".
"max_cache_age": "00:30:00",
// Show additional information on hover over function call/variable etc.
// This replaces default sublime on hover behaviour
"show_type_info": true,
// Show body of struct/class/typedef declaration.
"show_type_body" : true,
// We only can get declarations from clang AST. This will show references to
// the symbol under cursor taking them from Sublime Text index.
"show_index_references": true,
// If the libclang library cannot be found in standard places, the user can
// provide a path to `libclang`. This path can either be a full path to the
// libclang library, e.g. `/usr/lib/libclang.so` or a folder that contains
// libclang library, e.g. `/usr/lib/`. This setting generally should not be
// needed.
"libclang_path": "<some_path_here>",
// Pick the progress style. There are currently these styles available:
// - "ColorSublime" : '⣾⣽⣻⢿⡿⣟⣯⣷'
// - "Moon" : '🌑🌒🌓🌔🌕🌖🌗🌘'
// - "None"
"progress_style": "Moon",
// Controls if libclang will cache the results.
// This works faster, but in rare cases can generate wrong completions.
"use_libclang_caching": true,
// Templates to find source files for headers in case we use a
// compilation database: Such a DB does not contain the required
// compile flags for header files. In order to find a best matching
// source file instead, you can use templates. Such templates describe how
// to find (relative to the header file) a source file which we can
// use to get compile flags for.
// In the simplest case, one can just use the (relative) path to where
// the source files are relative to your header file. For example, if
// your headers are in a subdirectory "inc" and your sources in a
// subdirectory "src" next to the first one, then you can use
// "../src/" as lookup.
// If needed, you can also use finer granular lookup templates by using
// UNIX style globbing patterns and placeholders. Placeholders are of the
// form '{placeholdername}'. The following placeholders can be used:
// - basename: The base file name without the directory part.
// - stamp: Like "basename", but with the file name extension removed.
// - ext: The file name extension of the header file.
"header_to_source_mapping": [
// Look for related files in the header's directory:
"./",
// And in the "src" directory:
"../src/",
// And in the "source" directory:
"../source/",
// Example: Use flags but only from the source file
// belonging to the header in question:
// "{stamp}.cpp",
// Example: Use flags from a file with an
// "exotic" file name suffix:
// "{stamp}.mycustomext
],
// Controls if we try to retrieve built-in flags from a target compiler. This
// option is used when we use a `compile_commands.json` file either directly or
// indirectly e.g. via CMake. If a compiler is not `null`, we try to ask it for
// the defines and include paths it sets implicitly and pass them to the clang
// compiler which is used to generate the code completion. If your completions
// require the knowledge about the toolchain, this option should improve the
// quality of the completions, however, in some corner cases it might cause
// completions to fail entirely.
"target_compilers": {
"C": null,
"CPP": null,
"OBJECTIVE_C": null,
"OBJECTIVE_CPP": null
},
// If true, on Windows, the paths will have a '/' too.
"force_unix_includes": true,
}