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

Commit 2f4f5d8

Browse files
author
Patrick Thomson
authored
Merge branch 'master' into update-development-docs
2 parents 2a82a3a + 0257625 commit 2f4f5d8

File tree

28 files changed

+1243
-150
lines changed

28 files changed

+1243
-150
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please note that this project is released with a [Contributor Code of Conduct][c
1919
0. Create a new branch: `git checkout -b my-branch-name`
2020
0. Make your change, add tests, and make sure the tests still pass
2121
0. Push to your fork and [submit a pull request][pr]
22-
0. Pat your self on the back and wait for your pull request to be reviewed and merged.
22+
0. Pat yourself on the back and wait for your pull request to be reviewed and merged.
2323

2424
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
2525

@@ -28,6 +28,8 @@ Here are a few things you can do that will increase the likelihood of your pull
2828
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
2929
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
3030

31+
Please be aware that contributions to Semantic may multiple cycles of code review—we are grateful for all community involvement, but because Semantic powers real systems, we must maintain a high standard of code quality. For reasons of compatibility with production uses of Semantic within GitHub, we may also reject or require modifications to changes that would affect these systems. We may also reject patches that don't fit with our vision of the project; should this be the case, we will be clear about our rationale.
32+
3133
## Resources
3234

3335
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)

semantic.cabal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,14 @@ library
202202
, Language.Ruby.Assignment
203203
, Language.Ruby.PrettyPrint
204204
, Language.Ruby.Syntax
205+
, Language.TSX.Assignment
206+
, Language.TSX.Syntax
207+
, Language.TSX.Syntax.JSX
205208
, Language.TypeScript.Assignment
206209
, Language.TypeScript.Resolution
207210
, Language.TypeScript.Syntax
208211
, Language.TypeScript.Syntax.Import
209212
, Language.TypeScript.Syntax.JavaScript
210-
, Language.TypeScript.Syntax.JSX
211213
, Language.TypeScript.Syntax.TypeScript
212214
, Language.TypeScript.Syntax.Types
213215
, Language.PHP.Assignment
@@ -318,6 +320,7 @@ library
318320
, tree-sitter-python
319321
, tree-sitter-ruby
320322
, tree-sitter-typescript
323+
, tree-sitter-tsx
321324
, tree-sitter-java
322325
ghc-options: -Wall -Wmissing-export-lists -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -fno-warn-name-shadowing -j
323326
if flag(release)

src/Data/Abstract/AccessControls/Instances.hs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import qualified Language.Markdown.Syntax as Markdown
2222
import qualified Language.PHP.Syntax as PHP
2323
import qualified Language.Python.Syntax as Python
2424
import qualified Language.Ruby.Syntax as Ruby
25+
import qualified Language.TSX.Syntax as TSX
2526
import qualified Language.TypeScript.Syntax as TypeScript
2627
import Data.Quieterm
2728

@@ -454,25 +455,26 @@ instance AccessControls1 Ruby.LowPrecedenceOr
454455
instance AccessControls1 Ruby.Module
455456
instance AccessControls1 Ruby.ZSuper
456457

458+
instance AccessControls1 TSX.JsxElement
459+
instance AccessControls1 TSX.JsxOpeningElement
460+
instance AccessControls1 TSX.JsxSelfClosingElement
461+
instance AccessControls1 TSX.JsxAttribute
462+
instance AccessControls1 TSX.JsxNamespaceName
463+
instance AccessControls1 TSX.JsxText
464+
instance AccessControls1 TSX.JsxExpression
465+
instance AccessControls1 TSX.JsxClosingElement
466+
instance AccessControls1 TSX.JsxFragment
467+
457468
instance AccessControls1 TypeScript.AnnotatedExpression
458469
instance AccessControls1 TypeScript.JavaScriptRequire
459470
instance AccessControls1 TypeScript.Debugger
460471
instance AccessControls1 TypeScript.Super
461472
instance AccessControls1 TypeScript.Undefined
462473
instance AccessControls1 TypeScript.With
463-
instance AccessControls1 TypeScript.JsxElement
464-
instance AccessControls1 TypeScript.JsxOpeningElement
465-
instance AccessControls1 TypeScript.JsxSelfClosingElement
466-
instance AccessControls1 TypeScript.JsxAttribute
467474
instance AccessControls1 TypeScript.OptionalParameter
468475
instance AccessControls1 TypeScript.RequiredParameter
469476
instance AccessControls1 TypeScript.RestParameter
470-
instance AccessControls1 TypeScript.JsxNamespaceName
471-
instance AccessControls1 TypeScript.JsxText
472-
instance AccessControls1 TypeScript.JsxExpression
473-
instance AccessControls1 TypeScript.JsxClosingElement
474477
instance AccessControls1 TypeScript.ImplementsClause
475-
instance AccessControls1 TypeScript.JsxFragment
476478
instance AccessControls1 TypeScript.Import
477479
instance AccessControls1 TypeScript.QualifiedAliasedImport
478480
instance AccessControls1 TypeScript.QualifiedExportFrom

src/Data/Abstract/Evaluatable.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ instance HasPrelude 'Ruby where
163163
defineClass (Declaration (X.name "Object")) [] $ do
164164
defineBuiltIn (Declaration $ X.name "inspect") Default Public Show
165165

166+
instance HasPrelude 'TSX
167+
166168
instance HasPrelude 'TypeScript where
167169
definePrelude _ = do
168170
defineSelf

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)