Skip to content

Always use utf-8 when opening file handles #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{-# LANGUAGE RecordWildCards #-}
module Main(main) where

import Main.Utf8 (withUtf8)

import Ide.Arguments (Arguments (..), LspArguments (..),
getArguments)
import Ide.Main (defaultMain)
Expand Down Expand Up @@ -72,7 +74,7 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
-- ---------------------------------------------------------------------

main :: IO ()
main = do
main = withUtf8 $ do
args <- getArguments "haskell-language-server"

let withExamples =
Expand Down
3 changes: 2 additions & 1 deletion exe/Wrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module Main where

import Control.Monad.Extra
import Main.Utf8
import Data.Foldable
import Data.List
import Data.Void
Expand All @@ -23,7 +24,7 @@ import System.Process
-- ---------------------------------------------------------------------

main :: IO ()
main = do
main = withUtf8 $ do
-- WARNING: If you write to stdout before runLanguageServer
-- then the language server will not work
args <- getArguments "haskell-language-server-wrapper"
Expand Down
2 changes: 2 additions & 0 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ executable haskell-language-server
, time
, transformers
, unordered-containers
, with-utf8

if flag(agpl)
build-depends: brittany
Expand Down Expand Up @@ -177,6 +178,7 @@ executable haskell-language-server-wrapper
, hie-bios
, optparse-applicative
, optparse-simple
, with-utf8
, process

default-language: Haskell2010
Expand Down