Skip to content

Adds Dart support#2

Open
Levi-Lesches wants to merge 2 commits into
shauryachats:masterfrom
Levi-Lesches:master
Open

Adds Dart support#2
Levi-Lesches wants to merge 2 commits into
shauryachats:masterfrom
Levi-Lesches:master

Conversation

@Levi-Lesches

Copy link
Copy Markdown

My solution to #1 (it's not a generalized solution, I just figured out how to add Dart).

Note: I added a field project to CoverMeModes.sublime-settings, because some languages/environments need the test command to be run in the root of the project, but currently basepath is set to use the path of the file instead. I don't know how that affects Python and Go, so I just made the project field optional and only used it on Dart.

As an example: if you have this file structure:

my-coding-folder
|- my-project
   |- tests
      |- test_1.dart
      |- test_2.dart
   |- lib
      |- main.dart
      |- data.dart

Currently, when running CoverMe on man.dart, basepath was set to my-coding-folder/my-project/lib/main.dart, but Dart really wants the command to be run in my-coding-folder/my-project.

Of course, every language has their own idea of what is a "package", so instead of using Dart-specific code, I simply check which folder in the Sublime project contains the path of the current file. In my case, I'd have my-coding-folder/my-project added to Sublime, so that would be chosen as the project folder. And of course, if someone uses the basepath option in their .sublime-project file, they would have complete control over this manually.

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

Successfully merging this pull request may close these issues.

2 participants