tgrospic / rholang-vscode

Rholang extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tgrospic.rholang
MIT License
9 stars 6 forks source link

deployerId gets error #2

Closed jimscarver closed 3 years ago

jimscarver commented 4 years ago

if we use deployerId in our rholang code we get an error that interferes with syntax checking.

tgrospic commented 4 years ago

@jimscarver does the code work if you manually execute it with rnode eval?

jimscarver commented 4 years ago

no we get

Error: coop.rchain.rholang.interpreter.errors$NormalizerError: `rho:rchain:deployId` was used in rholang usage context where DeployId is not available.

We do get syntax errors before this error but the error supersedes * and @ errors.

tgrospic commented 4 years ago

This returns syntax error before DeployId error.

new return(`rho:rchain:deployId`), ch in {
  for (_ <- *ch) { Nil }
}
// Error: coop.rchain.rholang.interpreter.errors$SyntaxError: syntax error(): * at 2:13-2:14

But with similar proc/name syntax error, DeployId error is returned.

new return(`rho:rchain:deployId`), ch in {
  for (x <- ch) { x }
}
// Error: coop.rchain.rholang.interpreter.errors$NormalizerError: `rho:rchain:deployId` was used in rholang usage context where DeployId is not available.

I agree, this is not exactly what is expected but inside extension I cannot change this behavior. What node returns on Eval and prints to the standard output is displayed in the editor.

I created a ticket so we can improve that. https://rchain.atlassian.net/browse/RCHAIN-4071

For the future, I'd also like to be able to manipulate system names from Rholang. :smiley:

new override(`rho:internal:override`), myDeployId in {
  override!("rho:rchain:deployId", *myDeployId) |
  contract myDeployId(@val) = {
    new out(`rho:io:stdout`) in {
      out!(val)
    }
  }
}
tgrospic commented 4 years ago

Closing the ticket because behavior is not under control of VSCode extension but RNode itself.

dckc commented 4 years ago

I wish you wouldn't consider this out of scope. There are other ways to use RNode than eval. In order to use the registry etc., a local validator is really necessary for contract development.

tgrospic commented 4 years ago

Reopening this issue because it's related to #9 PR which should add option to remove some special names not available in eval mode.

@dckc I'm not clear what would be the best/useful way to work in "deploy mode". E.g. how to manage keys or what kind of development workflow to support. I'd appreciate if you can add some ideas or situations you are thinking. I was looking at IBM extension for VSCode as an example. https://github.com/IBM-Blockchain/blockchain-vscode-extension

dckc commented 4 years ago

https://github.com/rchain-community/rchain-docker-shard supports a standalone validator and has some test key management.

I have been doing something similar with a klunky makefile, but I hope to switch to using that.

jimscarver commented 3 years ago

This should be tagged a bug not an enhancement since the whole file showing as an error if deployerid or deployid is mentioned is a BUG. Pull request #9 should fix it!!!!!

dckc commented 3 years ago

If it's a bug, it's a bug in rnode, not in this extension.

The enhancement here is to work around this rnode limitation by filtering out the offending stuff. As I noted in #9 that looks like a reasonable step forward.

Meanwhile, I still hope for support for (exploratory) deploy, not just eval: #10

jimscarver commented 3 years ago

we still get the error and the plugin is useless. Do we need to fork this repo to get it fixed?

tgrospic commented 3 years ago

@jimscarver with your PR #9 merged, I published the new release of the plugin so names that you want to be removed can be set in settings. I marked this as experimental settings and it's disabled by default. Please add more details so we can dig into what happened wrong.

I hope to see more forks with new and better ideas! :wink:

jimscarver commented 3 years ago

Awesome! vscode is useful for rholang with the experimental setting.