diff --git a/README.md b/README.md index 1acd6b9..b401cc3 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Shows the parameter name of the called function |`parameterHints.languages`|Enable Parameter Hints only for the selected languages|`all`| |`parameterHints.padding`|Padding|`1 4`| |`parameterHints.margin`|Margin|`0 1`| +|`parameterHints.defaultStyles`|Override styles for hints (default)|`{}`| +|`parameterHints.themeStyles`|Override styles for hints (per theme)|`{}`|     diff --git a/package.json b/package.json index 6df5707..0a2d94c 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,17 @@ "type": "string", "description": "Margin", "default": "0 1" - } + }, + "parameterHints.defaultStyles": { + "type": "object", + "description": "Override styles for hints (default)", + "default": {} + }, + "parameterHints.themeStyles": { + "type": "object", + "description": "Override styles for hints (per theme)", + "default": {} + } } } ], @@ -122,4 +132,4 @@ "dash-ast": "^2.0.1", "php-parser": "^3.0.1" } -} \ No newline at end of file +} diff --git a/src/lib/hints.js b/src/lib/hints.js index 26c8840..fd351bf 100644 --- a/src/lib/hints.js +++ b/src/lib/hints.js @@ -46,6 +46,10 @@ class Hints { return paddings.join('px ') + 'px'; } static paramHint(message, range) { + const defaultStyles = workspace.getConfiguration('parameterHints.defaultStyles'); + const colorTheme = workspace.getConfiguration('workbench').get('colorTheme'); + const themeStyles = workspace.getConfiguration('parameterHints.themeStyles').get(colorTheme); + return { range, renderOptions: { @@ -57,7 +61,9 @@ class Hints { margin: `${Hints.margin()}position: relative; padding: ${Hints.padding()}; display: inline-block;`, borderRadius: '5px', fontStyle: 'italic', - fontWeight: '400; font-size: 12px; line-height: 1;' + fontWeight: '400; font-size: 12px; line-height: 1;', + ...defaultStyles, + ...themeStyles } } };