ddrone
April 16, 2022, 10:59am
1
When completing function names, VSCode extension inserts placeholders for function arguments containing their types. For example, completing fromMaybe
results in fromMaybe a (Maybe a)
inserted into the program. I don’t want this behaviour - is there a way to turn it off? I want only the function name to be inserted when doing the completion.
I’ve looked through the extension settings and haven’t found anything relevant - web search didn’t help either.
It’s an option in the extension settings. It has a slightly odd name iirc. It could also be global settings - but it’s definitely a flippable switch.
I think this might be helpful.
opened 12:21PM - 16 Mar 22 UTC
closed 05:51PM - 18 Mar 22 UTC
type: question
type: discussion
### Discussed in https://github.com/haskell/haskell-language-server/discussions/… 2785
<div type='discussions-op-text'>
<sup>Originally posted by **Eason0210** March 16, 2022</sup>
I use Emacs + eglot + company + yasnippet, when I insert the name of a type( Int Double or Float), HLS will insert a space after it.
Any one known how to disable this feature?
For example: I input `length' :: [Int]` , and I will get ` length' :: [Int ]`
<img width="485" alt="image" src="https://user-images.githubusercontent.com/47546452/158523169-8cd92b1c-10c0-4a57-8398-96a14ed9d147.png">
<img width="213" alt="image" src="https://user-images.githubusercontent.com/47546452/158523495-eee1948a-a1e2-4b36-8f0a-5c912525680f.png">
The same issue also happened on vscode
From the *EGLOT event* log, you can see HLS return is` "Int "`
```
[stderr] 2022-03-16 17:40:00.516289 [ThreadId 171] INFO hls: finish: Completion (took 0.00s)
[server-reply] (id:2) Wed Mar 16 17:40:01 2022:
(:id 2 :jsonrpc "2.0" :result
(:isIncomplete t :items
[(:detail ":: Type" :documentation
(:kind "markdown" :value "*Imported from 'Prelude'*\n* * *\n\n")
:insertText "Int " :insertTextFormat 2 :kind 22 :label "Int" :sortText "00")
(:detail ":: Type" :documentation
(:kind "markdown" :value "*Imported from 'Prelude'*\n* * *\n\n")
:insertText "Integer " :insertTextFormat 2 :kind 22 :label "Integer" :sortText "01")
(:detail ":: Type -> Constraint" :documentation
(:kind "markdown" :value "*Imported from 'Prelude'*\n* * *\n\n")
:insertText "Integral ${1:Type}" :insertTextFormat 2 :kind 8 :label "Integral" :sortText "02")
# .... more ....
```
Emacs 29.0.50
Mac OS 12.3
HLS: 1.6.1.0
</div>
ddrone
April 23, 2022, 9:41am
4
Thanks, this helped! For the record, adding
"haskell.plugin.ghcide-completions.config.snippetsOn": false
to VSCode’s settings.json solves the problem.
3 Likes