-
Notifications
You must be signed in to change notification settings - Fork 461
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
Unable to get IDE support in VSCode working #3454
Comments
It seems running |
|
I tried doing a 'cabal clean' + running the VSCode command 'Haskell: Restart Haskell LSP server', but I still got the error. |
I'm having the same issue |
Same issue over here |
Fixes have now landed on plutus-starter input-output-hk/plutus-starter#29. Just ensure the flag defer-plugin-errors is enabled. Please reopen if you're still experiencing any problems Thanks @silky for putting a new release of the container and bumping |
Area
[X] Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
[X] Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
[-] Marlowe Related to Marlowe
[X] Other Any other topic (Playgrounds, etc.)
Summary
I'm having troubles setting up VSCode to have code completion while developing with Plutus.
The cleanest solution I have tried was to use a fresh Ubuntu VM in VirtualBox and start from the "plutus-starter" project:
https://github.com/input-output-hk/plutus-starter
The full error can be found below, here is the start:
Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Eq.$fEqByteString
Steps to reproduce
VM (more than 1 cpu is needed otherwise haskell-language-server hangs)
Install Ubuntu
Install Docker
Install VSCode
Install the VSCode Remote Development extension pack
Clone https://github.com/input-output-hk/plutus-starter
Execute 'mkdir -p ~/.cabal/packages'
Open plutus-starter in VSCode, It will ask if you want to open it in the container, say yes.
Execute 'cabal update' in terminal
Execute 'cabal install' in terminal
Open the file examples/src/Plutus/Contracts/Game.hs in VSCode
Click in the file and wait for the processing to be done
Expected behavior
There should be no errors in the IDE since 'cabal build' is successful
See the attached screenshot to see the error I get
System info (please complete the following information):
Screenshots and attachments
Additional context
Note I get the same error message when executing 'haskell-language-server' directly in the terminal.
Complete error message:
Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Eq.$fEqByteString
[DFunId(nt)]
No unfolding
Context: Compiling expr: PlutusTx.Eq.$fEqByteString
Context: Compiling expr: PlutusTx.Eq.$fEqByteString
cast
(PlutusTx.Eq.N:Eq[0] <Data.ByteString.Internal.ByteString>_N:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool))
Context: Compiling expr: (PlutusTx.Eq.$fEqByteString
cast
(PlutusTx.Eq.N:Eq[0] <Data.ByteString.Internal.ByteString>_N:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
cast
(Plutus.Contracts.Game.N:HashedString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.HashedString
Data.ByteString.Internal.ByteString))
Context: Compiling expr: (PlutusTx.Eq.$fEqByteString
cast
(PlutusTx.Eq.N:Eq[0] <Data.ByteString.Internal.ByteString>_N:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
cast
(Plutus.Contracts.Game.N:HashedString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.HashedString
Data.ByteString.Internal.ByteString))
(PlutusTx.Builtins.sha2_256
(ds_dqOD
cast
(Plutus.Contracts.Game.N:ClearString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.ClearString
Data.ByteString.Internal.ByteString)))
Context: Compiling expr: \ (ds_dqOD [Occ=Once]
:: Plutus.Contracts.Game.ClearString) ->
(PlutusTx.Eq.$fEqByteString
cast
(PlutusTx.Eq.N:Eq[0] <Data.ByteString.Internal.ByteString>_N:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
cast
(Plutus.Contracts.Game.N:HashedString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.HashedString
Data.ByteString.Internal.ByteString))
(PlutusTx.Builtins.sha2_256
(ds_dqOD
cast
(Plutus.Contracts.Game.N:ClearString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.ClearString
Data.ByteString.Internal.ByteString)))
Context: Compiling expr: \ (ds_dqOC [Occ=Once]
:: Plutus.Contracts.Game.HashedString)
(ds_dqOD [Occ=Once] :: Plutus.Contracts.Game.ClearString) ->
(PlutusTx.Eq.$fEqByteString
cast
(PlutusTx.Eq.N:Eq[0] <Data.ByteString.Internal.ByteString>_N:: GHC.Types.Coercible
(PlutusTx.Eq.Eq Data.ByteString.Internal.ByteString)
(Data.ByteString.Internal.ByteString
-> Data.ByteString.Internal.ByteString -> GHC.Types.Bool)))
(ds_dqOC
cast
(Plutus.Contracts.Game.N:HashedString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.HashedString
Data.ByteString.Internal.ByteString))
(PlutusTx.Builtins.sha2_256
(ds_dqOD
cast
(Plutus.Contracts.Game.N:ClearString[0]:: GHC.Types.Coercible
Plutus.Contracts.Game.ClearString
Data.ByteString.Internal.ByteString)))
Context: Compiling definition of: Plutus.Contracts.Game.isGoodGuess
Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess
Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess hs
Context: Compiling expr: Plutus.Contracts.Game.isGoodGuess hs cs
Context: Compiling expr: \ _ [Occ=Dead] ->
Plutus.Contracts.Game.isGoodGuess hs cs
Context: Compiling expr: \ (cs [Occ=Once]
:: Plutus.Contracts.Game.ClearString)
_ [Occ=Dead] ->
Plutus.Contracts.Game.isGoodGuess hs cs
Context: Compiling expr: \ (hs [Occ=Once]
:: Plutus.Contracts.Game.HashedString)
(cs [Occ=Once] :: Plutus.Contracts.Game.ClearString)
_ [Occ=Dead] ->
Plutus.Contracts.Game.isGoodGuess hs cs
Context: Compiling definition of: Plutus.Contracts.Game.validateGuess
Context: Compiling expr: Plutus.Contracts.Game.validateGuess
Context: Compiling expr at "main:Plutus.Contracts.Game:(102,8)-(102,46)"
The text was updated successfully, but these errors were encountered: