-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntelliSense really slow with bogus behaviour on M1 Mac #21
Comments
Seems like two errors. Have you tried Generating Project Files yet? In the log it shows this:
But the path, to the *.generated.h files, doesn't show up in the *.rsp file like it should. Generating Project files should fix this. This also could be a bug with my Regex so let me know if it fixes it. The other is possibly the compiler path. VSCode doesn't seem to like that path because it's changing away from the proper arm64 intellisense mode that it should be set to. This was the path the original M1 Mac user said worked but it probably should be set to the real clang path, that macs uses, which is the preinstalled xcode path to clang. This also could be something to do with Rosetta? I don't know about Macs but it seems that Rosetta runs clang in x64 mode or something? So maybe that's a separate problem. So either the path is right and Rosetta is causing the switch or both are wrong. |
This shows how to find clang path hopefully: |
Hm, when right clicking the .ueproject file on my Mac, there is no option that generates Visual Studio Project Files. Is it the same thing as the "Refresh Visual Studio Project Files" command from within the UE Editor?
Sadly I am not a Mac pro, I just know my way around, (I guess haha). So I checked where clang is located with
So I switched out the path to the Xcode version one in your extension, restarted VSC but that did not help.
|
The Xcode path, you're using now, should be the correct one. I would leave it. One thing that confused me was that it really should be clang++ but the previous Mac M1 users said that clang worked so I left it. I'm sure it worked because clang can do C and C++ and clang++ is just for C++. I think Xcode is required, on Mac, because it comes with all the necessary libraries. I could be wrong though. It is weird it says Generate Xcode Project Files but probably a Mac thing so should be correct. You can test this by running the command and checking if the Visual Studio Code *.code-workspace file in your project directory changes its 'modified' time to the current time/date. On Windows it's called Date Modified but might be different on Mac. I forgot to ask what the path is to your *.generated.h files (there will be one for every source file you have in your project I believe). I just need the path to the folder they're in. I need to check if the regex is broken for you. |
Hey there, sorry for the waiting!
Sadly, yes.
I tried that out and besides Finder (Explorer for MacOS) kind of freezes for a couple of seconds and then comes back to life, nothing else happens. Nothing visible at least and the modification date does not change. Maybe it is a problem that I "had" UE4 and UE5 installed? UE4 was removed... I am thinking about completely removing UE and reinstalling it. See the context menu screenshot attachment of the options I have.
Is this what you are looking for?
Also, I tried using the clang++ path instead of the clang path, but that also does not help. |
I updated my extension to fix the regex but it probably won't fix your issue. Let me know if my extension's error message goes away about the regex/generated.h. If it doesn't then maybe the correct path isn't being added to your response file. You can check this yourself. In FPSGame.198.rsp make sure this path I'm also thinking your issue could be a Rosetta issue. You might being running a Rosetta x64 build of clang instead of an arm64 build so VSCode switches to "macos-clang-x64". I'm not familiar with Mac M1s so I think that statement is correct. |
I am sorry but due to reinstalling UE5 and the FPS Game template, I now have another new problem. It does not find the .rsp file anymore, according to the logs. It seems the path gets chopped at "master"?! :(
The rsp file says
I checked with
Refreshing the VSC Files via UE5 does not help :( |
Yikes, I guess none of my regex have support for dashes or any other legit symbol. I'll have to release an update. |
I released 3.1.6. Seems it was only one regex. I only fixed dashes and added a better error message for any future problems. |
Thanks, very fast! :) Ill try to find out how to install the update on my mac manually, as VSC currently only lists 3.1.4 as the newest version via the extension browser. Ill update you as soon as I tested it out. Big thx for your support! |
You can just install like before https://gist.github.com/boocs/f63a4878156295b6e854cac68672f305#Installation It'll upgrade the previous version. |
Now I installed version 3.1.6 and the extension output now tells 0 Errors and 2 Warnings. Yay?!
The .rsp file still has the include paths I showed in my previous post. The C/C++ Output still reports changing back to the x64 version after a while. The time it takes for this to happen seems random / I did not find out how to trigger this so far.
I also checked if I accidently installed the intel version of VSC but I got the silicon version. Should I try out using the other two version instead (universal and intel)? Just re-Installing the silicon version of VSC did not help. |
Another update on this. But it seems that just opens up the C/C++ Extension settings file. :( Current state still switches back to x64. When Intellisense works, the Problems tab shows me this:
Im happy if you have any further ideas on how to fix this. :) |
I could be misunderstanding intellisenseMode. I asked and am awaiting reply. "macos-clang-x64" could be correct... Does intellisense work after this changes or does it still give include errors? |
In retrospect it does make more sense. x64 is what your project is targeting not what clang was built with. So the setting it's changing it to should be the correct one. I'll need to add a fix like I did for c++14/c++17. This one will probably take longer for me to make. |
Actually it's better to make sure the setting is off so it doesn't fallback to tag parser.
|
FY: I did not forget about this, currently just big time busy with the stuff that pays my bills. Will give you proper feedback ASAP! |
I've released 3.3.0 with new strict path setting behavior. Basically don't use the strict path extension setting anymore. Uncheck and reset your project (Generate Project Files) I've also done a initial release of my guide on checking for config errors. https://github.com/boocs/Unreal-VSCode-diy-config-check-github |
Even though I recommend against it I have another Mac(non M1) that says /usr/bin/clang worked for them. So you can also try enabling the extension's strict setting and putting /usr/bin/clang in the extension's path setting Other M1 users have said this has worked as well. Not sure why though. |
I rented a cloud M1 Mac and just changing the compile commands path to /usr/bin/clang made Intellisense work. Strange behavior but hope that helps! I'll probably change the way my extension works so it's easier to set. |
New update makes the compiler path setup easier. I tested it on an M1 Mac and changed my compiler path to /usr/bin/clang++ and it worked. |
I finally found the time to dig into this again and see if it works now. Short Version: Nope :(
In 99% of the time, I only have the Fire Icon on the left corner side in the status bar, which always just tells me "OmniServer is running". Clicking it brings me to the output of it, which so far never stated any errors. In very rare cases, the fire icon jumps to the right side of the status bar and then I can also see the cylinder icon, which shows me the amount of files that are getting indexed. When that is done, the code gets some more color and IntelliSense starts to work halfway properly. It is then positioned where it is on your screenshot.
I updated your plugin to the newest version. Only going by its feedback, Intellisense "should" work.
I sadly don't know how I did it, but after opening different project templates / creating blank projects, at one time VScode almost instantly had Intellisense working. I am not able to reproduce it. To me it looks like your plugin is doing its job - making it possibly work - but something else is messing up, ending in really bad performance. I am basing this on
Good thing, while trying a lot of stuff, updating Xcode to v14 and then downgrading back to 13, I learned some stuff like for example how to generate the visual studio project files via command line, which I believe is what the missing context menu action is doing. If any mac users are reading this and want to know how: cd into Would you say I am correct with it, that it is working but the remaining problem is just being ULTRA slow? While typing this, I did another test. It takes around 15 Minutes until Intellsense "works" in my FPSgame tutorial. |
Yep I noticed it slow to start as well but the cloud M1 Mac I rented it only took ~4 minutes. But I'll retest once I get my cloud mac working again. My cloud m1 Mac was using clang 13.1.6 iirc. Probably something we should ask the cpptools extension developers about. The slowness is cause by the cpptools extension querying clang about it's defaults when first starting up VSCode. After all the clang querying is finished it seems to work like normal though. I did search their github and no one else seemed to have the issue. Also my rented m1 Mac is not an admin account. Are you running an admin account? Maybe that could have something to do with it. The omnisharp server and default Intellisense use the same icons. You can ignore the omnisharp fire symbol that appears on the left. |
Can you also type '/usr/bin/clang++ -v' on the console again to see what version it goes to? |
Interesting. I got the biggest MacBook Pro M1 Max model that was available, I was hoping that there will be NOTHING running slow for the next two years. Seems I was wrong with that assumption. :D
Ok. good to know that they share icon. Then I have to correct my last posting: The Intellisense fire icon is never there, unless Intellisense starts to work.
I tested both paths, just to be sure if there are two different versions at work. But both seem to point at the same Xcode package.
|
Yes. |
Hmm for some reason my cloud mac got upgraded to XCode 14, but yes it also does the same query clang defaults slowness ( but also works after). On the UE5 site it says a very specific XCode 12.4 is required for Macs. If the project is for IOS you can use 12.4 or the latest XCode 13 version(for specific reasons). https://docs.unrealengine.com/5.0/en-US/hardware-and-software-specifications-for-unreal-engine/ Would it be possible to try XCode 12.4 and see if it fixes the clang query slowness? I would have to jump through hoops to get it installed on my cloud M1 Mac or probably denied. |
I've been preparing to make a bug report to the cpptools extension. I decided to create a single workspace project and just copied over an unreal project and fixed it to work. Basically removed the UE5 folder. It has no clang defaults query slowness... Back to testing. |
Found the reason. Can't handle too many include directories in the response file. Will file report after I create a project that dupes the behavior. |
I made the report here: You can cut the time in half without affecting your project.
Note: The compileCommand lines will come back if you ever reset your project. |
Another thing to try:
|
Awesome man, thanks for the effort! :) Wondering how few people use a M1 Mac with UE5, as nobody else seems to have this problem and the M1 is almost like "old gear" already. I installed the silicon version of the C++ extension, which already gave a huge speed boost to the Intellisense init. |
Hello!
Note: I am completely new to Unreal Engine development + Visual Studio Code and haven't done anything in C++ for about 20 years. I do have a good WebDev background, so I hope/should be able to follow your guide on getting this to work.
I was not sure if I am having the same problem as this person, so I created a new Issue:
#10
I am using Unreal Engine 5.0.3 and VSC 1.70.0 on an MacBook Pro M1 Max and the Tom Looman C++ FPS Game Template available via his website/youtube video. Also had the same problem with basic UE C++ templates like the Top Down Template.
Problem:
After starting VSC, I get the output message from your extension, that it is doing a lot of stuff, I should refresh my VSC workspace via UE Engine and restart VSC. I can do this how often I want to, it is an endless loop.
When looking at the project code, I see that IntelliSense is not working correctly, as basic methods/class names are not recognized - white colored.
After a kind of random amount of time, the C++ Output Window throws out a confusing message about now using the wrong IntelliSense mode. A couple of minutes after that, IntelliSense kind of starts working. Method/Class name coloring is visible and typing simple stuff like #include or using Unreal Components works. But not always. Sometimes it gets stuck(?) and just tries to load paths etc...
This is the log of your extension.
This is message that the C++ Output Window throws. It happens AFTER your extension runs on VSC startup.
Here is my c_pp_properties.json after your extension states that it changed IntelliSense back to x64.
Some more answers to questions you asked the other person with an M1 having problems
To sum my problems up in short:
Hope you can help me with that! :)
The text was updated successfully, but these errors were encountered: