Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Driver returns twice every inline comment #167

Closed
dpordomingo opened this issue Sep 18, 2018 · 3 comments · Fixed by #176
Closed

Driver returns twice every inline comment #167

dpordomingo opened this issue Sep 18, 2018 · 3 comments · Fixed by #176
Assignees
Labels

Comments

@dpordomingo
Copy link
Member

dpordomingo commented Sep 18, 2018

When an inline comment is parsed, it is returned a structure that is different compared to other comments or compared to other drivers:
It is returned a <SameLineNoopscontaining roleComment> having position and containing a <NoopSameLine roleComment> without position.

The comment token itself contains a leading # character what does not happen for regular python comments.

a = Animal() # line comentary

image

addendum:
This issue might be related to these similar ones in other languages drivers:
bblfsh/javascript-driver#36 bblfsh/go-driver#28 bblfsh/java-driver#86

@juanjux
Copy link
Contributor

juanjux commented Sep 19, 2018

For what I'm seeing, the dashboard is not using Semantic UAST so it's normal that the structure is different among languages.

@dpordomingo
Copy link
Member Author

The issue is not (only) about the dashboard but about the response I get from bblfsh.

I found the unexpected behavior with lookout using the typos-checker analyzer when reviewing this comment, wrongly placed in a wrong line (because the comment node seems to have no position as it also happened in the dashboard).

The bblfsh I'm runing to get that behaviour is:

{
  server: {
    version: 'bblfsh/bblfshd:v2.5.0'
  },
  drivers: {
    'python': {
      image: 'docker://bblfsh/python-driver:latest'
      version: 'v2.3.0'
      native: 'python:3.6-alpine'
    }
  },
}

Should I configure my env in a different way to use bblfsh with Semantic UAST?

@juanjux
Copy link
Contributor

juanjux commented Jan 31, 2019

I was testing this, and could not reproduce with the latest versions - all kinds of comments only appear once. BUT I found another problem: some comments doesn't appear in the semantic output. I'm investigating that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants