-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Coding Guidelines
Chris Dias edited this page Oct 13, 2015
·
23 revisions
##Events
-
We use
Event<T>
which exposes events as a function to which you subscribe by calling that function. The return value is a disposable which removes the event subscription. -
We use
onDidVerbNoun?
andonWillVerbNoun?
. For instanceonWillCloseSidebar
,onDidiShutdownWorkbench
. The noun is optional if the scope provided enough identification, likedocument#onDidChange
butdocument#onWillDeleteLine
.
- We use a property assignment when the assignment only alters that property but doesn't do anything else. We use a set/get method when value checking is performed, when events are send out, when other properties are updates etc.
- We don't use the reject path for expected conditions. For instance, when asking for the existence of a file a project resolves with a boolean instead rejecting. Similar, cancelling user input resolves with undefined instead or rejecting,
shell.showQuickPick:Promise
.
- We only prefix interfaces with a uppercase
I
when it's supposed to be implemented by clients. That is it appears after the implements keyword. We don't use I-names when defining function signature or property bags.
-
All private members of classes are prefixed with an
_
, such asclass Foo { private _bar;}
.
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Build Champion
- Release Process
- Running the Endgame
- Related Projects
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Feedback Channels
- Source Code Organization
- Coding Guidelines
- Testing
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
- Accessibility Guidelines
Documentation