File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ async function updateCppPropertiesInternal(): Promise<void> {
84
84
cppProperties . configurations [ 0 ] . intelliSenseMode = "gcc-" + process . arch
85
85
cppProperties . configurations [ 0 ] . compilerPath = "/usr/bin/gcc"
86
86
cppProperties . configurations [ 0 ] . cStandard = "gnu11"
87
- cppProperties . configurations [ 0 ] . cppStandard = "c++14"
87
+ cppProperties . configurations [ 0 ] . cppStandard = getCppStandard ( )
88
88
89
89
// read the existing file
90
90
try {
@@ -138,3 +138,29 @@ function updatePythonAutoCompletePathInternal() {
138
138
function updatePythonAnalysisPathInternal ( ) {
139
139
vscode . workspace . getConfiguration ( ) . update ( PYTHON_ANALYSIS_PATHS , extension . env . PYTHONPATH . split ( path . delimiter ) ) ;
140
140
}
141
+
142
+ function getCppStandard ( ) {
143
+ switch ( vscode . workspace . getConfiguration ( ) . get ( "ros.distro" ) )
144
+ {
145
+ case "kinetic" :
146
+ case "lunar" :
147
+ return "c++11"
148
+ case "melodic" :
149
+ case "noetic" :
150
+ case "ardent" :
151
+ case "bouncy" :
152
+ case "crystal" :
153
+ case "dashing" :
154
+ case "eloquent" :
155
+ case "foxy" :
156
+ return "c++14"
157
+ case "galactic" :
158
+ case "humble" :
159
+ case "iron" :
160
+ case "jazzy" :
161
+ case "rolling" :
162
+ return "c++17"
163
+ default :
164
+ return "c++17"
165
+ }
166
+ }
You can’t perform that action at this time.
0 commit comments