Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -15,7 +15,7 @@ export const ISnippetsService = createDecorator<ISnippetsService>('snippetServic
export interface ISnippetsService {
_serviceBrand: any;
_serviceBrand: undefined;
getSnippetFiles(): Promise<SnippetFile[]>;
@@ -28,6 +28,7 @@ const languageScopeSchemaId = 'vscode://schemas/snippets';
const languageScopeSchema: IJSONSchema = {
id: languageScopeSchemaId,
allowComments: true,
allowsTrailingCommas: true,
defaultSnippets: [{
label: nls.localize('snippetSchema.json.default', "Empty snippet"),
body: { '${1:snippetName}': { 'prefix': '${2:prefix}', 'body': '${3:snippet}', 'description': '${4:description}' } }
@@ -63,6 +64,7 @@ const globalSchemaId = 'vscode://schemas/global-snippets';
const globalSchema: IJSONSchema = {
id: globalSchemaId,
allowComments: true,
allowsTrailingCommas: true,
defaultSnippets: [{
label: nls.localize('snippetSchema.json.default', "Empty snippet"),
body: { '${1:snippetName}': { 'scope': '${2:scope}', 'prefix': '${3:prefix}', 'body': '${4:snippet}', 'description': '${5:description}' } }

View File

@@ -127,7 +127,7 @@ function watch(service: IFileService, resource: URI, callback: (type: FileChange
class SnippetsService implements ISnippetsService {
readonly _serviceBrand: any;
readonly _serviceBrand: undefined;
private readonly _disposables = new DisposableStore();
private readonly _pendingWork: Promise<any>[] = [];

View File

@@ -19,6 +19,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { Snippet } from './snippetsFile';
import { SnippetCompletion } from './snippetCompletionProvider';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
export class TabCompletionController implements editorCommon.IEditorContribution {
@@ -42,7 +43,7 @@ export class TabCompletionController implements editorCommon.IEditorContribution
) {
this._hasSnippets = TabCompletionController.ContextKey.bindTo(contextKeyService);
this._configListener = this._editor.onDidChangeConfiguration(e => {
if (e.contribInfo) {
if (e.hasChanged(EditorOption.tabCompletion)) {
this._update();
}
});
@@ -59,7 +60,7 @@ export class TabCompletionController implements editorCommon.IEditorContribution
}
private _update(): void {
const enabled = this._editor.getConfiguration().contribInfo.tabCompletion === 'onlySnippets';
const enabled = this._editor.getOption(EditorOption.tabCompletion) === 'onlySnippets';
if (this._enabled !== enabled) {
this._enabled = enabled;
if (!this._enabled) {

View File

@@ -15,7 +15,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo
import { CompletionContext, CompletionTriggerKind } from 'vs/editor/common/modes';
class SimpleSnippetService implements ISnippetsService {
_serviceBrand: any;
_serviceBrand: undefined;
constructor(readonly snippets: Snippet[]) {
}
getSnippets() {