You've already forked bsl_console
mirror of
https://github.com/salexdv/bsl_console.git
synced 2025-07-17 01:32:20 +02:00
Подсказка реквизитов ТЧ в запросе
This commit is contained in:
@ -2312,6 +2312,7 @@ class bslHelper {
|
|||||||
fillSuggestionsForMetadataItem(suggestions, obj, metadataName, metadataItem) {
|
fillSuggestionsForMetadataItem(suggestions, obj, metadataName, metadataItem) {
|
||||||
|
|
||||||
let objects = [];
|
let objects = [];
|
||||||
|
let is_query = (isQueryMode() || isDCSMode());
|
||||||
|
|
||||||
if (obj.hasOwnProperty('properties'))
|
if (obj.hasOwnProperty('properties'))
|
||||||
objects.push(obj.properties);
|
objects.push(obj.properties);
|
||||||
@ -2319,7 +2320,7 @@ class bslHelper {
|
|||||||
if (obj.hasOwnProperty('resources'))
|
if (obj.hasOwnProperty('resources'))
|
||||||
objects.push(obj.resources);
|
objects.push(obj.resources);
|
||||||
|
|
||||||
if (obj.hasOwnProperty('tabulars')) {
|
if (obj.hasOwnProperty('tabulars') && !is_query) {
|
||||||
this.fillSuggestionsForItemTabulars(suggestions, obj.tabulars, metadataName, metadataItem)
|
this.fillSuggestionsForItemTabulars(suggestions, obj.tabulars, metadataName, metadataItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4163,6 +4164,47 @@ class bslHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds standart tabular attributes to suggestion list
|
||||||
|
*
|
||||||
|
* @param {array} suggestions the list of suggestions
|
||||||
|
* @param {string} ref to tabular owner
|
||||||
|
*/
|
||||||
|
addStandardTabularAttributesToQuerySuggestions(suggestions, ref) {
|
||||||
|
|
||||||
|
let label = engLang ? 'Ref' : 'Ссылка';
|
||||||
|
|
||||||
|
let command = {
|
||||||
|
id: 'vs.editor.ICodeEditor:1:saveref',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
"name": label,
|
||||||
|
"data": {
|
||||||
|
"ref": ref,
|
||||||
|
"sig": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
suggestions.push({
|
||||||
|
label: label,
|
||||||
|
kind: monaco.languages.CompletionItemKind.Field,
|
||||||
|
insertText: label,
|
||||||
|
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
|
||||||
|
command: command
|
||||||
|
});
|
||||||
|
|
||||||
|
label = engLang ? 'LineNumber' : 'НомерСтроки';
|
||||||
|
suggestions.push({
|
||||||
|
label: label,
|
||||||
|
kind: monaco.languages.CompletionItemKind.Field,
|
||||||
|
insertText: label,
|
||||||
|
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list of properties (attributes) owned by object
|
* Gets the list of properties (attributes) owned by object
|
||||||
* (Catalog, Document, etc) and fills the suggestions by it
|
* (Catalog, Document, etc) and fills the suggestions by it
|
||||||
@ -4278,8 +4320,19 @@ class bslHelper {
|
|||||||
|
|
||||||
if (ikey.toLowerCase() == metadataName) {
|
if (ikey.toLowerCase() == metadataName) {
|
||||||
|
|
||||||
if (ivalue.hasOwnProperty('properties'))
|
if (ivalue.hasOwnProperty('properties')) {
|
||||||
|
if (ivalue.hasOwnProperty('tabulars') && 3 == sourceArray.length) {
|
||||||
|
for (const [tkey, tvalue] of Object.entries(ivalue.tabulars)) {
|
||||||
|
if (tkey.toLowerCase() == metadataSubtable) {
|
||||||
|
this.addStandardTabularAttributesToQuerySuggestions(suggestions, key + '.' + ikey);
|
||||||
|
this.fillSuggestionsForMetadataItemInQuery(suggestions, tvalue, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
this.fillSuggestionsForMetadataItemInQuery(suggestions, ivalue, metadataSubtable);
|
this.fillSuggestionsForMetadataItemInQuery(suggestions, ivalue, metadataSubtable);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (ivalue.hasOwnProperty('tables') && 3 < sourceArray.length &&
|
else if (ivalue.hasOwnProperty('tables') && 3 < sourceArray.length &&
|
||||||
value[this.queryNameField + '_tables'].toLowerCase() == metadataSubtable) {
|
value[this.queryNameField + '_tables'].toLowerCase() == metadataSubtable) {
|
||||||
let tableName = sourceArray[3].toLowerCase();
|
let tableName = sourceArray[3].toLowerCase();
|
||||||
|
Reference in New Issue
Block a user