Integrate the ExP framework - #260
Conversation
| "minimatch": "^3.0.4", | ||
| "vscode-extension-telemetry-wrapper": "^0.7.1" | ||
| "vscode-extension-telemetry-wrapper": "^0.7.1", | ||
| "vscode-tas-client": "0.0.702" |
There was a problem hiding this comment.
You should actually use version 0.0.659 of vscode-tas-client for now. 0.0.702 has a bug that I'll resolve later this week.
| return false; | ||
| } | ||
|
|
||
| try { |
There was a problem hiding this comment.
The vscode-tas-client package will query the treatment assignment service in the background (every 30 minutes), so flight information should never be much staler than the last opened instance of VS Code. If you want to be absolutely sure your extension has up-to-date flight information, you can do this. However, it probably isn't necessary.
There was a problem hiding this comment.
So does that mean that we can just call isCachedFlightEnabled() here, and call isFlightEnabledAsync() for 1 time in the init method?
There was a problem hiding this comment.
You shouldn't ever need to call isFlightEnabledAsync unless you want the absolute latest flight information. But I can't think of any scenarios where you would.
There was a problem hiding this comment.
I see. Thank you Dayton Ellwanger (@daytonellwanger).
Another question, is below code needed in the init functions?
const asyncDummyCheck = (arg: any) => {
expService?.isFlightEnabledAsync('dummy').then((v) => { return; }).catch((r) => { return; });
};
expService?.isCachedFlightEnabled('dummy').then(asyncDummyCheck).catch(asyncDummyCheck);
}There was a problem hiding this comment.
This should no longer be needed with the version of the vscode-tas-client package I mentioned above.
There was a problem hiding this comment.
I see. Thank you for your help Dayton Ellwanger (@daytonellwanger). :)
I'll update the code according to the comments.
|
|
||
| export function init(context: vscode.ExtensionContext) { | ||
| const extensionName = "vscjava.vscode-java-dependency"; | ||
| const extensionVersion = "0.10.1"; |
There was a problem hiding this comment.
It might be better to read this from your package.json so you don't have to remember to update this when you change the extension version.
| }]; | ||
| if (contextManager.getContextValue(Context.MAVEN_ENABLED)) { | ||
| projectKinds.push({ | ||
| const isMavenDefault: boolean = await expManager.isFlightEnabled("defaultMaven"); |
There was a problem hiding this comment.
Are you OK paying the async cost here? Given that this could result in an http request, this could be 1-5 seconds.
| } | ||
|
|
||
| export async function init(context: vscode.ExtensionContext): Promise<void> { | ||
| const packageJson: {} = await fse.readJSON(context.asAbsolutePath("package.json")); |
There was a problem hiding this comment.
You might be able to just do require('package.json')?
| expService = getExperimentationService(extensionName, extensionVersion, | ||
| TargetPopulation.Public, new ExperimentationTelemetry(), context.globalState); | ||
|
|
||
| // Due to a bug in the tas-client module, a call to isFlightEnabledAsync is required to begin |
There was a problem hiding this comment.
You should be able to drop these dummy checks
There was a problem hiding this comment.
Oh interesting. Maybe we still have another bug to track down. OK, keep these checks for now and I'll look into the issue ASAP, and with the next update to the package, you can remove them.
|
Hey Dayton Ellwanger (@daytonellwanger), I have updated the PR. Please take a look when you have time. Thanks a lot. |
| }]; | ||
| if (contextManager.getContextValue(Context.MAVEN_ENABLED)) { | ||
| projectKinds.push({ | ||
| const isMavenDefault: boolean = await getExpService().isCachedFlightEnabled("defaultMaven"); |
There was a problem hiding this comment.
null check after getExpService?

No description provided.