-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added telemetry for usage of activateEnvInCurrentTerminal setting #8654
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
Changes from 8 commits
4667af1
30fd058
6bb8fc1
d3a448f
8e41eea
bc3df8a
e8304f3
1e4b232
754d2d8
0b3b802
a0dfc5c
39509dc
66fd30c
7b00729
201342e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add telemetry for usage of activateEnvInCurrentTerminal setting. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
|
||
import { inject, injectable } from 'inversify'; | ||
import { IDocumentManager, IWorkspaceService } from '../common/application/types'; | ||
import { Resource } from '../common/types'; | ||
import { IActiveResourceService } from './types'; | ||
|
||
@injectable() | ||
export class ActiveResourceService implements IActiveResourceService { | ||
constructor( | ||
@inject(IDocumentManager) private readonly documentManager: IDocumentManager, | ||
@inject(IWorkspaceService) private readonly workspaceService: IWorkspaceService | ||
) { } | ||
|
||
public getActiveResource(): Resource { | ||
if (this.documentManager.activeTextEditor && !this.documentManager.activeTextEditor.document.isUntitled) { | ||
karrtikr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return this.documentManager.activeTextEditor.document.uri; | ||
} | ||
return Array.isArray(this.workspaceService.workspaceFolders) && this.workspaceService.workspaceFolders.length > 0 | ||
? this.workspaceService.workspaceFolders[0].uri | ||
: undefined; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,3 +169,8 @@ export const IExtensionSingleActivationService = Symbol('IExtensionSingleActivat | |
export interface IExtensionSingleActivationService { | ||
activate(): Promise<void>; | ||
} | ||
|
||
export const IActiveResourceService = Symbol('IActiveResourceService'); | ||
export interface IActiveResourceService { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a doc comment explaining the purpose of this type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Though I don't think we even need an interface for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DonJayamanne For the cases where serviceContainer is used, this.activeResourceService = this.serviceContainer.get<IActiveResourceService>(IActiveResourceService); we can't inject the class, can we? How do we initialize |
||
getActiveResource(): Resource; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.