You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
new operator does not work well with full qualifier #181
That's not correct. It does get recognised, the regex skips the first item in fully qualified class name - just need to fix that. It would be tricky to fix all of the situations - I have a tree-sitter PR that would address this issue (and bunch of others).
It would be fixed naturally if java.io.File is recoginized as a type and fall into object-type scope to be parsed...
@sadikovi If you agree type in constructor call should be rendered as type (where langs like cpp & ts do so), you can take a look at this branch at your convenience, which is come up to solve #216.
It is simple enough by just doing following things:
Add (?=\\() match to object-type, to allow type to be recognized in a constructor call.
Remove function-call and parens from anonymous-classes-and-new, and patch a (...) matching for constructor calls.
Fix the udpated scopes in test by:
Replace all 'meta.function-call.java', 'entity.name.function.java' with 'storage.type.java';
Remove 'meta.function-call.java' before 'punctuation.definition.parameters.*.bracket.round.java'
Effect:
Update:
Oh, sorry for that I ignored the extends case. What I talked about is about the new case in the title, and it's related to object-type. The extends case is caused by object-type-inherited.
Activity
sadikovi commentedon Dec 3, 2018
Can you include the language-java version that you are testing against?
felixhao28 commentedon Dec 3, 2018
d48e713
felixhao28 commentedon Dec 4, 2018
might be related,
extendsdoes not work well with full qualifiers either:sadikovi commentedon Dec 4, 2018
This looks like a regression, because it was fixed at some point, if I remember correctly. I will investigate.
Vigilans commentedon Nov 27, 2019
The regression is caused in these lines:
language-java/grammars/java.cson
Lines 1059 to 1062 in 47ddbb6
the constraint
must be followed by a variable namepreventsjava.io.Fileto be recognized as a type.sadikovi commentedon Dec 7, 2019
That's not correct. It does get recognised, the regex skips the first item in fully qualified class name - just need to fix that. It would be tricky to fix all of the situations - I have a tree-sitter PR that would address this issue (and bunch of others).
Vigilans commentedon Dec 7, 2019
It would be fixed naturally if
java.io.Fileis recoginized as a type and fall intoobject-typescope to be parsed...@sadikovi If you agree type in constructor call should be rendered as type (where langs like cpp & ts do so), you can take a look at this branch at your convenience, which is come up to solve #216.
It is simple enough by just doing following things:
(?=\\()match toobject-type, to allow type to be recognized in a constructor call.function-callandparensfromanonymous-classes-and-new, and patch a(...)matching for constructor calls.Effect:

Update:
Oh, sorry for that I ignored the
extendscase. What I talked about is about thenewcase in the title, and it's related toobject-type. Theextendscase is caused byobject-type-inherited.