-
Notifications
You must be signed in to change notification settings - Fork 29
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
A way to run GMQCC as a linter #203
Comments
Open yes. Actively work on it... not sure. Other than that: making the output nice to understand (ie. using some sort of LSP protocol thing) would probably be doable if someone know how this works. I haven't looked into this myself at all. The main usability issue will be continuing on errors. Touching the parser is a PITA, but on the other hand, for errors that happen later in the AST or IR stages this should be rather easy. But I don't know which of these happen more frequently ;-) |
@Blub , I think I could work on this on my side with some guidance and comments on style of the PR (I am mostly do C these days, my C++ is rusty). The point is to get an approximation of what a linter would do. The plan is to:
My biggest problem with gmqcc right now is how it might not ever reach the file the editor is editing because of an error elsewhere. Not limiting parsing to a single file is fine, I suppose, as I can do file path filtering on the editor side. |
Like I said, the parser is quite a PITA. But maybe it can be split up a bit. As a first step create a list of "items" where a function including its body as one item, a typedef is another item, and then the contents (mainly function bodies) are parsed in a 2nd step, that way, other functions don't depend on the internal code of every other function being correct. But that's probably a bigger and more involved change. |
@Blub hm. This sounds pretty involved. Without looking at the code... Would something like skipping a file altogether work? I.e. fail a given file compilation on the first error but proceed with other files? |
Unlikely. The way QC code works is literally the same as if you just I've been too far away from QC code and the parser for too long to really be confident about this, but it might not be as bad as I imagine for gmqcc, since we eg. don't have pointer support. So eg. we wouldn't need to know about And I mean, it's up to the user to interpret the errors. Eg. if an entity field is not found and you clearly see the code that declares it, you should be able to figure out that the syntax error way earlier might be the more important error to deal with ;-) |
I am working on an Emacs mode for QuakeC projects. One useful things that's important to add to do is some kind of live code linting. A couple of things missing in gmqcc to make it convenient:
Would GMQCC team be open to such changes?
Thank you
PS this is a sister Issue to this one.
The text was updated successfully, but these errors were encountered: