1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Handle the other languages.

This commit is contained in:
Rob Rix 2017-05-29 13:05:33 -04:00
parent 43d8c47798
commit 9cd20d8fb1

View File

@ -22,7 +22,6 @@ import Renderer
import Source
import Syntax
import Term
import Text.Parser.TreeSitter.TypeScript
-- This is the primary interface to the Semantic library which provides two
-- major classes of functionality: semantic parsing and diffing of source code
@ -104,8 +103,8 @@ parseAndRenderBlob decorator renderer blob@SourceBlob{..} = case blobLanguage of
term' <- decorate (const identity) source term
render (case renderer of
JSON -> JSONRenderer) (Identity blob, term')
Just Language.TypeScript -> do
term <- parse (TreeSitterParser Language.TypeScript tree_sitter_typescript) source
language -> do
term <- parse (parserForLanguage language) source
term' <- decorate (const identity) source term
render (case renderer of
JSON -> JSONRenderer) (Identity blob, term')