1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-30 08:57:08 +02:00

EVENT_BEFORE_HOVER for Query and DCS

added triggering EVENT_BEFORE_HOVER in "Query" and "DCS" modes
This commit is contained in:
tormozit 2021-05-10 17:53:18 +03:00
parent 63aaeb2a43
commit dd7eb96fcf
2 changed files with 50 additions and 2 deletions

View File

@ -524,7 +524,31 @@ define([], function () {
}
},
hoverProvider: {
provideHover: () => {}
provideHover: function (model, position) {
if (!ctrlPressed) {
if (generateBeforeHoverEvent) {
let bsl = new bslHelper(model, position);
let token = bsl.getLastToken();
let params = {
word: model.getWordAtPosition(position),
token: token,
line: position.lineNumber,
column: position.column
}
sendEvent('EVENT_BEFORE_HOVER', params);
}
let bsl = new bslHelper(model, position);
return bsl.getHover();
}
else {
return null;
}
}
},
formatProvider: {
provideDocumentFormattingEdits: () => {}
@ -565,7 +589,31 @@ define([], function () {
}
},
hoverProvider: {
provideHover: () => {}
provideHover: function (model, position) {
if (!ctrlPressed) {
if (generateBeforeHoverEvent) {
let bsl = new bslHelper(model, position);
let token = bsl.getLastToken();
let params = {
word: model.getWordAtPosition(position),
token: token,
line: position.lineNumber,
column: position.column
}
sendEvent('EVENT_BEFORE_HOVER', params);
}
let bsl = new bslHelper(model, position);
return bsl.getHover();
}
else {
return null;
}
}
},
formatProvider: {
provideDocumentFormattingEdits: () => {}

Binary file not shown.