auto completion in chromium with Visual Studio Code

219 views
Skip to first unread message

Long Le

unread,
Jan 16, 2018, 10:24:28 AM1/16/18
to Chromium-dev
Im using Windows and trying to use autocompletion with you-complete-me extension in VS Code with this guide Visual Studio Code Dev but then i have issues like this:

Follow the issue, i generated the compile_command.json file by the following command: 
ninja -C out/Default -t compdb cc cxx objc objcxx > out/Default/compile_commands.json

and then I updated the includePath and add the path of the above compile_commands.json file to compileCommands in c_cpp_properties.json file:

"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/include/*",
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/atlmfc/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
"${workSpaceRoot}",
"D:/chromium/depot_tools/src"
],
"compileCommands": "D:/chromium/depot_tools/src/out/Default/compile_commands.json",
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/include/*",
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.12.25827/atlmfc/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
"${workSpaceRoot}",
"D:/chromium/depot_tools/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}

But nothing happens and these issues still appear. Can anyone help me to solve these or suggest me a clearly guide to get start with chromium in VS Code? 

lju...@chromium.org

unread,
Jan 17, 2018, 5:34:19 AM1/17/18
to Chromium-dev
The vscode Chromium guide contains some info about ycm, in particular there's a chromium.ycm_extra_conf.py file you should use. Did you set that in your settings? The instructions are for Linux, but they might apply to Windows as well.

  // YouCompleteMe
  "ycmd.path": "<full_path_to_your_home>/.ycmd",
  "ycmd.global_extra_config": "${workspaceRoot}/tools/vim/chromium.ycm_extra_conf.py",
  "ycmd.confirm_extra_conf": false,

You could also try setting include paths in c_cpp_properties.json. CTRL+SHIFT+P -> C/CPP: Edit Configurations... -> Make sure "${workspaceRoot}" and/or D:/chromium/depot_tools/src is set under both "includePath" and "browse" under Win32.

- Lutz

Long Le

unread,
Jan 17, 2018, 9:50:53 AM1/17/18
to Chromium-dev


On Wednesday, January 17, 2018 at 5:34:19 PM UTC+7, lju...@chromium.org wrote:
The vscode Chromium guide contains some info about ycm, in particular there's a chromium.ycm_extra_conf.py file you should use. Did you set that in your settings? The instructions are for Linux, but they might apply to Windows as well.

  // YouCompleteMe
  "ycmd.path": "<full_path_to_your_home>/.ycmd",
  "ycmd.global_extra_config": "${workspaceRoot}/tools/vim/chromium.ycm_extra_conf.py",
  "ycmd.confirm_extra_conf": false,

You could also try setting include paths in c_cpp_properties.json. CTRL+SHIFT+P -> C/CPP: Edit Configurations... -> Make sure "${workspaceRoot}" and/or D:/chromium/depot_tools/src is set under both "includePath" and "browse" under Win32.

- Lutz
Yes i tried setting include paths in c_cpp_properties.json under both  "includePath" and "browse" under Win32 and ycmd config in  my workspace settings like exactly what you said but nothing happened. 
"ycmd.path": "C:/Program Files/~/.ycmd",
"ycmd.global_extra_config": "D:/chromium/depot_tools/src/tools/vim/chromium.ycm_extra_conf.py",
"ycmd.confirm_extra_conf": false,
Reply all
Reply to author
Forward
0 new messages