mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Merge pull request #860 from github/bump-tree-sitter-parsers
Set a default encoding to utf8 and bump tree sitter parsers
This commit is contained in:
commit
39f3fcb2af
@ -29,6 +29,7 @@ import Syntax
|
||||
import System.Directory
|
||||
import System.FilePath
|
||||
import qualified System.IO as IO
|
||||
import System.Environment (lookupEnv)
|
||||
import Term
|
||||
import TreeSitter
|
||||
import Text.Parser.TreeSitter.Language
|
||||
@ -158,7 +159,10 @@ printDiff parser arguments sources = do
|
||||
writeToOutput :: Maybe FilePath -> Text -> IO ()
|
||||
writeToOutput output text =
|
||||
case output of
|
||||
Nothing -> TextIO.putStr text
|
||||
Nothing -> do
|
||||
lang <- lookupEnv "LANG"
|
||||
if isNothing lang then IO.hSetEncoding IO.stdout IO.utf8 else pure ()
|
||||
TextIO.hPutStrLn IO.stdout text
|
||||
Just path -> do
|
||||
isDir <- doesDirectoryExist path
|
||||
let outputPath = if isDir
|
||||
|
2
vendor/tree-sitter-parsers
vendored
2
vendor/tree-sitter-parsers
vendored
@ -1 +1 @@
|
||||
Subproject commit 65dbeffe72d53d4547f63077bdf4ca6b986129df
|
||||
Subproject commit 8348194cc52b4b9fd61e3988b9526b54ebfef920
|
Loading…
Reference in New Issue
Block a user