mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from vscode 0f73473c08055054f317c1c94502f7f39fdbb164 (#6892)
* Merge from vscode 0f73473c08055054f317c1c94502f7f39fdbb164 * fix tslinting
This commit is contained in:
@@ -404,7 +404,7 @@ export interface CompletionItem {
|
||||
* A modifier to the `kind` which affect how the item
|
||||
* is rendered, e.g. Deprecated is rendered with a strikeout
|
||||
*/
|
||||
kindModifier?: CompletionItemKindModifier;
|
||||
kindModifier?: Set<CompletionItemKindModifier>;
|
||||
/**
|
||||
* A human-readable string with additional information
|
||||
* about this item, like type or symbol information.
|
||||
@@ -867,6 +867,9 @@ export const enum SymbolKind {
|
||||
TypeParameter = 25
|
||||
}
|
||||
|
||||
export const enum SymbolKindTag {
|
||||
Deprecated = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -910,6 +913,7 @@ export interface DocumentSymbol {
|
||||
name: string;
|
||||
detail: string;
|
||||
kind: SymbolKind;
|
||||
kindTags: SymbolKindTag[];
|
||||
containerName?: string;
|
||||
range: IRange;
|
||||
selectionRange: IRange;
|
||||
|
||||
@@ -660,4 +660,8 @@ export enum SymbolKind {
|
||||
Event = 23,
|
||||
Operator = 24,
|
||||
TypeParameter = 25
|
||||
}
|
||||
|
||||
export enum SymbolKindTag {
|
||||
Deprecated = 1
|
||||
}
|
||||
@@ -20,6 +20,11 @@
|
||||
color: var(--outline-element-color);
|
||||
}
|
||||
|
||||
.monaco-list .outline-element .deprecated {
|
||||
text-decoration: line-through;
|
||||
opacity: 0.66;
|
||||
}
|
||||
|
||||
.monaco-tree .monaco-tree-row.focused .outline-element .outline-element-detail {
|
||||
visibility: inherit;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { createMatches, FuzzyScore } from 'vs/base/common/filters';
|
||||
import 'vs/css!./media/outlineTree';
|
||||
import 'vs/css!./media/symbol-icons';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { SymbolKind, symbolKindToCssClass } from 'vs/editor/common/modes';
|
||||
import { SymbolKind, symbolKindToCssClass, SymbolKindTag } from 'vs/editor/common/modes';
|
||||
import { OutlineElement, OutlineGroup, OutlineModel } from 'vs/editor/contrib/documentSymbols/outlineModel';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';
|
||||
@@ -127,6 +127,10 @@ export class OutlineElementRenderer implements ITreeRenderer<OutlineElement, Fuz
|
||||
// add styles for the icons
|
||||
options.extraClasses.push(`outline-element-icon ${symbolKindToCssClass(element.symbol.kind, true)}`);
|
||||
}
|
||||
if (element.symbol.kindTags.indexOf(SymbolKindTag.Deprecated) >= 0) {
|
||||
options.extraClasses.push(`deprecated`);
|
||||
options.matches = [];
|
||||
}
|
||||
template.iconLabel.setLabel(element.symbol.name, element.symbol.detail, options);
|
||||
this._renderMarkerInfo(element, template);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ suite('OutlineModel', function () {
|
||||
name,
|
||||
detail: 'fake',
|
||||
kind: SymbolKind.Boolean,
|
||||
kindTags: [],
|
||||
selectionRange: range,
|
||||
range: range
|
||||
};
|
||||
|
||||
@@ -176,6 +176,13 @@ suite('Replace Pattern test', () => {
|
||||
assert.equal(buildReplaceStringWithCasePreserved(actual, replacePattern), 'Def');
|
||||
actual = ['aBC'];
|
||||
assert.equal(buildReplaceStringWithCasePreserved(actual, replacePattern), 'Def');
|
||||
|
||||
actual = ['Foo-Bar'];
|
||||
assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar'), 'Newfoo-Newbar');
|
||||
actual = ['Foo-Bar-Abc'];
|
||||
assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar-newabc'), 'Newfoo-Newbar-Newabc');
|
||||
actual = ['Foo-Bar-abc'];
|
||||
assert.equal(buildReplaceStringWithCasePreserved(actual, 'newfoo-newbar'), 'Newfoo-newbar');
|
||||
});
|
||||
|
||||
test('preserve case', () => {
|
||||
@@ -198,5 +205,17 @@ suite('Replace Pattern test', () => {
|
||||
assert.equal(actual, 'Def');
|
||||
actual = replacePattern.buildReplaceString(['aBC'], true);
|
||||
assert.equal(actual, 'Def');
|
||||
|
||||
replacePattern = parseReplaceString('newfoo-newbar');
|
||||
actual = replacePattern.buildReplaceString(['Foo-Bar'], true);
|
||||
assert.equal(actual, 'Newfoo-Newbar');
|
||||
|
||||
replacePattern = parseReplaceString('newfoo-newbar-newabc');
|
||||
actual = replacePattern.buildReplaceString(['Foo-Bar-Abc'], true);
|
||||
assert.equal(actual, 'Newfoo-Newbar-Newabc');
|
||||
|
||||
replacePattern = parseReplaceString('newfoo-newbar');
|
||||
actual = replacePattern.buildReplaceString(['Foo-Bar-abc'], true);
|
||||
assert.equal(actual, 'Newfoo-newbar');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,6 +51,7 @@ function flatten(bucket: DocumentSymbol[], entries: DocumentSymbol[], overrideCo
|
||||
for (let entry of entries) {
|
||||
bucket.push({
|
||||
kind: entry.kind,
|
||||
kindTags: [],
|
||||
name: entry.name,
|
||||
detail: entry.detail,
|
||||
containerName: entry.containerName || overrideContainerLabel,
|
||||
|
||||
@@ -97,10 +97,6 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget-deprecated span {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/** Icon styles **/
|
||||
|
||||
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close,
|
||||
@@ -115,8 +111,8 @@
|
||||
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close {
|
||||
background-image: url('./close-light.svg');
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
@@ -159,9 +155,16 @@
|
||||
}
|
||||
|
||||
/** Styles for each row in the list **/
|
||||
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated {
|
||||
opacity: 0.66;
|
||||
}
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated > .monaco-icon-label-description-container {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label::before {
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon {
|
||||
@@ -257,7 +260,7 @@
|
||||
text-overflow: ellipsis;
|
||||
opacity: 0.7;
|
||||
word-break: break-all;
|
||||
margin: 0px 24px 0 0;
|
||||
margin: 0 24px 0 0;
|
||||
padding: 4px 0 12px 5px;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ import { IdleValue } from 'vs/base/common/async';
|
||||
import { isObject } from 'vs/base/common/types';
|
||||
import { CommitCharacterController } from './suggestCommitCharacters';
|
||||
|
||||
const _sticky = false; // for development purposes only
|
||||
|
||||
export class SuggestController implements IEditorContribution {
|
||||
|
||||
private static readonly ID: string = 'editor.contrib.suggestController';
|
||||
@@ -47,7 +49,6 @@ export class SuggestController implements IEditorContribution {
|
||||
private readonly _alternatives: IdleValue<SuggestAlternatives>;
|
||||
private readonly _toDispose = new DisposableStore();
|
||||
|
||||
private readonly _sticky = false; // for development purposes only
|
||||
|
||||
constructor(
|
||||
private _editor: ICodeEditor,
|
||||
@@ -127,7 +128,7 @@ export class SuggestController implements IEditorContribution {
|
||||
}
|
||||
}));
|
||||
this._toDispose.add(this._editor.onDidBlurEditorWidget(() => {
|
||||
if (!this._sticky) {
|
||||
if (!_sticky) {
|
||||
this._model.cancel();
|
||||
this._model.clear();
|
||||
}
|
||||
|
||||
@@ -193,8 +193,9 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
|
||||
];
|
||||
}
|
||||
|
||||
if (suggestion.kindModifier && suggestion.kindModifier & CompletionItemKindModifier.Deprecated) {
|
||||
labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['suggest-widget-deprecated']);
|
||||
if (suggestion.kindModifier && suggestion.kindModifier.has(CompletionItemKindModifier.Deprecated)) {
|
||||
labelOptions.extraClasses = (labelOptions.extraClasses || []).concat(['deprecated']);
|
||||
labelOptions.matches = [];
|
||||
}
|
||||
|
||||
data.iconLabel.setLabel(suggestion.label, undefined, labelOptions);
|
||||
|
||||
@@ -565,6 +565,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
|
||||
CompletionItemKindModifier: standaloneEnums.CompletionItemKindModifier,
|
||||
CompletionItemInsertTextRule: standaloneEnums.CompletionItemInsertTextRule,
|
||||
SymbolKind: standaloneEnums.SymbolKind,
|
||||
SymbolKindTag: standaloneEnums.SymbolKindTag,
|
||||
IndentAction: standaloneEnums.IndentAction,
|
||||
CompletionTriggerKind: standaloneEnums.CompletionTriggerKind,
|
||||
SignatureHelpTriggerKind: standaloneEnums.SignatureHelpTriggerKind,
|
||||
|
||||
Reference in New Issue
Block a user