{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2431","repository_url":"https://api.github.com/repos/Microsoft/vscode-cpptools","labels_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2431/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2431/comments","events_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2431/events","html_url":"https://github.com/Microsoft/vscode-cpptools/issues/2431","id":351812181,"node_id":"MDU6SXNzdWUzNTE4MTIxODE=","number":2431,"title":"vscode can't open files from the Problems tab in a cmake project","user":{"login":"tinyredpanda","id":39399309,"node_id":"MDQ6VXNlcjM5Mzk5MzA5","avatar_url":"https://avatars2.githubusercontent.com/u/39399309?v=4","gravatar_id":"","url":"https://api.github.com/users/tinyredpanda","html_url":"https://github.com/tinyredpanda","followers_url":"https://api.github.com/users/tinyredpanda/followers","following_url":"https://api.github.com/users/tinyredpanda/following{/other_user}","gists_url":"https://api.github.com/users/tinyredpanda/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyredpanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyredpanda/subscriptions","organizations_url":"https://api.github.com/users/tinyredpanda/orgs","repos_url":"https://api.github.com/users/tinyredpanda/repos","events_url":"https://api.github.com/users/tinyredpanda/events{/privacy}","received_events_url":"https://api.github.com/users/tinyredpanda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-18T11:08:58Z","updated_at":"2018-08-18T11:08:58Z","closed_at":null,"author_association":"NONE","body":"Type: LanguageService\r\n\r\n**Describe the bug**\r\n- OS and Version: Ubuntu 14.04\r\n- VS Code Version: 1.25.1\r\n- C/C++ Extension Version: 0.18.1\r\n- Other extensions you installed (and if the issue persists after disabling them): I disabled all the other extensions and the issue persists.\r\n\r\nThe Problems tab can't open the files in a cmake project.\r\n\r\n**To reproduce**\r\n1. create a folder named `sandbox`,\r\n2. create a `main.cpp` in it and put an intentional error in it to make the gcc give a compiler error,\r\n3. create a `CMakeLists.txt` in `sandbox`,\r\n4. create minimal tasks (one for running cmake and one for running ninja/make),\r\n5. put `\"problemMatcher\": \"$gcc\"` in the build task,\r\n5. run cmake & ninja/make then try and open the file in the Problems tab.\r\n\r\nThe filepath in Problems path is shown as `~/repositories` next to `main.cpp` which is wrong, it should be `~/repositories/sandbox` (or `home/vuser/repositories/sandbox`).\r\n\r\nStrangely enough the filepath changes once `CMakeLists.txt` is moved to `sandbox/buildsys`, in this case the filepath is shown correctly (`home/vuser/repositories/sandbox`) in the Problems tab but it still can't be opened.\r\n\r\n**Expected behavior**\r\nBe able to open the files correctly.\r\n\r\n**Screenshots**\r\n![image](https://user-images.githubusercontent.com/39399309/44298400-6cfeac80-a2da-11e8-9157-d724eee6f3c5.png)\r\n`CMakeLists.txt` and `main.cpp` in `sandbox`.\r\n![image](https://user-images.githubusercontent.com/39399309/44298417-a3d4c280-a2da-11e8-9ece-6c706b267e34.png)\r\n`CMakeLists.txt` in `sandbox/buildsys` and `main.cpp` in `sandbox`.\r\n\r\nContents of the project `sandbox`:\r\n**main.cpp** in `sandbox`\r\n```\r\nint main()\r\n{\r\n    abort\r\n    return 0;\r\n}\r\n```\r\n**CMakeLists.txt** in `sandbox`\r\n```\r\nproject(hello-cmake)\r\nadd_executable(hello-cmake main.cpp)\r\n```\r\n**tasks.json**\r\n```\r\n{\r\n    // See https://go.microsoft.com/fwlink/?LinkId=733558\r\n    // for the documentation about the tasks.json format\r\n    \"version\": \"2.0.0\",\r\n    \"tasks\": [\r\n        {\r\n            \"label\": \"cmake sandbox\",\r\n            \"type\": \"shell\",\r\n            \"command\": \"cmake\",\r\n            \"args\": [\r\n                \"..\",\r\n                \"-G\",\r\n                \"Ninja\"\r\n            ],\r\n            \"options\": {\r\n                \"cwd\": \"${workspaceRoot}/build\"\r\n            }\r\n        },\r\n        {\r\n            \"label\": \"build sandbox\",\r\n            \"type\": \"shell\",\r\n            \"command\": \"ninja\",\r\n            \"group\": {\r\n                \"kind\": \"build\",\r\n                \"isDefault\": true\r\n            },\r\n            \"options\": {\r\n                \"cwd\": \"${workspaceRoot}/build\"\r\n            },\r\n            \"problemMatcher\": \"$gcc\"\r\n        }\r\n    ]\r\n}\r\n```"}}
{"actor":{"display_login":"tinyredpanda"}}