OrangeC
OrangeC copied to clipboard
Autocomplete + Syntax error highlighting
Would it be possible to have tab-autocomplete and syntax error highlighting? It would make development much smoother with the IDE.
Once again thank you for designing such a great compiler! Amazing how there is DOS support and works on Windows 95/98 and doesn't introduce artificial incompatibility like MSVC does with its CRT.
Autocomplete seems like a difficult task, it would require querying the compiler for the struct's descendant fields and then display them, but that would require a language-server like mode as well. The other thing for syntax error highlighting would be a massive amount of error changes to be more location based, with syntax only compilation etc. that would require a lot of work but I can see it being done via those methodologies.
Actually it is supposed to be doing autocomplete, for structure members and for function definitions. There is a small program 'occpr' which is basically the C compiler accepting connections from the IDE over a pipe, and which writes to an SQL database. That is one of several databases OCIDE reads.
Occpr is the same program that feeds in information about symbols so the ide knows how to colorize things...
I was wondering what was up with the code completion not working the other day but there is a lot going on so I haven't had a chance to look into it. I will see what it is doing this weekend.
As far as syntax highlighting, I don't know if the present scheme would work without some modification. The occpr approach to retrieiving information about the code is kind of slow... and it would have to be modified to give feedback about errors. I was wondering what would happen if I went to some effort to pull out various C/C++ operations that just don't make sense in this context but haven't gotten there yet...
In general I'd suggest to add a "syntax check only" option to occ
(also: never invokes the linker) - a mode occpr
would default to - actual code parts that are not needed for the simple checks would in this case be surrounded by something like
#if !OCC_CHECK_ONLY
if (!check_only_mode) {
... actual code here ...
}
#endif
It doesn't have to have advanced stuff like parameter type checking, just the basics like mismatched parenthesis, forgotten semicolons, mismatched brackets, curly brackets would be a huge improvement. Maybe when you compile and the compiler gives a line error it could add a red squiggly line below the error line (msvc does this for certain errors intellisense doesn't detect)
that doesn't sound too hard... worst of it will be drawing a little red squiggle! Meanwhile I've improved the code completion, if you don't feel like snagging it from the CI I'll have a release in a week or so whenever I get the syntax highlighting worked out.
well it is not perfect but I'm open to suggestions... will try to have a release within a few days.
Autocomplete still doesn't show up? I have half-typed variable = 10; I'm at variab and it should show me variable
Is that a CI build or is that a release build? because those are two different beasts
I got it from here https://ci.appveyor.com/project/LADSoft/orangec/build/job/p2eyjvjdewgk7i8j/artifacts
yeah that is the CI build. I found out today that the database stuff isn't working in the CI builds... checking into that is next on my list :) I'm also cleaning up the syntax checking a little more.
Hi Tom,
sorry I didn't explain better yesterday.
the 'CI' builds are completely built with the orange c toolchain itself, which means any bug anywhere in the tool chain can have adverse affects. As opposed to the versions I put on my web site, which are still built with Visual studio. This is why chuggafan said the CI builds are a whole different beast...,
in this case it appears that when the orange c compiler converted a long long to an enum, in a function argument, it generated bad code. This had adverse effects on the program that generates the database for the code completion while not affecting much of anything else. I've pushed a fix and the next CI build should work a little better.
@LADSoft Do you consider this close-fixed already?
I was intentionally leaving it open because I didn't know if there would be issues. I may close it since now you've opened #228... let me think about it...
reopening as this needs to be completely reworked.
Hi @LADSoft, is there any update on this matter? and thanks a lot for your work btw!
I haven't been working on the IDE; syntax highlighting probably doesn't work so well...