VS2017 Intellisense

windows

#1

Are there some missing includes in the Host sample in VS2017?

Getting plenty of red underlinings. It compiles and runs okay, just looks broken.
Anyone any experience of this?


#2

Yeah, it happens. There are a few threads about it here. It’s the way the includes are generated or something like that confuses intellisense. Not sure if it can be fixed.


#3

That would require Jules changing his mind about the ways modules are created.


#4

Okay… Is foregoing Intellisense in VS2017 in order to be able to use Juce a fair exchange?

In terms of productivity - it doesn’t make practical sense (to me at least!) to be fighting the IDE day after day. Heck, I find it hard enough finding my bearings in code with the tools!

Practical suggestion welcomed.


#5

Get Resharper from jetbrains, disable intellisense. Works here even inside modules, and resharper is a dream


#6

Thanks Jim.

But if the problem is how modules are built, surely the solution is adjusting how the modules are built?
Spending money isn’t really a techie enough solution, not in this case.

PS. Aside, I checked out Resharper. It’s not for me, and for two reasons. First, it doesn’t matter how good it is, subscription software is a pet hate, and I believe, quite unethical. Can you imagine if your car evaporated after 12months, unless you bought it again? That’s not ownership, it’s a coin in a slot until the meter runs out. So no, I am not prepared to rent software. And secondly, I have not even decided to use Juce yet! So spending out is not the plan at this point. Intellisense should work, shouldn’t it?


#7

In my experience it sometimes does work, but unfortunately I still haven’t figured out how to make it work reliably. The same (if not worse) situation exists also on OSX where XCode (at least the version 7.3.1 I am using) sometimes gets totally confused and refuses to auto-complete. In that case getting rid of cached lookup information helps. Maybe the same thing can be done with Visual Studio.

However it’s quite strange that those IDEs cannot handle the JUCE structure. After all it’s perfectly valid C++ and those syntax parsers should be able to handle it if the compilers can. So instead of blaming JUCE I’d rather blame the IDEs.


#8

Intellisense should work fine for your own code, which is where I’d expect you to be spending the majority of your dev time.

The screenshot above is of some internal juce code, and the problem is just that intellisense’s parser is too dumb to understand that this cpp file should be included from inside another cpp rather being parsed on its own. Anyone that uses this cpp-included-by-a-cpp trick (regardless of juce) would have the same result. But any normal code that uses juce should be just fine.

So please don’t think that just because you opened a random file and saw intellisense failing that it means all files will look like that just because juce code is involved!


#9

That would be the best, but it’s not what the team decided and they are against making it as other people make modules, so… No option!


#10

Oh no, the concept of source files inside source files is not the standard. So don’t blame the IDEs, they can’t know that the file is included in another file. If they were headers, perhaps they would work better, but even then, the good practice is to have a file having its includes to be independent.
There is actually a clang tool to apply that standard practice to a file.


#11

Yeah, they can. They have a project that tells them exactly how to build each file.
Plenty of IDEs mange that just fine, it’s not rocket science. If they can compile the project then there’s no excuse for intellisense getting a different result.


#12

Gents, didn’t mean to start a major discussion! There are usually good reasons for decisions people make! And no doubt this is one of those no exception to that rule.

You have a very fair point Jules, day to day I probably won’t need to dig deep. It was not as random as all that, I was just following the execution path, to map the gap between my understanding of WINMM and how you have decided to wrap that and build higher level structure and so on. I face a simple choice - either to undertake to write my own low level code, and threading, perhaps more as I am used to, or to buy into Juce paradigms and work with the advantages and limitations (forgive me) that represents. I note for example you use MIDI Channels numbered 1-16, where I would prefer a zero based channel. There are quite a few things about the way current plugins and hosts work that are troublesome, and I want to change that for my own code. Finally, since I am not interested in IOS or Android but exclusively Windows, I have to weigh up if the difficulties involved in working with all aspects of Juce are warranted.

A Cpp within a Cpp is not something I am used to, but I guess it’s no different to any other “include” - it’s just a paradigm shift from my experience to date.

I started the thread to find a solution, not to cause any issues though! Peace!


#13

Do yourself a favour and give “Visual Assist” a try. It’s not a subscription model, has a trial and it will not only solve that problem, but MANY, MANY more. It’s a fantastic addition to Visual Studio and nobody who’s used it for a few days can imagine going back working without it.


#14

TBH that’s a choice I made 15 years ago and have regretted, but can’t change without breaking a lot of people’s code!


#15

Ha! I did wonder! It’s really quite good down there in the engine room though, very “up my street” byte level code.

(But I started with 6502 8bit assembler in a C64, so any time I see 8bit or byte arrays something inside just sighs “home…” :wink: That’s probably another reason why DIY appeals for low-key projects. I heed the warning too. One only has so much time in life.)


#16

@reFX - thanks for that - I will have a look asap.


#17

But it still doesn’t handle source in a source “properly” (but yeah, agreed, should start a debate on the benefits of this :wink: )
But it’s great, really great, I disabled Intellisense on VS and using it on my professional workstation, can’t work as efficiently without it. Just “go” is enough.


#18

I have no doubt this can be fixed to both create modules AND satisfy Intellisense. Intellisense and ReSharper are the greatest tools in the world for gaining an insight to the code. I do my utmost to eliminate all of those issues and to whole classes marked as unknown is very misleading.


#19

I’m trying to work through a demo and things like StringArray DirectoryIterator are underlined as undefined.

Man, if you can fix this, please do it.


#20

From what I can see it is similar to ReSharper, which I have. I installed Visual Assist and the undefined stuff is not fixed. So, basically, 3 programs meant to make sense of the code do not like the project file.