MCPcopy
hub / github.com/PowerShell/vscode-powershell / activate

Function activate

src/extension.ts:50–224  ·  view source on GitHub ↗
(
    context: vscode.ExtensionContext,
)

Source from the content-addressed store, hash-verified

48];
49
50export async function activate(
51 context: vscode.ExtensionContext,
52): Promise<IPowerShellExtensionClient> {
53 logger = new Logger();
54 if (context.extensionMode === vscode.ExtensionMode.Development) {
55 restartOnExtensionFileChanges(context);
56 }
57
58 telemetryReporter = new TelemetryReporter(TELEMETRY_KEY);
59
60 const settings = getSettings();
61 logger.writeDebug(
62 `Loaded settings:\n${JSON.stringify(settings, undefined, 2)}`,
63 );
64
65 languageConfigurationDisposable = vscode.languages.setLanguageConfiguration(
66 PowerShellLanguageId,
67 {
68 // TODO: Remove the useless escapes
69 wordPattern:
70 // eslint-disable-next-line no-useless-escape
71 /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\'\"\,\.\<\>\/\?\s]+)/g,
72
73 indentationRules: {
74 // ^(.*\*/)?\s*\}.*$
75 decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/,
76 // ^.*\{[^}"']*$
77 increaseIndentPattern: /^.*\{[^}"']*$/,
78 },
79
80 comments: {
81 lineComment: "#",
82 blockComment: ["<#", "#>"],
83 },
84
85 brackets: [
86 ["{", "}"],
87 ["[", "]"],
88 ["(", ")"],
89 ],
90
91 onEnterRules: [
92 {
93 // e.g. /** | */
94 // eslint-disable-next-line no-useless-escape
95 beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
96 afterText: /^\s*\*\/$/,
97 action: {
98 indentAction: vscode.IndentAction.IndentOutdent,
99 appendText: " * ",
100 },
101 },
102 {
103 // e.g. /** ...|
104 // eslint-disable-next-line no-useless-escape
105 beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
106 action: {
107 indentAction: vscode.IndentAction.None,

Callers

nothing calls this directly

Calls 13

waitUntilStartedMethod · 0.95
getStorageUriMethod · 0.95
getLogUriMethod · 0.95
getSettingsFunction · 0.90
showLogPanelMethod · 0.80
writeDebugMethod · 0.65

Tested by

no test coverage detected