-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Template string highlighting and export default interface highlight #64
base: master
Are you sure you want to change the base?
Conversation
Thanks! And sorry for the late reply. I'm very busy recently. Would you like add a vader test? Example is in the test directory. Feel free if you cannot set up the test environment. I can add it later by myself. |
syntax/basic/function.vim
Outdated
@@ -15,7 +15,7 @@ syntax match typescriptAsyncFunc contained /*/ | |||
\ skipwhite skipempty | |||
|
|||
syntax match typescriptFuncName contained /\K\k*/ | |||
\ nextgroup=@typescriptCallSignature | |||
\ nextgroup=@typescriptCallSignature,typescriptTemplate |
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 don't think FuncName is the correct choice here. But I need some more time to investigate how syntax highlight is done in your case.
Would you like to revert this change?
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.
Hello, sorry yes I did add it to the wrong place.
This will not highlight the string when you have an object such as
{
test: T`lkjsdf`,
}
I'll take another look and revert this one.
@@ -56,7 +56,7 @@ syntax keyword typescriptRepeat do while for nextgroup=typescript | |||
syntax keyword typescriptRepeat for nextgroup=typescriptLoopParen,typescriptAsyncFor skipwhite skipempty | |||
syntax keyword typescriptBranch break continue containedin=typescriptBlock | |||
syntax keyword typescriptCase case nextgroup=@typescriptPrimitive skipwhite containedin=typescriptBlock | |||
syntax keyword typescriptDefault default containedin=typescriptBlock nextgroup=@typescriptValue,typescriptClassKeyword skipwhite oneline | |||
syntax keyword typescriptDefault default containedin=typescriptBlock nextgroup=@typescriptValue,typescriptClassKeyword,typescriptInterfaceKeyword skipwhite oneline |
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.
This is a good fix! Thanks!
…lates" This reverts commit 91e0d4d.
…pdated from review)
@@ -23,6 +23,8 @@ syntax region typescriptTemplate | |||
\ nextgroup=@typescriptSymbols | |||
\ skipwhite skipempty | |||
|
|||
syntax match typescriptTaggedTemplate /\<\K\k*\ze`/ nextgroup=typescriptTemplate |
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.
Please don't do this. It will overlap with typescriptIdentifier and make backtracking more often.
It also doesn't handle case like funcCall()``
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.
Ah, I think I'm at the limit of my vim syntax knowledge then so I'm not sure where to put it :-).
So far I'm using it and the funcCall()`` case gets handled tho. Must be handled by the usual typescriptTemplate match.
@HerringtonDarkholme As far as I know, you cherry picker some commits from this, can this be closed or is this PR waiting for something? |
Hey, I tried to fix the tagged template highlighting, but my approach would cause more backtracking. To fix I'm not sure how to do it. Feel free to suggest a new approach or some area to look at? Not sure how to avoid backtrack. |
Fixes for issues #63 and #60.
Let me know if I have not done this correct.
Thanks for yats.