Skip to content
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

Support development of VM based Dart code in editor #796

Closed
danrubel opened this issue Dec 10, 2011 · 7 comments
Closed

Support development of VM based Dart code in editor #796

danrubel opened this issue Dec 10, 2011 · 7 comments
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@danrubel
Copy link

[user feedback]
I would desire is ability to debug and run it on dart vm.

////////////////////////////////////////////////////////////////////////////////////
Editor Version: 2324
OS: Linux
////////////////////////////////////////////////////////////////////////////////////

@whesse
Copy link
Contributor

whesse commented Dec 12, 2011

The current blocking bug on doing this is that the editor uses the dartc compiler to detect syntax errors, and the native keyword is supported by dartc only on static methods. The VM server-side libraries use native on static and instance methods, to specify a C++ implementation. This causes a syntax error when importing the libraries, in order to do type-checking on your code.

Without that syntax error, one can make a library that sources all the server-side libraries, and import that library in your files. But we would like better support for editing server-side code in the editor - right now we cannot effectively use it.

@DartBot
Copy link

DartBot commented Dec 12, 2011

This comment was originally written by [email protected]


We should be able to deal with the native keyword as used by the server code.

@sgjesse
Copy link
Contributor

sgjesse commented Dec 12, 2011

I don't think we need to support the native keyword as it is used by the Dart code internal to the VM. When developing Dart code supposed to run on the VM we need to provide a library which sources all the interfaces public classes for Sokcet, File, etc. that is provided by the VM - not the actual implementation.

@DartBot
Copy link

DartBot commented Dec 12, 2011

This comment was originally written by [email protected]


If the ETA for the library is soon then agree. Otherwise, it would be a < 5minute fix to the dartc code.

@whesse
Copy link
Contributor

whesse commented Dec 12, 2011

I have created an importable library that provides the interfaces, but not the implementations, of the server-side libraries. Importing it into all your (server-side) Dart files lets the editor compile them without finding compilation errors, and provides code completion for the server-side classes.

I just concatenated all the public server-side interfaces, and removed the factory declarations.

Using this has already shown me many type errors in the code I'm working on. Of course, the editor won't produce a runnable project, since it doesn't use the VM.
I attach the file, which I place in the runtime/bin directory. To easily include and exclude it from your code, you can place a tiny source file foo.dart in your project directory, with contents "#import("path_to_dart_root/runtime/bin/server_library_interfaces.dart")", and just source it from all your files. Then just comment out the line in foo, to make your project compile in the VM.


Attachment:
server_library_interfaces.dart (26.33 KB)

@danrubel
Copy link
Author

I have some pending CLs that will help in this area. In addition, Dan G and I are working towards an SDK consumable by Editor which includes VM libs.

@sgjesse
Copy link
Contributor

sgjesse commented Dec 14, 2011

Added Duplicate label.
Marked as being merged into #457.

@danrubel danrubel added Type-Enhancement closed-duplicate Closed in favor of an existing report labels Dec 14, 2011
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants