guillermooo / dart-sublime-bundle Goto Github PK
View Code? Open in Web Editor NEWSublime Text 3 Dart Package
License: BSD 3-Clause "New" or "Revised" License
Sublime Text 3 Dart Package
License: BSD 3-Clause "New" or "Revised" License
The linter currently shows the output panel no matter what, which can be too distracting.
1a) so I assume the basic setup is correct
2a) using zsh always throws a "zsh:1: command not found" error
What am I missing ?
I will leave basic setup instructions in the README so people can get up and running quickly. The rest of the content will now live in the wiki.
About the wiki
It seems GH doesn't support PRs to wiki content, so I'll push directly to the wiki (I think wikis are public by default).
Is it possible to extract documentation from files on-demand? That'd be useful.
We have two options to add tests for Python code in this package:
This is the approach I've taken with Vintageous, when there was no alternative back then.
Once we have tests, we can use UnitTesting with Travis. I'm using it with Vintageous and it's working great.
Random remarks:
Testing ST plugins while developing isn't a great experience, but it's bearable.
Adding tests will litter the repository with files of no interest for end-users. I'm no expert with Package Control, but perhaps it offers a means to filter files for distribution; we could investigate that. Also, I think it'd be tidier to distribute this package as a .sublime-package and I don't see any reason why not to. (This is a topic for a different discussion, though.)
If we wanted to have tests, I could look at setting everything up.
I'd like to run my HTML file in Dartium with a simple launch key command. Also, Dartium should start in checked mode.
I don't know whether we can tell Package Control to exclude/include specific files and folders, but I don't see why we could not distribute this package in a tidier way.
All in all, I don't think it makes much of a difference; just less garbage files in the target system.
If we do,though, remember to distribute files as precompiled Python files at some point. pyo files don't get cached in zipped Python packages, so there might by a small performance penalty at load time if we used the .py files and we had many of those and they were large. Not our case at present.
Not really a issue, but in some cases I want to add the --minify flag to my dart2js command.
The 'this' keyword should be highlighted.
Example
class Rectangle {
num left;
num top;
num width;
num height;
Rectangle(this.left, this.top, this.width, this.height);
}
Sublime 3 treats the Dart bundle's dart settings file as having a higher priority over a users general rules, specifically the following are overridden with the Sublime defaults:
"smart_indent": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true,
"use_tab_stops": true
Considering that it's part of the Dart style guide to use 2 spaces instead of tab as well as stripping all unnecessary whitespace, these could probably be included in the Dart bundle.
The export keyword that is used to export from a library is not supported.
I don't know whether the pub site has an api for browsing, but it'd be great to be able to browse packages directly from Sublime.
Are there any plans to add auto-completion?
Hi Dart Team,
I think major changes to the analyzer were planned before 1.0. I'm talking by memory, but has it stabilized now? Is there any place to look for documentation or code to look at? I would like to try and improve this package for ST3; specifically, it'd be great to get some sort of intellisense working on ST3. The problem is I don't know where to start to retrieve completions for a location in a dart file using the same lang services the DartEditor uses.
Dart Editor is able to display a hierarchy of classes within the active editor. While I don't think this is possible right now, it'd be nice to have, even if it meant just printing a text outline to a new view in Sublime.
ST3 is unresponsive for ~4 seconds on each save.
For comparison the GoSublime plugin seems to run its linter delayed after last edit in the background allowing me to continue editing or switch to another tab. Maybe some of its tricks can be borrowed for the Dart plugin.
in web_ui code:
for (var library in libraries) {
// We don't need this anymore, so free it.
library.referencedBy = null;
}
}
everything under the "we don't need it" line is getting colored as if it is a string
Let's say you are working on some project and you're using a bunch of third party libs or even simply the standard lib. You hit a bug. Now you have to search the repo for the lib, write a bug report, etc.
Perhaps the process could be simplified.
Maybe somehow, this feature let's you press a key and a screenshot is taken, some system settings are collected, a template is brought up and you're pointed to the correct issue tracker while a sad trombone sound plays in the background. :) Or perhaps it would do something more useful that I'm missing.
A bit of sci-fi, but it seems possible.
I had a package already installed called "Dart" for syntax highlighting. Package control: install didn't show anything for Dart. I had to package control: remove first to remove the old one I had.
Dart Editor does this. If a package followed the pub conventions, it should be easy?
Open the official doc site, possible looking up a symbol.
Although Dart Sublime should be compatible with Sublime Text 3, the package manager still lists it as a Sublime Text 2 package only. Is there a specific channel I need to add?
I really want to code in Dart with SublimeText2, the only thing which holds me back is the lack of a linter which informs me immediately that something is wrong on a particular line. I don't want to run an analyzer manually but simply have a functioning linter as you would see/know from SublimeLinter.
For example in:
class DOMElementList<E> extends DOMList with Collection<E> {
DOMElementList<E> newInstance() => new DOMElementList<E>(0);
DOMElementList(size): super(size);
}
Probably from the command palette.
(Feel free to discuss whether the it seems a good idea.)
I think a valid Dart script needs to have a main()
, but perhaps this is possible? Maybe it isn't too useful, though.
Maybe this could also be extended to show errors inline like SublimeLinter.
I'm relatively new to Sublime. I have this bundle (I assume - gotten via the package installer) and the highlighting and snippits are there. But cmd-r which is supposed to bring up a list of symbols to select is always empty.
Does this work for others?
Thanks
I just started getting this error:
Error loading syntax file "Packages/Dart/Dart.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/Dart/Dart.tmLanguage"
Tried uninstall & reinstall but did not help. 2.0.2, build 2221. Not sure what could've changed. It seems to have broken on upgrade.
In case you quickly wanted to check something with the Dart Editor (maybe use the debugger), it'd be great to have an 'Open project in Dart Editor' command, or 'Open Project and show this File'.
Hi,
I'm not sure whether this package should be compatible with S2 or S3. It's recommended to keep Python 2.x codebases separated from their 3.x ports.
Would an s3 branch make sense?
The Dart Editor lets you browse the standard lib plus any installed packages. I think this is great and maybe the Dart package could do something similar.
Only .dart files...
At present the panel is shown in a rather intrusive way (especially if you save a lot, like I do). Maybe this should happen instead:
After saving:
If you wanted to open the output panel, you would have to bring it up explicitly via, for example, the command palette.
Since the linter already gives you visual feedback through gutter icons and such, you will see there are errors without needing the output panel to show up constantly.
Additionally, maybe the user should be able to control the ouput panel behavior based on error severity: show always for errors, for example, but never for other levels.
Nitpicking here:
In Sublime Text parlance, bundles are called packages.
I would also rename the package from dart-sublime-bundle to simply Dart (maybe as part of a build process that generates a Dart.sublime-package file, to avoid confusion).
I just thought I'd mention these minor points.
I don't know how those are called in Dart, but libraries embed a lot of documentation in block comments.
I think I read the markup used is Markdown. If it's a subset of MD, we can simply embed the MD syntax within the block comments via include
. If it's a MD dialect, though, I suppose we'd have to implement the syntax def ourselves.
Running the analyzer via Sublime should use the same flags that we use on the drone build.
dart_analyzer --enable_type_checks --fatal-type-errors --extended-exit-code --type-checks-for-inferred-types --incremental"
I think this may be innacurate:
Bundle for using Dart with TextMate or Sublime
I would suggest to change it to something like this:
Sublime Text Dart Package
While some parts may be reused for a TM bundle, I don't think we can mantain versions for both here in this repo.
When I save a dart-file I get the error below on the ST3 console. I'm not seeing any marks in the gutter on lines with errors but the error does get highlighted.
Writing file /home/user/parallax.dart with encoding UTF-8 (atomic)
dartlint.mark.gutter not found in theme
dartlint.mark.warning not found in theme
dartlint.mark.error not found in theme
dartlint.mark.info not found in theme
Traceback (most recent call last):
File "/opt/sublime_text/sublime_plugin.py", line 255, in on_post_save
callback.on_post_save(v)
File "dartlint in /home/user/.config/sublime-text-3/Installed Packages/Dart.sublime-package", line 111, in on_post_save
File "dartlint in /home/user/.config/sublime-text-3/Installed Packages/Dart.sublime-package", line 167, in check_theme
KeyError: 'dartlint.mark.gutter'
You could probably do something smart, but for now, there needs to be a setting for this otherwise it dies when it can't find certain imports.
Shouldn't the keyword dynamic
should be highlighted because it is a special type? Unlike dynamic
, var
is highlighted. They both share the same idea....
Maybe we should start thinking about tagging builds in light of recent breakages?
Gather commit messages up to a specific point and populate the changelog with that.
Having a specific syntax for it would allow us to give feedback on errors, add smart snippets, etc.
Also, a linter for the pubspec.yaml? The pub command does report back syntax errors, but I think there is no 'dry run' option; every time you run pub against the pubspec you actually download packages, etc. if any are missing.
Probably unfeasible now, but may come in handy some times.
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.