-
Notifications
You must be signed in to change notification settings - Fork 296
Coding Guidelines
Don Jayamanne edited this page Oct 22, 2020
·
1 revision
- Always aim for small, targeted interfaces
-
IDisposable & IAsynDisposable
- Classes that require disposing of resources must implement the
IDisposable
interface - Classes that require disposing of resources in an async manner must implement the
IAsynDisposable
interface
- Classes that require disposing of resources must implement the
-
IExtensionActivationService
- Classes that require code to be executed during the startup of the extension must implement
IExtensionActivationService
- Classes that require code to be executed during the startup of the extension must implement
- Timers/Timeouts
- All timers/timeouts (setTimeout/setInterval) must be cleared in the
dispose
method of the class - This ensure we do not have any dangling timeouts preventing the process from gracefully exiting.
- All timers/timeouts (setTimeout/setInterval) must be cleared in the
-
Async Methods
- Async must be
awaited
where possible. - If awaiting on async methods is not required or not possible always use
ignoreErrors
to ensure we do not leave any dangling promises (i.e. promises where we do not handle exceptions). - Note: Not doing so could (in a future version of
Node.js
) crash the entire process.
- Async must be
- Write code to be testable
-
Localization
- All messages displayed to the user must be localized.
- Contribution
- Source Code Organization
- Coding Standards
- Profiling
- Coding Guidelines
- Component Governance
- Writing tests
- Kernels
- Intellisense
- Debugging
- IPyWidgets
- Extensibility
- Module Dependencies
- Errors thrown
- Jupyter API
- Variable fetching
- Import / Export
- React Webviews: Variable Viewer, Data Viewer, and Plot Viewer
- FAQ
- Kernel Crashes
- Jupyter issues in the Python Interactive Window or Notebook Editor
- Finding the code that is causing high CPU load in production
- How to install extensions from VSIX when using Remote VS Code
- How to connect to a jupyter server for running code in vscode.dev
- Jupyter Kernels and the Jupyter Extension