reach-sh / reach-ide Goto Github PK
View Code? Open in Web Editor NEWIDE support for the Reach DApp programming language
Home Page: https://marketplace.visualstudio.com/items?itemName=reachsh.reach-ide
License: Eclipse Public License 2.0
IDE support for the Reach DApp programming language
Home Page: https://marketplace.visualstudio.com/items?itemName=reachsh.reach-ide
License: Eclipse Public License 2.0
Each time you run the extension, it creates a temp folder with a random suffix. Reach creates a Docker network using this folder name. Eventually if you have too many Docker networks, compile highlighting no longer works and the following error can be seen in the Reach IDE output logs:
Command failed: cd /var/folders/5v/nrjqxr7s3l5g1mm1l2ngjg8r0000gn/T/reach-ide-PMUN3K && /Users/eric/reach/tut/reach compile index.rsh
Creating network "reach-ide-pmun3k_default" with the default driver
could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
As a workaround, run docker network prune
to delete unused networks.
To fix this, the temp folder should use a consistent name instead of random name. Or revert to building within (a subfolder of) the project dir instead.
Right now you are doing a noble job parsing the errors, but it would be pretty easy for us to add a command-line option and mode to produce JSON-formatted error messages for a tighter integration.
Clean up unnecessary logging from the VS Code output console.
.rsh files should be associated in the VSCode client instead of the server, since the server should be IDE agnostic.
The following error Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'? is found in buttons.ts.
Problem:
In newer versions of TypeScript 4.1.x the following syntax is not supported and will produce the above error.
function removeAllButtons() { return new Promise((resolve, reject) => { shownButtons.forEach(button => button.hide()); shownButtons = []; resolve(); }); }
Fix:
resolve is unknown in this context I assume and thus the following syntax works without error.
function removeAllButtons() { return new Promise<void>((resolve, reject) => { shownButtons.forEach(button => button.hide()); shownButtons = []; resolve(); }); }
When working with Reach IDE extension and building and running the extension project in a new Extension Development Host window. I get the following error.
Step to reproduce:
= git clone the Reach IDE project
= install necessary npm packages
= compile and run the extension within the extension development host
Expected outcome:
= I think this should create a gist file for easier reporting in the help section in the Reach discord channel.
Currently automatic compilations make a temporary copy of the source file and compile it into the build directory. Use a temp dir for these instead.
e.g. quickfix based on suggestions from
Did you mean: ["declassify","assert","assume","closeTo","Player"]
Existing copyright notices should not be removed as per the following section in the EPL v2.0 license:
3.3 Contributors may not remove or alter any copyright, patent,
trademark, attribution notices, disclaimers of warranty, or limitations
of liability ("notices") contained within the Program from any copy of
the Program which they Distribute, provided that Contributors may add
their own appropriate notices.
Please restore the copyright notices from the following commits, and add Reach copyright notices as a separate line.
108fb96#diff-7b7aa9c8b1944a19471cbe4172196463223080d88b4433c79933f3a47f8ca0f3
108fb96#diff-4398e3b2ab3e7e7e70a93409fa893abf68608d45a5ad1ac7faaf888dac77005d
The compiler currently throws out a lot of information if theorem errors occur. Determine which parts of the theorem failure information are relevant for an IDE scenario, and how it should be presented (e.g. using diagnostic highlighting as with other errors, or something in addition to that).
compiler gives error: error: ./.index.rsh.temp:18:26:application: Invalid function appication. Expected 2 args, got 1 for function defined at reach standard library:33:27:function exp
index.rsh:
'reach 0.1';
const Player =
{ getHand: Fun([], UInt256),
seeOutcome: Fun([UInt256], Null) };
export const main =
Reach.App(
{},
[['Alice', Player], ['Bob', Player]],
(A, B) => {
A.only(() => {
const handA = declassify(interact.getHand()); });
A.publish(handA);
commit();
B.only(() => {
const handB = add(interact.getHand());
});
B.publish(handB);
const outcome = (handA + (4 - handB)) % 3;
commit();
each([A, B], () => {
interact.seeOutcome(outcome); });
exit(); });
extension gives error:
CallStack (from HasCallStack):
error, called at src/Reach/AST.hs:58:3 in reach-0.1.2-KZ4oXxVSV3mFfbu8tz29Bg:Reach.AST
expect_throw, called at src/Reach/Eval.hs:356:10 in reach-0.1.2-KZ4oXxVSV3mFfbu8tz29Bg:Reach.Eval
/Users/eric/git/reach-ide/server/out/server.js:278
problematicString = problematicString.substring(0, problematicString.length - 1); // remove trailing period at end of sentence
^
TypeError: Cannot read property 'substring' of undefined
at findErrorLocations (/Users/eric/git/reach-ide/server/out/server.js:278:47)
at /Users/eric/git/reach-ide/server/out/server.js:180:38
at ChildProcess.exithandler (child_process.js:311:5)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)
include basic template
e.g. blank file or file with just 'reach 0.1'
Current hover content is in Markdown that has a lot of content which is hard to read in text-based editors such as Vim or Neovim. See screenshots below. It would be helpful if the server can accept a setting (passed from the client) to produce hover content in a simpler Markdown format (perhaps without links) or in plaintext.
If the language client passes null settings, the following error occurs:
reach-language-server: (node:76751) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'executableLocation' of null
reach-language-server: at /Users/eric/git/reach-ide/server/out/server.js:201:37
reach-language-server: at Generator.next (<anonymous>)
The issue occurs at this line: https://github.com/reach-sh/reach-ide/blob/master/server/src/server.ts#L257
To reproduce this, follow steps at https://github.com/ericglau/sublime-reach but remove the following section from the configuration:
"settings": {
"reachide": {
"executableLocation": "./reach"
}
}
Get Ethereum ABI
Get Ethereum bytecode
Right now, you're doing a manual process to get the documentation. However, we could modify the Reach documentation generator (https://github.com/reach-sh/reach-lang/tree/539a63081329e64638fc8776eeef2b2a26c993f7/docs-src) to (a) generate a Markdown version and (b) provide a cross-reference file with all of the tokens with corresponding links to the documentation. I'm not sure what the constraints of VSCode are, but I'd love to help you make it better.
When working with Reach IDE extension and building and running the extension project in a new Extension Development Host window. I get the following error.
Step to reproduce:
= git clone the Reach IDE project
= install necessary npm packages
= compile and run the extension within the extension development host
Snippets are currently defined in https://github.com/reach-sh/reach-ide/blob/master/snippets.json which are outside of the language server. To enable to snippets to be used with other language clients for editors aside from VS Code, the snippets should be regisitered in the language server as CompletionItem
s
Visual Studio code produces the following errors when running Launch Client IDE.
Step to reproduce:
= git clone and install necessary npm packages
= Run Reach Launch Client
You will see the following errors.
Expected outcome:
Launch client should run without error.
Proposed fix:
The use of single quotes and semi-colons.
use
const TEST_ETH_PRIVATE_KEY = '0x422c874bed50b69add046296530dc580f8e2e253879d98d66023b7897ab15742';
instead of
const TEST_ETH_PRIVATE_KEY = "0x422c874bed50b69add046296530dc580f8e2e253879d98d66023b7897ab15742"
Will fix this issue and have the Launch Client run as expected.
In your IDE (and pitch video), you copy & paste the Ethereum bytecode & ABI and interact with them directly. The model of Reach is that your front-end program would be responsible for doing deployment and would do so programmatically. The end-to-end tests do this on a development node, but in the "real world" it would also be done by the application.
We're about to update the documentation with a walk-through of React apps that deploy and drive Reach-implemented dApps --- https://github.com/reach-sh/reach-lang/tree/master/react-examples/overview --- and they demonstrate the way we imagine this working. In particular, using the programmatic method retains the blockchain agnosticism of Reach (right now, you can deploy on Ethereum AND Algorand!)
I'd love to talk to you about this and get your perspective.
Handle this syntax: error, ./.index.rsh.temp,8,8,dot, AApp is not a field of Reach. Did you mean, ["App"]
Currently this repo has two projects:
https://github.com/reach-sh/reach-ide/tree/master/server - which is the Reach language server
https://github.com/reach-sh/reach-ide/tree/master/client - which is the VS Code client that uses the Reach language server
It would be useful to separate code for the Reach language server into a different GitHub repo where it can be published separately as an npm package. Then the VS Code client and any other language client (such as for Vim or Sublime) can just pull it in as an npm dependency.
(It may not be strictly necessary to use a different repo -- the main suggestion here is to publish the server as an npm package. But separating the repos could make it cleaner since VS Code will just be one of the clients.)
@chrisnevers Any thoughts on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.