Skip to content

Commit 34d5b55

Browse files
committed
feat(hints): add showCodeHintDocs preference to toggle doc popup
Lets users hide the documentation popup shown beside code hints while keeping the hint list itself enabled.
1 parent 535b44d commit 34d5b55

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/editor/CodeHintManager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ define(function (require, exports, module) {
272272
PreferencesManager.definePreference("showCodeHints", "boolean", true, {
273273
description: Strings.DESCRIPTION_SHOW_CODE_HINTS
274274
});
275+
PreferencesManager.definePreference("showCodeHintDocs", "boolean", true, {
276+
description: Strings.DESCRIPTION_SHOW_CODE_HINT_DOCS
277+
});
275278
PreferencesManager.definePreference("insertHintOnTab", "boolean", true, {
276279
description: Strings.DESCRIPTION_INSERT_HINT_ON_TAB
277280
});

src/languageTools/DefaultProviders.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ define(function (require, exports, module) {
3131

3232
var EditorManager = require("editor/EditorManager"),
3333
DocumentManager = require("document/DocumentManager"),
34+
PreferencesManager = require("preferences/PreferencesManager"),
3435
CommandManager = require("command/CommandManager"),
3536
Commands = require("command/Commands"),
3637
StringMatch = require("utils/StringMatch"),
@@ -257,6 +258,12 @@ define(function (require, exports, module) {
257258
}
258259

259260
function _showDocPopup($hint, docHtml) {
261+
// Single choke point for the docs popup beside the hint list - the preference gates
262+
// every caller (LSP hints here, npm hints, ...).
263+
if (PreferencesManager.get("showCodeHintDocs") === false) {
264+
_hideDocPopup();
265+
return;
266+
}
260267
var $menu = $hint.closest(".codehint-menu");
261268
if (!docHtml || !$menu.length) {
262269
_hideDocPopup();

src/nls/root/strings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,7 @@ define({
16911691
"DESCRIPTION_SCROLL_PAST_END": "true to enable scrolling beyond the end of the document",
16921692
"DESCRIPTION_MOUSE_WHEEL_SCROLL_SENSITIVITY": "Multiplier for mouse wheel scroll speed (0.1 to 10, default 1). Adjust if scrolling feels too slow or fast.",
16931693
"DESCRIPTION_SHOW_CODE_HINTS": "false to disable all code hints",
1694+
"DESCRIPTION_SHOW_CODE_HINT_DOCS": "false to hide the documentation popup shown beside code hints",
16941695
"DESCRIPTION_SHOW_CURSOR_WHEN_SELECTING": "Keeps the blinking cursor visible when you have a text selection",
16951696
"DESCRIPTION_SHOW_LINE_NUMBERS": "true to show line numbers in a “gutter” to the left of the code",
16961697
"DESCRIPTION_RULERS_COLUMNS": "An array of column numbers to draw vertical rulers in the editor. Eg: [80, 100]",

0 commit comments

Comments
 (0)