Skip to content

Add initial support for feature flags #589

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

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@
"default": "",
"description": "Specifies the path to a PowerShell Script Analyzer settings file. Use either an absolute path (to override the default settings for all projects) or use a path relative to your workspace."
},
"powershell.developer.featureFlags": {
"type": "array",
"default": [],
"description": "An array of strings used to enable experimental features in the PowerShell extension."
},
"powershell.developer.powerShellExePath": {
"type": "string",
"default": "",
Expand Down
3 changes: 3 additions & 0 deletions scripts/Start-EditorServices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ param(
[string]
$DebugServiceOnly,

[string[]]
$FeatureFlags,

[switch]
$WaitForDebugger,

Expand Down
10 changes: 8 additions & 2 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,15 @@ export class SessionManager {

var editorServicesLogPath = this.log.getLogFilePath("EditorServices");

var featureFlags =
this.sessionSettings.developer.featureFlags !== undefined
? this.sessionSettings.developer.featureFlags.map(f => `'${f}'`).join(', ')
: "";

startArgs +=
"-LogPath '" + editorServicesLogPath + "' " +
"-SessionDetailsPath '" + utils.getSessionFilePath() + "' ";
`-LogPath '${editorServicesLogPath}' ` +
`-SessionDetailsPath '${utils.getSessionFilePath()}' ` +
`-FeatureFlags @(${featureFlags})`

var powerShellArgs = [
"-NoProfile",
Expand Down
2 changes: 2 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface IScriptAnalysisSettings {
}

export interface IDeveloperSettings {
featureFlags?: string[];
powerShellExePath?: string;
bundledModulesPath?: string;
editorServicesLogLevel?: string;
Expand All @@ -47,6 +48,7 @@ export function load(myPluginId: string): ISettings {
};

let defaultDeveloperSettings: IDeveloperSettings = {
featureFlags: [],
powerShellExePath: undefined,
bundledModulesPath: undefined,
editorServicesLogLevel: "Normal",
Expand Down