<div dir="auto">One other tip, since I happen to know you do this... Make sure there is a .env file in the root of your source folder that has an appropriate "PYTHONPATH=...". (Then ctrl-shift-p and "reload window" to be safe). This should be enough to get python code completion and hover (I just fixed this in MLIR the other day).<div dir="auto"><br></div><div dir="auto">I usually just set all of my projects up to do this and then when working from the cli, do `source .env && export PYTHONPATH`.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 1, 2021, 6:51 AM Stella Laurenzo <<a href="mailto:stellaraccident@gmail.com">stellaraccident@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 1, 2021, 6:41 AM Nicolas Vasilache via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>I am trying to use vscode for cmake development and so far I have been only moderately successful.</div><div><br></div><div>I think I have most of the things right (including clangd and autocomplete) but I still have a few issues:</div><div><br></div><div>1. I am not able to configure vscode + cmake such that the project only rebuilds incrementally. As a consequence a tiny change retriggers compilation of the whole thing. Since I configured ccache I get close to 100% hits but this still takes ~1-2 minutes instead of a few seconds by using cmake -Ninja on the command line.</div><div>(I think) I have been careful to not trigger spurious stuff (e.g.)</div><div><br>    "cmake.generator": "Ninja",<br>    "cmake.clearOutputBeforeBuild": false,</div>    "cmake.configureOnEdit": false,<br>    "cmake.exportCompileCommandsFile": false,<br>    "cmake.autoSelectActiveFolder": false,<br>    "cmake.useCMakePresets": "never",<div><br></div><div>but to no avail ..</div><div><br></div><div>The other 2 may be related to my not investing the time to dig further until I have a proper solution to point 1. </div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This is a big between cmake/ninja/debian distros/vscode that is quite unfortunate. I root caused it a year ago here, and the quick fix for vscode config is noted just after my response: <a href="https://gitlab.kitware.com/cmake/cmake/-/issues/17330" target="_blank" rel="noreferrer">https://gitlab.kitware.com/cmake/cmake/-/issues/17330</a></div><div dir="auto"><br></div><div dir="auto">(Ftr - I don't use vscode cmake integration. I'm too addicted to having command line control)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>2. I am not sure how to set the tests for easily pinpointing particular errors, running a single test through the IDE and fixing it inline. Maybe we are spoiled but our internal Google setup makes it very easy to do such things.</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I think this is screaming for an extension for lit that to my knowledge does not exist. Probably not the right person to comment on that because... CLI bias again.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>3. I am not sure how to set up the integrated debugger to have a clicky debugging nice setup. I have some old recollections circa VC++ 6.0 ish where these things were quite nice to navigate and I am hoping to </div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">My life improved substantially when I switched to one of the lldb plugins from the default provided gdb plugin. Especially for llvm, gdb is just too slow to launch. I don't love hand coding launch configs in json but it is serviceable, and that is the one manual step (basically just the path to binary and args), and it should be clicky from there. I believe there are various things floating around to make llvm types a bit nicer in the debugger but I just squint :/</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Some additional details that may be of relevanceL</div><div>A. I am on a Linux boc (and running through a remote connection from my mac laptop). </div><div>B. I am using a third-party project and I am making use of some MLIR side features to build stuff</div><div>together with LLVM. In particular:</div>    "cmake.sourceDirectory": "${workspaceFolder}/../llvm-project/llvm",<div>Note that this is not a problem in my CLI-only setup where things behave like I expect them<br><div><div><br></div><div>Does anyone know of a good setup I could replicate?</div><div><br></div><div>If you're replying to this, please +1 me in the conversation because email is hard.</div><div><br></div><div>Thanks much!</div><div><br></div>-- <br><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr">N</div></div></div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>
</blockquote></div>