mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 12:08:36 -05:00
Merge from vscode 93309f060778f6480a7d2a13913e6e7c624e9bc7
This commit is contained in:
@@ -103,6 +103,7 @@ const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewE
|
||||
Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
|
||||
id: REPL_VIEW_ID,
|
||||
name: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'),
|
||||
containerIcon: 'codicon-debug-console',
|
||||
canToggleVisibility: false,
|
||||
canMoveView: true,
|
||||
ctorDescriptor: new SyncDescriptor(Repl),
|
||||
|
||||
@@ -36,7 +36,7 @@ import { IDecorationOptions } from 'vs/editor/common/editorCommon';
|
||||
import { transparent, editorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems';
|
||||
import { CompletionContext, CompletionList, CompletionProviderRegistry, CompletionItem, completionKindFromString, CompletionItemKind } from 'vs/editor/common/modes';
|
||||
import { CompletionContext, CompletionList, CompletionProviderRegistry, CompletionItem, completionKindFromString, CompletionItemKind, CompletionItemInsertTextRule } from 'vs/editor/common/modes';
|
||||
import { first } from 'vs/base/common/arrays';
|
||||
import { ITreeNode, ITreeContextMenuEvent, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -147,13 +147,24 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
if (response && response.body && response.body.targets) {
|
||||
response.body.targets.forEach(item => {
|
||||
if (item && item.label) {
|
||||
let insertTextRules: CompletionItemInsertTextRule | undefined = undefined;
|
||||
let insertText = item.text || item.label;
|
||||
if (typeof item.selectionStart === 'number') {
|
||||
// If a debug completion item sets a selection we need to use snippets to make sure the selection is selected #90974
|
||||
insertTextRules = CompletionItemInsertTextRule.InsertAsSnippet;
|
||||
const selectionLength = typeof item.selectionLength === 'number' ? item.selectionLength : 0;
|
||||
const placeholder = selectionLength > 0 ? '${1:' + insertText.substr(item.selectionStart, selectionLength) + '}$0' : '$0';
|
||||
insertText = insertText.substr(0, item.selectionStart) + placeholder + insertText.substr(item.selectionStart + selectionLength);
|
||||
}
|
||||
|
||||
suggestions.push({
|
||||
label: item.label,
|
||||
insertText: item.text || item.label,
|
||||
insertText,
|
||||
kind: completionKindFromString(item.type || 'property'),
|
||||
filterText: (item.start && item.length) ? text.substr(item.start, item.length).concat(item.label) : undefined,
|
||||
range: computeRange(item.length || overwriteBefore),
|
||||
sortText: item.sortText
|
||||
sortText: item.sortText,
|
||||
insertTextRules
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -247,6 +247,9 @@ function convertPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePath: (toDA:
|
||||
export function getVisibleAndSorted<T extends { presentation?: IConfigPresentation }>(array: T[]): T[] {
|
||||
return array.filter(config => !config.presentation?.hidden).sort((first, second) => {
|
||||
if (!first.presentation) {
|
||||
if (!second.presentation) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (!second.presentation) {
|
||||
@@ -271,6 +274,10 @@ export function getVisibleAndSorted<T extends { presentation?: IConfigPresentati
|
||||
|
||||
function compareOrders(first: number | undefined, second: number | undefined): number {
|
||||
if (typeof first !== 'number') {
|
||||
if (typeof second !== 'number') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
if (typeof second !== 'number') {
|
||||
|
||||
Reference in New Issue
Block a user