Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 2.15 KB

arch_runtime.md

File metadata and controls

55 lines (37 loc) · 2.15 KB

Architecture: runtime behavior and communication

Describes the runtime behavior and design of AWS Toolkit. Corresponds to the "Process view" of the 4+1 architectural views.

Environment variables

TODO: move from CONTRIBUTING.md

VSCode context keys

VScode extensions can use vscode 'setContext' command to set special context keys which are available in package.json.

Defining a new setContext key

If you must define a new key (is it really necessary?), follow these guidelines:

  • Choose a prefix as follows (as recommended):
    • packages/core/ should use aws. prefix
    • packages/toolkit/ should use aws.toolkit. prefix
    • packages/amazonq/ should use amazonq. prefix
  • Use brevity. Less is more.
  • Document it in the list below.

setContext keys

setContext keys owned by packages/core/

These keys are currently set by the core/ package, but many of them may eventually be migrated to toolkit/ or amazonq/ if appropriate.

  • isCloud9: This is hardcoded by Cloud9 itself, not the Toolkit.
    • Cloud9 does not support setContext. So this is the only usable key there.
  • aws.codecatalyst.connected: CodeCatalyst connection is active.
  • aws.codewhisperer.connected: CodeWhisperer connection is active.
  • aws.codewhisperer.connectionExpired: CodeWhisperer connection is active, but the connection is expired.
  • aws.isDevMode: AWS Toolkit is running in "developer mode".
  • aws.isWebExtHost: true when the extension host is running in a web browser, as opposed to nodejs (i.e. the environment has no "compute").
    • Compare to isWeb, which vscode defines when the UI is web, but says nothing about the extension host.
  • aws.isSageMaker: AWS Toolkit is running in the SageMaker Code Editor.

setContext keys owned by packages/toolkit/

  • TODO

setContext keys owned by packages/amazonq/

  • TODO

How our components communicate

TODO: vscode events; the "globals" module; activate(); EventEmitters; ...?