remove rewriteNames option

This commit is contained in:
Chris Penner 2024-01-16 15:40:18 -08:00
parent 5679768c8c
commit 50c40501ec
2 changed files with 3 additions and 10 deletions

View File

@ -14,7 +14,7 @@ Supported features:
* Autocompletion
* Inline type and parser error messages
* Format on save
* Format on save (you can disable this in your editor if you like)
* Show type on hover
Notes:
@ -48,10 +48,7 @@ Supported settings and their defaults. See information for your language server
```json
{
// A suggestion for the formatter about how wide (in columns) to print definitions.
"formattingWidth": 80,
// Whether the formatter should rewrite your names for you, typically reducing them to their smallest unambiguous suffix,
// and introducing 'use' statements when necessary for disambiguoation.
"rewriteNamesOnFormat": true
"formattingWidth": 80
}
```

View File

@ -146,7 +146,6 @@ getParseNames = asks parseNamesCache >>= liftIO
data Config = Config
{ formattingWidth :: Int,
rewriteNamesOnFormat :: Bool,
-- 'Nothing' will load ALL available completions, which is slower, but may provide a better
-- solution for some users.
--
@ -161,14 +160,12 @@ instance Aeson.FromJSON Config where
maxCompletions <- obj Aeson..:! "maxCompletions" Aeson..!= maxCompletions defaultLSPConfig
Debug.debugM Debug.LSP "Config" $ "maxCompletions: " <> show maxCompletions
formattingWidth <- obj Aeson..:? "formattingWidth" Aeson..!= formattingWidth defaultLSPConfig
rewriteNamesOnFormat <- obj Aeson..:? "rewriteNamesOnFormat" Aeson..!= rewriteNamesOnFormat defaultLSPConfig
pure Config {..}
instance Aeson.ToJSON Config where
toJSON (Config formattingWidth rewriteNamesOnFormat maxCompletions) =
toJSON (Config formattingWidth maxCompletions) =
Aeson.object
[ "formattingWidth" Aeson..= formattingWidth,
"rewriteNamesOnFormat" Aeson..= rewriteNamesOnFormat,
"maxCompletions" Aeson..= maxCompletions
]
@ -176,7 +173,6 @@ defaultLSPConfig :: Config
defaultLSPConfig = Config {..}
where
formattingWidth = 80
rewriteNamesOnFormat = True
maxCompletions = Just 100
-- | Lift a backend computation into the Lsp monad.