mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -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}' } }
|
||||
|
||||
@@ -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>[] = [];
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user