Giter VIP home page Giter VIP logo

dartvs's Introduction

NOTE: This software is not being actively developed or maintained, however a Dart integration for Visual Studio Code is which can be found in the Visual Studio Marketplace and on GitHub

DartVS: Google Dart support for Visual Studio

Screenshot of DartVS

IMPORTANT!

The current version of DartVS available to install (v0.6) in Visual Studio is very basic and uses regex for syntax highlighting, and shells out to DartAnalyzer on a per-file basis for errors/warnings. This is not terribly reliable!

A new version of the extension (v0.8/v1) is in-progress which uses Google's Dart Analysis service and is much faster and more reliable, however it's not yet ready for release :(

  • Live in v0.6
    • Use DartAnalyzer from the SDK when saving any .dart file and report errors/warnings/hints to the Visual Studio error list
    • Clicking errors navigates to the correct place in code
    • Mostly-reliable Syntax Highlighting
  • In Development for v1
  • Planned for after v1

Installation

Using a custom SDK

If you wish to use a different version of the SDK than the one bundled with DartVS (for example, a dev channel build), you can:

  • Download and unzip a Dart SDK
  • Set the DART_SDK environment variable to point at the SDK root

Feedback

Please send your feedback/issues/feature requests! :-)

dartvs's People

Contributors

dantup avatar madskristensen avatar sharwell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dartvs's Issues

Support Visual Studio 2012

[DanTup: Please comment on this issue if you would like VS 2012 support. It's a pain in the ass; but I might do it if there's enough people wanting it]

Hi Dan,

Thanks for your efforts, such a plugin is very welcome.
At the moment I am unable to install it: it doesn't show up in the Visual Studio Gallery (Extensions and updates), when I search with Dart or DartVS it is not found.
When I doubleclick the vsix download i get the message: Installation Failed, This extension is not installable on any currently installed products. This is strange because I have installed VS 2008, VS2010, VS2010 Express, VS2012, VS2012 Express. What could be the cause of this installation failure ?

Thanks very much,
Ivo

Run "pub get" after initial creation of project from templates

Currently, many of the project templates will show errors/warnings, because they have code in them (eg. tests) that use packages that need restoring.

We should execute pub get as part of the new project creation. Note: it might take some time (downloading from the web) or even fail!

getHover is called frequently as mouse moves

For some reason the applicableSpan doesn't update properly; so VS keeps triggering the QuickInfoSourceProvider on every mouse twitch, even if it's still within the required area :(

Some error squiggles do not appear as expected

If you type nonsense at the end of the file; an error shows up in the Errors List, but no squiggle in the editor.

Seems to be caused by the offset/length indicating the character after the end of the file.

"pub build" integration

pub build is for packing up an app ready to deploy. It runs all transformers, which includes converting Dart code into JavaScript so that it can run in standard modern browsers. It delets the build folder (if exists) and then builds the packaged version there. The build folder would generally be excluded from source control and instead used as the package for deployment.

Although i's called build, I don't know if it's close enough to a normal build to be hooked into any build actions in VS; it's more like a "publish".

pub build would always be executed in the project root.

Automatic insertion of comment lines when typing Dart docs

When typing Dart docs, it'd be nice if pressing Enter correctly inserted a *_ (where _ is a space character) at the right indent level ready for you to just type the next part of the comment (and also insert the closing */ when the /** is typed.

Warnings appear/disappear during typing

When typing (eg. a method name), the error window flickers between "1 warning" and 0 warnings". At no points were there "0 warnings" (until you finished typing).

Analysis service is sending an empty set of errors (possible due to the way it does multiple passes):

STDIN:  {/*...*/,"method":"analysis.updateContent"}
STDOUT: {"id":"28"}
STDOUT: {"event":"analysis.errors","params":{"file":"M:\\Coding\\Games\\dart_games\\web\\main.dart","errors":[]}}
STDOUT: {"event":"analysis.errors","params":{"file":"M:\\Coding\\Games\\dart_games\\web\\main.dart","errors":[/*...actual errors...*/]}}

We should see if there's a way to suspend handling errors until the last event (which is a superset of all issues).

Cannot scan projects using DTE

The IsDartProject scanning operation has an enormous performance impact on large projects, even if they do not have any Dart files. Instead of preemptively scanning, it should only treat a project as a Dart project the first time a .dart file is opened (or via some other mechanism, such as a solution option, etc.).

"pub serve" + "pub run" integration

pub serve and pub run are used for launching web and/or command line apps. These are the commands that make most sense to be bound to F5.

[ ] Allow user to set startup object
[ ] If the "startup item" is set to something in the web folder, use pub serve
[ ] If the "startup item" is set to an html file in the test folder, use pub serve test
[ ] If the "startup item" is set to a dart file, then pub run should be used
[ ] Allow the user to set browser to use for pub serve, including Dartium user-data-dir

pub serve

  1. Execute pub serve from the project root (if it is not already running)
  2. Launch the default browser for the pub site (localhost:8080/ *) with the startup file tagged on the end
  3. A port number can be provided, which might be best, to avoid clashes with multiple projects open

pub serve should be run like IIS Express; the process should be kept live, even if the user closes the browser and is not debugging; as the development cycle will involve changing files in VS, alt+tabing back to the browser and hitting refresh. Unlike IIS Express, there is no systray icon or any indication for the user that it's running; so we must stop the process on exist/project unload, and seamlessly reuse the process if it's already running and the user hits F5.

pub serve test

This is the same as pub serve but points at the test folder; allowing tests to be executed in the browser.

pub run

  1. Execute pub run {path to file} from the project root

pub run executes the provided Dart script, but will automatically restore packages, run transformers (etc.) before running. Although we could instead use dart.exe {path to file} I think using pub would be more user-friendly, as if the user has opened a project they've cloned from the web, they wouldn't need to remember to run pub get first.

Improve display/handling of pub packages in solution tree

Pub packages work a bit like NuGet packages in Dart; and live in the packages folder.

The list of packages is stored in pubspec.yaml in the dependencies section. This only lists the packages you directly add; dependencies of dependencies will live in the packages folder even though they're not in this file.

Currently, the folders inside the packages folder (one per package) are symlinks back to a "pub cache" (eg. C:\Users\Danny\AppData\Roaming\Pub\Cache) though this may change in the future.

Additionally, pub creates packages symlinks as subfolders of many other folders (eg. bin, web). This means rendering the entire tree will have a bunch of duplicated folders:

  • bin
  • - packages
  • web
  • - packages
  • packages
  • pubspec.yaml

I think it might be best for us to:

  1. Render the packages folder as the references folder in the current implementation (so it appears at top, and is "special", allowing for future functionality like a pub package search)
  2. Hide all further nested packages folders from the solution tree
  3. Indicate the difference between packages in pubspec.yaml vs those that just exist on disk (indirect dependencies)

Support getOverrides

I'm not sure what getOverrides is for in the analysis service yet (maybe code-completion for base class method names?), but we probably want it!

"pub get" integration

pub get is equivalent to "nuget package restore". It causes pub to read all of the dependencies from pubspec.yaml and download any that are missing; and remove any that are no longer referenced.

We should execute pub get in the project root whenver pubspec.yaml is saved. This command might take some time (it may download from the web) and also may fail with error messages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.