-
Notifications
You must be signed in to change notification settings - Fork 28
Update uast-viewer and bblfsh/client-go to work with gitbase 0.18 #279
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
Conversation
Gopkg.toml
Outdated
@@ -7,7 +7,7 @@ | |||
non-go = true | |||
|
|||
[[prune.project]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client-go is pure go project now. We can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 done in 8f25ae5
Gopkg.toml
Outdated
@@ -39,12 +39,16 @@ | |||
version = "1.2.2" | |||
|
|||
[[constraint]] | |||
name = "gopkg.in/bblfsh/client-go.v3" | |||
version = "3.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mention I set this to the exact same version as gitbase, to have the same results from the queries and from the parsing we do in our side.
https://github.com/src-d/gitbase/blob/v0.18.0-beta.1/Gopkg.toml#L57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your lock file uses 3.1.0:
540b3ec#diff-bd247e83efc3c45ae9e8c47233249f18R316
v3.0.0 doesn't have SyntaxErr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, I had to update to 3.1.0 for the error. It got updated in the lock file but not in this one. Done in 8f25ae5
server/handler/uast.go
Outdated
if resp.UAST != nil && req.Filter != "" { | ||
filtered, err := tools.Filter(resp.UAST, req.Filter) | ||
if req.Filter != "" { | ||
results, err := applyXpath(resp, req.Filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resp, err := applyXpath(resp, req.Filter)
no need for new variable results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 9bd3a90
server/handler/uast.go
Outdated
} | ||
|
||
resp.Children = append(resp.Children, filtered...) | ||
results, err := applyXpath(reqNodes, req.Filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, no need for results
}) | ||
.catch(err => this.setState({ uast: null, error: err })) | ||
.then(() => this.setState({ loading: false })); | ||
} | ||
|
||
// Applies the uast-viewer object shape transformer, and expands all nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before it was expanding only first 2 levels.
The problem with expanding everything - uast is huge. For a big file, it will hang a browser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Previously the default uast-viewer
render matched when we used withUASTEditor
in CodeViewer.js
(the CODE modal), and uast-viewer
directly in UASTViewer.js >
UASTViewerPane.js` (the UAST modal).
Now the uast viewer without the editor is different, and shows all the UAST nodes collapsed. Should we try to mimic the expanded levels here, or do you think it makes sense to handle this in the uast-viewer
project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is expandRootIds helper for that. Before it was included in transformer
but caused some problems so now you need to call it explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in a8cacfd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main problem is expanding all nodes. It will kill browser easily on some file like jquery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
Signed-off-by: Carlos Martín <carlos.martin.sanchez@gmail.com>
a8cacfd
to
d74c362
Compare
Part of #248.
This PR is against a new branch instead of master because gitbase 0.18 is still in beta, and I'd like to keep master ready to be released at any time; in case we find bugs or minor improvements to do before the gitbase 0.18 final release. We can then merge the new branch to master.
Things that are missing but can be done cleanly in separate PRs: