You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have two settings sections. 'clang' for c files, and 'clang++' to configure the linter for c++ files. E.g.
25
23
26
-
|Setting|Description|
27
-
|:------|:----------|
28
-
|include_dirs|A list of directories to be added to the header search paths (-I is not needed).|
29
-
|extra_flags|A string with extra flags to pass to clang. These should be used carefully, as they may cause linting to fail.|
30
-
31
-
In project-specific settings, SublimeLinter allows [expansion variables](http://sublimelinter.readthedocs.io/en/latest/settings.html#settings-expansion). For example, in project-specific settings, '${project_path}' can be used to specify a path relative to the project folder.
32
24
```
33
-
"SublimeLinter":
34
25
{
35
26
"linters":
36
27
{
37
28
"clang": {
38
-
"extra_flags": "-Wall -I${project_path}/foo",
39
-
"include_dirs": [
40
-
"${project_path}/3rdparty/bar/include",
41
-
"${project_path}/3rdparty/baz"
29
+
"args": "-fvery-important",
30
+
"I": [
31
+
"${folder}/3rdparty/bar/include",
32
+
"${folder}/3rdparty/baz"
42
33
]
34
+
},
35
+
"clang++": {
36
+
"args": "-falso-important"
43
37
}
44
38
}
45
39
},
46
40
```
47
41
42
+
Note: 'args' has the default value '-Wall -fsyntax-only -fno-caret-diagnostics', so make sure to include them when overriding 'args'.
43
+
44
+
All common settings information can be found here:
|I|A list of directories to be added to the header search paths.|
54
+
|x|Automatically set depending on the file type.|
55
+
56
+
SublimeLinter allows [expansion variables](http://sublimelinter.readthedocs.io/en/latest/settings.html#settings-expansion). For example, '${folder}' can be used to specify a path relative to the project folder.
57
+
48
58
## Troubleshooting
49
59
C/C++ linting is not always straightforward. A few things to try when there's (almost) no linting information available:
50
60
- Try to compile from the command line, and verify it works.
51
61
- The linter might be missing some header files. They can be added with "include_dirs".
52
62
- Sometimes clang fails to locate the C++ standard library headers.
53
63
Assuming the compilation works when executed via command line, try to compile with `clang++ -v`.
54
-
This will display all of the hidden flags clang uses. As a last resort, they can all be added as "extra_flags".
64
+
This will display all of the hidden flags clang uses. As a last resort, they can all be added as "args".
0 commit comments