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

Integrate into dart editor pubspec editor #17

Open
seaneagan opened this issue Feb 12, 2015 · 7 comments
Open

Integrate into dart editor pubspec editor #17

seaneagan opened this issue Feb 12, 2015 · 7 comments

Comments

@seaneagan
Copy link
Owner

To do all the following while preserving the pubspec's formatting:

  • create pubspec with nice defaults
  • update pubspec
  • install / uninstall dependencies
  • show outdated status of / update dependencies
  • bump version

Should probably use #5, rather the the command line API.

@seaneagan
Copy link
Owner Author

Hey @devoncarew you have a lot of editor knowledge, and you integrated the stagehand CLI. Do you have any thoughts on how this could be achieved? Looks like right now it's all Java based, so seems like CLI would be the only option? Any pointers or help would be much appreciated!

@devoncarew
Copy link

Yeah, stagehand would be a similar scenario. For background, stagehand is meant to be driven in one of three different ways:

  • via a Dart API (used by dart clients, like CDE)
  • via a command line (by users directly)
  • driven by tools (by the command line interface, with some hidden options for some commands)

The Java code in the Editor would need to use that third option (or just the 2nd, if no specific machine parsing / commands were required). This would also be useful to clients like Sublime (written in Python), and IntelliJ.

If you wanted to use the Dart API, you'd need to add support to den into the analysis server. The clients would all need to add UI to drive den, they'd just be issuing commands to the analysis server rather than to the den command-line tool. So, no reduced work on their part.

@keertip wrote the Editor's pubspec file editor. Some of the integration would be pretty simple, some would be pretty involved. Higher value commands with simpler integrations would be the place to start :)

@keertip
Copy link

keertip commented Feb 19, 2015

Agree with the points made by @devoncarew . It would be great if analysis server had den support! Then the editor would not have to install yet another tool. Adding ui to the pubspec editor is fairly simple, we just need to make sure the commands added do provide needed/missing functionality in the editor.

@seaneagan
Copy link
Owner Author

Thanks @devoncarew and @keertip!

@keertip I think the most bang for buck integration to start with would be running den spec --force when someone creates a pubspec. Then when the pubspec file editor appears, the fields would be pre-populated with useful defaults based on their git info etc. There would be no new UI needed for this, just an initialization step. Would you be able to point me to where in the code that initialization step would occur? I assume the pubspec editor would just need to call an API to get the initial yaml and it could initialize its fields from that? That could easily be added as e.g. den spec --dry-run whose stdout would represent the initial yaml. Adding it to the analysis server would be much more difficult for me, especially since the source is not yet on github. But I will look into it if you don't think calling the CLI is an option. What do you think?

I am hoping that den fetch and den pull will be available through the analysis_server via the linter. I'm imagining this and other "pubspec lints" showing up as warning indicators within the pubspec editor on the associated elements (the individual dependencies in this case). Then the "quick fixes" (in this case to update to the latest dependency constraint) could be exposed via a context menu, or the dependency detail pane.

@keertip
Copy link

keertip commented Feb 19, 2015

@seaneagan Take a look at http://bit.ly/181QmFN. The NewFileGenerator is where the editor gets the contents for a new pubspec file.

@pq
Copy link

pq commented Feb 20, 2015

+1 to pub lints!

While we're on the topic of integration, we should think about IDEA/Webstorm as well. I did the stagehand integration (cribbing off Devon's editor bits to be sure) and would be happy to help shore that up.

@seaneagan
Copy link
Owner Author

Filed an issue to move analysis_server to its own github repo:

http://github.com/22566

in which case I would be happy to add den functionality to it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants