Skip to content

Commit 927043c

Browse files
committed
Add README.md and LICENSE
1 parent 6df0aea commit 927043c

5 files changed

Lines changed: 52 additions & 2 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 WhiteMemory99
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Python Inlay Hints
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4+
5+
This plugin _(quite decently)_ implements inlay parameter hints support for <b>Python</b>.
6+
7+
## Supported expressions
8+
9+
Pretty much any expression is supported:
10+
* dataclass and class instantiation
11+
* lambdas
12+
* decorators
13+
* function calls
14+
* etc.
15+
16+
**Look at the examples below to see how it works.**
17+
18+
## Settings
19+
20+
The plugin can be disabled anytime in IDE settings:
21+
22+
#### Settings -> Editor -> Inlay Hints -> Parameter names -> Python
23+
24+
## Demo Screenshots
25+
26+
![](./images/func_example.png)
27+
28+
![](./images/class_example.png)

images/class_example.png

68.9 KB
Loading

images/func_example.png

87.9 KB
Loading

src/main/kotlin/space/whitememory/pythoninlayparams/PythonInlayHintsProvider.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
1515

1616
override fun getDefaultBlackList() = setOf<String>()
1717

18+
override fun isBlackListSupported() = false
19+
1820
override fun getParameterHints(element: PsiElement): MutableList<InlayInfo> {
1921
val inlayInfos = mutableListOf<InlayInfo>()
2022

@@ -62,8 +64,7 @@ class PythonInlayHintsProvider : InlayParameterHintsProvider {
6264
}
6365

6466
val resolvedParameters = getElementFilteredParameters(resolved)
65-
// If there's no parameters in the object, we use the dataclass attributes instead,
66-
// if there is any.
67+
// If there's no parameters in the object, we use the dataclass attributes instead, if there is any
6768
if (resolvedParameters.isEmpty() && dataclassAttributes.isNotEmpty()) {
6869
dataclassAttributes.zip(args).forEach {
6970
inlayInfos.add(InlayInfo(it.first, it.second.textOffset))

0 commit comments

Comments
 (0)