Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 33e2671

Browse files
committed
WIP
1 parent 6346865 commit 33e2671

File tree

11 files changed

+1383
-6
lines changed

11 files changed

+1383
-6
lines changed

semantic.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ library
320320
, tree-sitter-python
321321
, tree-sitter-ruby
322322
, tree-sitter-typescript
323+
, tree-sitter-tsx
323324
, tree-sitter-java
324325
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -j
325326
if flag(release)

src/Data/Language.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ data Language
3636
| Ruby
3737
| TypeScript
3838
| PHP
39+
| TSX
3940
deriving (Eq, Generic, Ord, Read, Show, Bounded, Hashable, ToJSON, Named, Enum, MessageField, NFData)
4041

4142
class SLanguage (lang :: Language) where
@@ -129,7 +130,7 @@ languageForType mediaType = case mediaType of
129130
".go" -> Go
130131
".js" -> JavaScript
131132
".ts" -> TypeScript
132-
".tsx" -> TypeScript
133+
".tsx" -> TSX
133134
".jsx" -> JSX
134135
".py" -> Python
135136
".php" -> PHP
@@ -144,7 +145,9 @@ extensionsForLanguage language = case language of
144145
PHP -> [".php"]
145146
Python -> [".py"]
146147
Ruby -> [".rb"]
147-
TypeScript -> [".ts", ".tsx", ".d.tsx"]
148+
TypeScript -> [".ts"]
149+
TSX -> [".tsx", ".d.tsx"]
150+
JSX -> [".jsx"]
148151
_ -> []
149152

150153
-- | Return a language based on a FilePath's extension, or Nothing if extension is not found or not supported.

0 commit comments

Comments
 (0)