diff --git a/package.json b/package.json index b44b379..e2d23bf 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,18 @@ "url": "https://github.com/NonSpicyBurrito/hoverlens.git" }, "main": "./dist/extension.js", - "contributes": {}, + "contributes": { + "configuration": { + "title": "Hover Lens", + "properties": { + "hoverlens.maximumCursorCount": { + "description": "Maximum cursor count which hover information will be displayed (set to 0 for unlimited).\nDisplaying hover information for too many cursors may degrade editor performance.", + "type": "number", + "default": 3 + } + } + } + }, "activationEvents": [ "onStartupFinished" ], diff --git a/src/decoration.ts b/src/decoration.ts index a50eeed..de6f1bd 100644 --- a/src/decoration.ts +++ b/src/decoration.ts @@ -10,7 +10,11 @@ export async function getDecorations( selections: readonly vscode.Selection[] ) { if (!selections.length) return [] - if (selections.length > 3) return [] + + const maxCount = vscode.workspace + .getConfiguration('hoverlens') + .get('maximumCursorCount', 3) + if (maxCount > 0 && selections.length > maxCount) return [] const positions = selections .map((selection) => selection.active)