Skip to content
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

Parsing C# doesn't work #728

Closed
smacker opened this issue Mar 12, 2019 · 15 comments
Closed

Parsing C# doesn't work #728

smacker opened this issue Mar 12, 2019 · 15 comments
Assignees
Labels
3rd-party bug Something isn't working

Comments

@smacker
Copy link

smacker commented Mar 12, 2019

Run this query on any C# repository:

SELECT UAST(f.blob_content, LANGUAGE(f.file_path, f.blob_content)) AS uast
FROM refs AS r
NATURAL JOIN commit_files
NATURAL JOIN files AS f
WHERE r.ref_name = 'HEAD' AND f.file_path REGEXP('.*.cs')
LIMIT 5

it will return empty uasts.

@erizocosmico
Copy link
Contributor

SELECT UAST(f.blob_content, 'csharp') AS uast
FROM refs AS r
NATURAL JOIN commit_files
NATURAL JOIN files AS f
WHERE r.ref_name = 'HEAD' AND f.file_path REGEXP('.*.cs')
LIMIT 5

This does, so it's not a gitbase issue. It's just that bblfsh does accepts csharp and not C#, which is what enry returns.

@smacker
Copy link
Author

smacker commented Mar 20, 2019

bblfsh does accept c# when you send parse request. You can try it with go-client.
But gitbase doesn't because of this: https://github.com/src-d/gitbase/blob/master/internal/function/uast_utils.go#L100

so it's a problem in gitbase. though maybe it's better to wait for aliases in supported languages from LA team to fix it.

@erizocosmico
Copy link
Contributor

If gitbase asks if a language is supported and bblfsh reports that it's not, it's not a problem in gitbase. It's a problem of bblfsh not correctly reporting whether a language is supported or not.

We can create a mapping between languages such as C# to translate it to csharp so bblfsh will say that it's supported, but at the end of the day it's a hack until LA adds aliases in supported languages.

@erizocosmico
Copy link
Contributor

Leaving this blocked until enry/bblfsh have this fixed.

@dennwc
Copy link

dennwc commented May 28, 2019

Language aliases were released, see https://github.com/src-d/backlog/issues/1421#issuecomment-496659214 for more details.

@erizocosmico
Copy link
Contributor

This is fixed in bblfsh side, but we cannot upgrade to go modules right now so this will be kept as blocked.

@dennwc
Copy link

dennwc commented May 29, 2019

Why do you need modules for this?

@erizocosmico
Copy link
Contributor

Because dep cannot handle the vN suffixes used in packages using Go modules

@dennwc
Copy link

dennwc commented May 29, 2019

@erizocosmico According to "minimal modules compatibility" you can try getting the package without the vN suffix.

@erizocosmico
Copy link
Contributor

@dennwc we can, but we're importing bblfsh go-client, which has dependencies on modules using the vN suffix (sdk, etc)

@dennwc
Copy link

dennwc commented May 30, 2019

But we definitely won't backport this change. Do you need any help with switching to modules in Gitbase?

@erizocosmico
Copy link
Contributor

No, don't worry. Is more of a workflow and (internal gitbase) tooling issue than modules issues. We'll eventually move to go modules when we figure those out.

@ajnavarro
Copy link
Contributor

Aliases support becomes a high priority now, so maybe it is the time to move on with this task.

@erizocosmico erizocosmico removed the blocked Some other issue is blocking this label Jun 3, 2019
@erizocosmico
Copy link
Contributor

Will be fixed once #847 is merged

@ajnavarro
Copy link
Contributor

Finally fixed on v0.21.0-beta3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants