1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Merge pull request #1152 from github/oh-javascript

JavaScript as a distinct language, but uses TypeScript parser
This commit is contained in:
Timothy Clem 2017-06-08 12:52:46 -07:00 committed by GitHub
commit 0fc63cab83
2 changed files with 4 additions and 2 deletions

View File

@ -13,10 +13,11 @@ import Term
data Language =
C
| Go
| JavaScript
| Markdown
| Ruby
| TypeScript -- ^ Also JavaScript.
| Python
| Ruby
| TypeScript
deriving (Show, Eq, Read, Generic, ToJSON)
-- | Returns a Language based on the file extension (including the ".").

View File

@ -53,6 +53,7 @@ parserForLanguage Nothing = LineByLineParser
parserForLanguage (Just language) = case language of
C -> TreeSitterParser C tree_sitter_c
Go -> TreeSitterParser Go tree_sitter_go
JavaScript -> TreeSitterParser TypeScript tree_sitter_typescript
Ruby -> TreeSitterParser Ruby tree_sitter_ruby
TypeScript -> TreeSitterParser TypeScript tree_sitter_typescript
_ -> LineByLineParser