Skip to content

Commit 6ac5e34

Browse files
committed
Add typescript as supported language on LeetCode
1 parent 3b8c05c commit 6ac5e34

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

autoload/leetcode.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ let s:file_type_to_ext = {
653653
\ 'c': 'c',
654654
\ 'csharp': 'cs',
655655
\ 'javascript': 'js',
656+
\ 'typescript': 'ts',
656657
\ 'ruby': 'rb',
657658
\ 'swift': 'swift',
658659
\ 'golang': 'go',
@@ -741,7 +742,7 @@ function! leetcode#ResetSolution(with_latest_submission) abort
741742
endfunction
742743

743744
function! s:CommentStart(filetype, title) abort
744-
if index(['java', 'c', 'javascript', 'cpp', 'csharp', 'swift', 'scala',
745+
if index(['java', 'c', 'javascript', 'typescript', 'cpp', 'csharp', 'swift', 'scala',
745746
\ 'kotlin', 'rust'], a:filetype) >= 0
746747
return '/* ' . a:title
747748
elseif index(['python', 'python3', 'ruby'], a:filetype) >= 0
@@ -754,7 +755,7 @@ function! s:CommentStart(filetype, title) abort
754755
endfunction
755756

756757
function! s:CommentLine(filetype, line) abort
757-
if index(['java', 'c', 'javascript', 'cpp', 'csharp', 'swift', 'scala',
758+
if index(['java', 'c', 'javascript', 'typescript', 'cpp', 'csharp', 'swift', 'scala',
758759
\ 'kotlin', 'rust'], a:filetype) >= 0
759760
return ' * ' . a:line
760761
elseif index(['python', 'python3', 'ruby'], a:filetype) >= 0
@@ -767,7 +768,7 @@ function! s:CommentLine(filetype, line) abort
767768
endfunction
768769

769770
function! s:CommentEnd(filetype) abort
770-
if index(['java', 'c', 'javascript', 'cpp', 'csharp', 'swift', 'scala',
771+
if index(['java', 'c', 'javascript', 'typescript', 'cpp', 'csharp', 'swift', 'scala',
771772
\ 'kotlin', 'rust'], a:filetype) >= 0
772773
return ' * [End of Description] */'
773774
elseif index(['python', 'python3', 'ruby'], a:filetype) >= 0

0 commit comments

Comments
 (0)