Skip to content

Commit

Permalink
Rebase against the upstream d32043d
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: d32043d
  • Loading branch information
Eclipse Che Sync committed Dec 20, 2023
2 parents 311c370 + d32043d commit 3629ea8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion code/src/vs/editor/contrib/snippet/browser/snippet.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ${1/^_(.*)/$1/}
Grammar
--

Below is the EBNF for snippets. With `\` (backslash) you can escape `$`, `}` and `\`, within choice elements the backslash also escapes comma and pipe characters.
Below is the EBNF for snippets.

```
any ::= tabstop | placeholder | choice | variable | text
Expand All @@ -127,3 +127,5 @@ var ::= [_a-zA-Z] [_a-zA-Z0-9]*
int ::= [0-9]+
text ::= .*
```

Escaping is done with with the `\` (backslash) character. The rule of thumb is that you can escape characters that otherwise would have a syntactic meaning, e.g within text you can escape `$`, `}` and `\`, within choice elements you can escape `|`, `,` and `\`, and within transform elements you can escape `/` and `\`. Also note that in JSON you need to escape `\` as `\\`.
12 changes: 7 additions & 5 deletions code/src/vs/workbench/browser/parts/editor/editorGroupView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
};

// Update group contexts based on group changes
this._register(this.onDidModelChange(e => {
const updateGroupContextKeys = (e: IGroupModelChangeEvent) => {
switch (e.kind) {
case GroupModelChangeKind.GROUP_LOCKED:
groupLockedContext.set(this.isLocked);
Expand Down Expand Up @@ -312,16 +312,18 @@ export class EditorGroupView extends Themable implements IEditorGroupView {

// Group editors count context
groupEditorsCountContext.set(this.count);
}));
};

this._register(this.onDidModelChange(e => updateGroupContextKeys(e)));

// Track the active editor and update context key that reflects
// the dirty state of this editor
this._register(this.onDidActiveEditorChange(() => {
observeActiveEditor();
}));
this._register(this.onDidActiveEditorChange(() => observeActiveEditor()));

// Update context keys on startup
observeActiveEditor();
updateGroupContextKeys({ kind: GroupModelChangeKind.EDITOR_ACTIVE });
updateGroupContextKeys({ kind: GroupModelChangeKind.GROUP_LOCKED });
}

private registerContainerListeners(): void {
Expand Down

0 comments on commit 3629ea8

Please sign in to comment.