Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)|`{}`|

 
 
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
}
}
],
Expand Down Expand Up @@ -122,4 +132,4 @@
"dash-ast": "^2.0.1",
"php-parser": "^3.0.1"
}
}
}
8 changes: 7 additions & 1 deletion src/lib/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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
}
}
};
Expand Down