Skip to content

Activate Dart-Code on encountering html files - #399

Closed
LorenVS wants to merge 1 commit into
Dart-Code:masterfrom
LorenVS:activate-on-html
Closed

LorenVS wants to merge 1 commit into
Dart-Code:masterfrom
LorenVS:activate-on-html

Conversation

@LorenVS

@LorenVS LorenVS commented Jul 31, 2017

Copy link
Copy Markdown

Activates the Dart-Code extension when html files are encountered. Optimally, this would only be enabled if the dart.previewAnalyzeAngularTemplates option is set, but I don't think there is infrastructure for that. This solves issues with auto complete and warnings not showing up in Angular templates unless a dart file is opened first.

@DanTup

DanTup commented Jul 31, 2017

Copy link
Copy Markdown
Member

I'm a little nervous about this - it'll activate Dart Code for a large number of unrelated projects. There's an activation even for when the workspace contains a pubspec, which I presume yours does, so I think that might be a bug we can fix?

@LorenVS

LorenVS commented Jul 31, 2017

Copy link
Copy Markdown
Author

Aaah, that would probably work for most people, unfortunately, our directories do not contain pubspecs

@LorenVS

LorenVS commented Jul 31, 2017

Copy link
Copy Markdown
Author

I've created a vscode bug, and I'll see what the response is before pursuing this further

@DanTup

DanTup commented Jul 31, 2017

Copy link
Copy Markdown
Member

Do you have an example of an Angular project without a pubspec? I assumed you'd need a pubspec to list Angular as a dependency?

@LorenVS

LorenVS commented Jul 31, 2017

Copy link
Copy Markdown
Author

We use bazel [1] for building our Angular2/Dart projects, and manage our dependencies through bazel's deps arguments. Probably not a common environment

[1] https://github.com/dart-lang/bazel

@DanTup

DanTup commented Aug 1, 2017

Copy link
Copy Markdown
Member

I wonder if we could do workspaceContains:*.dart?

@DanTup

DanTup commented Aug 1, 2017

Copy link
Copy Markdown
Member

See microsoft/vscode#27483, apparently we can do this:

"activationEvents": [ "workspaceContains:**/*.dart" ]

If this works for you, I'd much prefer it to activating on opening all HTML files. WDYT?

@DanTup

DanTup commented Aug 13, 2017

Copy link
Copy Markdown
Member

I've changed this to activate when the workspace contains any dart file (#409). I believe this solves your problem without activating on any HTML file opening. The change will be in 2.4. Please let me know if you believe/find it doesn't solve your problem. Thanks!

@DanTup DanTup closed this Aug 13, 2017
@LorenVS

LorenVS commented Aug 22, 2017

Copy link
Copy Markdown
Author

Thanks @DanTup , and sorry for not responding. This sounds great

@DanTup

DanTup commented Aug 22, 2017

Copy link
Copy Markdown
Member

Cool; the change was shipped in the last update - let me know if you have any issues with 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

Successfully merging this pull request may close these issues.

2 participants