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

Multiline Type Arguments #738

Closed
marudor opened this issue Apr 8, 2019 · 2 comments
Closed

Multiline Type Arguments #738

marudor opened this issue Apr 8, 2019 · 2 comments
Labels
duplicate limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line

Comments

@marudor
Copy link

marudor commented Apr 8, 2019

TS and JS Grammar Extension version: 0.0.50

Code

function T<A, B>() {}
T<
number,
string
>();

Screenshot 2019-04-08 at 20 30 48

As you can see highlighting (here VSCode) is also broken.
Based on my, fairly limited, understand of how grammar works it seems like it doesn't correctly detect start of Type Arguments and instead parses T< as variable.other.constant.ts the two types as
variable.other.readwrite.ts and the closing > actually as keyword.operator.relational.ts

>T<
 ^
 source.ts variable.other.constant.ts
  ^
  source.ts keyword.operator.relational.ts
>string,
 ^^^^^^
 source.ts variable.other.readwrite.ts
       ^
       source.ts punctuation.separator.comma.ts
>number
 ^^^^^^
 source.ts variable.other.readwrite.ts
>>();
 ^
 source.ts keyword.operator.relational.ts
  ^
  source.ts meta.brace.round.ts
   ^
   source.ts meta.brace.round.ts
    ^
    source.ts punctuation.terminator.statement.ts

relevant part from writing a test for it.

I'm not experienced enough to know how to add multiline support.

@marudor
Copy link
Author

marudor commented Apr 9, 2019

Sadly duplicate of #479 - Is this still considered by design and wontfix?
Browsing through Issues this gets reported a lot.

@sheetalkamat
Copy link
Member

Sadly its limitation of the tmlaguage syntax that doesn't allow multiline lookup and hence cannt be fixed

@sheetalkamat sheetalkamat added duplicate limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line labels Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate limitation Issue is result of tmLanguage limitation where in the lookup does not go beyond current line
Projects
None yet
Development

No branches or pull requests

2 participants