[vim/vim] runtime(typescript): update outdated syntax files (PR #14840)

14 views
Skip to first unread message

Linda_pp

unread,
May 24, 2024, 3:48:20 AMMay 24
to vim/vim, Subscribed

This PR updates outdated syntax highlighting for typescript file type.

These files were imported on 2022 but have not been updated for a long time. On the other hand TypeScript has grown with new syntaxes such as type-only imports. They don't support the new syntaxes and caused an issue like HerringtonDarkholme/yats.vim#276.

I talked with @HerringtonDarkholme at HerringtonDarkholme/yats.vim#277 about this and the author agreed updating the upstream files by me.

I tested this change with the following test inputs and it looked working fine:

I also added myself to the maintainers list of these files since the author is very busy. I think I can help the author.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/14840

Commit Summary

  • 93eb494 runtime(typescript): update outdated syntax files

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840@github.com>

Linda_pp

unread,
May 24, 2024, 3:51:49 AMMay 24
to vim/vim, Push

@rhysd pushed 1 commit.

  • e65c5a2 runtime(typescript): update last modified timestamps in files


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/push/18568738460@github.com>

Linda_pp

unread,
May 24, 2024, 3:55:10 AMMay 24
to vim/vim, Subscribed

@rhysd commented on this pull request.


In runtime/syntax/shared/typescriptcommon.vim:

> @@ -623,25 +652,24 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
 
 
 " extension
-if get(g:, 'yats_host_keyword', 1)
-  syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
-  " use of nextgroup Suggested by Doug Kearns
+if get(g:, 'typescript_host_keyword', 1)

I renamed g:yats_host_keyword to g:typescript_host_keyword because I believe the original variable name is a mistake when this file was imported from yats.vim because it is weird that the original 3rd party plugin's name remains. Please let me know if my assumption is wrong.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/review/2076127788@github.com>

Christian Brabandt

unread,
May 24, 2024, 11:44:15 AMMay 24
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In runtime/syntax/shared/typescriptcommon.vim:

> @@ -623,25 +652,24 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
 
 
 " extension
-if get(g:, 'yats_host_keyword', 1)
-  syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
-  " use of nextgroup Suggested by Doug Kearns
+if get(g:, 'typescript_host_keyword', 1)

That is probably fine, since it doesn't seem to be documented :/ and also unused in other runtime scripts, if I see that correctly. Can you please add a short paragraph about this variable in :h syntax.txt at a tag ft-typescript-syntax (similar to other syntax descriptions).


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/review/2077284006@github.com>

Linda_pp

unread,
May 24, 2024, 11:45:50 AMMay 24
to vim/vim, Subscribed

@rhysd commented on this pull request.


In runtime/syntax/shared/typescriptcommon.vim:

> @@ -623,25 +652,24 @@ syntax keyword typescriptReadonlyArrayKeyword readonly
 
 
 " extension
-if get(g:, 'yats_host_keyword', 1)
-  syntax keyword typescriptGlobal containedin=typescriptIdentifierName Function Boolean
-  " use of nextgroup Suggested by Doug Kearns
+if get(g:, 'typescript_host_keyword', 1)

Sure. I'll try to add document.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/review/2077286723@github.com>

Linda_pp

unread,
May 24, 2024, 12:06:38 PMMay 24
to vim/vim, Push

@rhysd pushed 2 commits.

  • ecde735 runtime(typescript): fix conceals feature should not be upstreamed
  • 59ca212 runtime(typescript): add document for `typescript` and `typescriptreact` file types


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/push/18575940459@github.com>

Linda_pp

unread,
May 24, 2024, 12:22:18 PMMay 24
to vim/vim, Subscribed

@chrisbra I added new commits to resolve your comment. Would you review them?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/c2129935606@github.com>

Christian Brabandt

unread,
May 24, 2024, 12:52:52 PMMay 24
to vim/vim, Subscribed

Thanks looks good. I think the language can be improved, will do it while merging it. Thanks.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/c2129986427@github.com>

Christian Brabandt

unread,
May 24, 2024, 1:06:48 PMMay 24
to vim/vim, Subscribed

Closed #14840 via 5e45715.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/issue_event/12927647797@github.com>

Linda_pp

unread,
May 24, 2024, 1:30:46 PMMay 24
to vim/vim, Subscribed

Thank you!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/c2130051158@github.com>

Herrington Darkholme

unread,
May 24, 2024, 1:31:31 PMMay 24
to vim/vim, Subscribed

thank you!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14840/c2130052534@github.com>

Reply all
Reply to author
Forward
0 new messages