-
Notifications
You must be signed in to change notification settings - Fork 127
Implement PrintAST for Go #260
Comments
See also #179. |
I have created a simple
I'll create a PR for the query I am using and hopefully we can use this to debug these issues. |
Re: no. 4, this should fix it: #263 |
Re: no. 3, how about #264 ? Comments are still second level (children of Files but not of anything else). This is how the Go parser describes them -- we'd have to use source location information, which might be a bit brittle, to give them a better parent. Does that cause you much trouble? I could add a skipComments option to the config if you want? |
Thanks for the related PRs. Regarding comments in the AST, I'm not an avid go user (I haven't done much more than the intro tutorials a few years ago), so it's hard to know how useful they are. My thoughts are that if comments are regularly returned as useful results in codeql-go queries, then we should include them in the AST. If they're not (or rarely are), then let's remove them. More precisely, only if comments are regularly involved with security issues, let's keep them. It all depends on what users expect and what they find useful. |
I'm not aware of any existing query where we pay attention to them. Do you want a flag in the config to omit them, or is it simple to omit them your side? |
I think it is reasonable to have the |
Is that the case? The Go AST library provides CommentMap, which seems like the natural way to parent comment groups. |
Ah nice, ok so we're using an old API that describes comments only as File children, but there's a better one that will give them best-possible parents. For now do you just want me to add a configuration filter for commentgroups? |
I think that would be easiest from my perspective. |
Alright, coming up |
@aeisenberg you ok with marking this done? |
We're done here. Thanks! |
This issue is about adding support to the CodeQL VS Code extension for viewing ASTs of Go files. See the parent issue github/vscode-codeql#492.
The text was updated successfully, but these errors were encountered: