• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.

Inline Parameters for VSCode

Inline Parameters for VSCode

VS Marketplace Version VS Marketplace Installs VS Marketplace Rating

An extension for Visual Studio Code that adds inline parameter annotations when calling a function.

Example of extension

This is a feature that was popularised by JetBrains' IDEs that can give you additional context when reading your code, making it easier to understand what different function parameters refer to by showing the parameter's name inline.

No longer do you have to be confused about whether the needle or haystack comes first, or have to slow down your workflow by going to a function's source to figure out what it does!

Language Support

Currently, this extension supports the following languages:

Want to contribute additional language support?

Additional language support is welcome as pull requests, and highly encouraged. You can see the source code to see how existing languages have been implemented.

Currently, the extension has 2 major steps that all language drivers must implement:

  1. Parsing the source code of the currently active file (eg. by using an AST library - AST Explorer can assist in navigating it) to retrieve a list of positions where annotations should be inserted
  2. Getting the name of the parameters to use as the annotations. Existing language drivers does this by triggering the hover providers for the function being called, and extracting the parameter names from the description

Settings

The extension provides a handful of configuration settings you can use to customise the look and behaviour of the parameters.

Name Description Default
inline-parameters.enabled Show inline parameters true
inline-parameters.leadingCharacters Characters to be shown before each parameter annotation ""
inline-parameters.trailingCharacters Characters to be shown after each parameter annotation ":"
inline-parameters.showPhpDollar Show the $ character before PHP parameter names false
inline-parameters.hideSingleParameters Hide inline parameters if a function only has 1 parameter false
inline-parameters.parameterCase Forcibly change the case of the inline parameter name. Options are normal, lowercase or uppercase "normal"
inline-parameters.showVariadicNumbers Show the number of times a variadic parameter has been called true
inline-parameters.hideRedundantAnnotations If the value given to a parameter is the same as the parameter name, hide the parameter name true

There are also a handful of settings that can be used to customise the styling of the annotation to your own personal preference.

Name Description Default
inline-parameters.fontWeight Annotation styling of font-weight CSS property "400"
inline-parameters.fontStyle Annotation styling of font-style CSS property "italic"
inline-parameters.fontSize Annotation styling of font size CSS property 0.85em
inline-parameters.margin Annotation styling of margin CSS property 0.25em
inline-parameters.padding Annotation styling of padding CSS property 0.25em 0.5em
inline-parameters.border Annotation styling of border CSS property none
inline-parameters.borderRadius Annotation styling of border-radius CSS property 0.25em

Themable Colours

You can change the default foreground and background colours in the workbench.colorCustomizations property in user settings.

Name Description
inlineparameters.annotationForeground Specifies the foreground colour for the annotations
inlineparameters.annotationBackground Specifies the background colour for the annotations

Commands

Name Description Keyboard Shortcut
inline-parameters.toggle Hide / show inline parameters Ctrl K A or ⌘ K A

Credits / Links

License

The MIT License (MIT). Please see the license file for more information.

More Repositories

1

awesome-livewire

🚀 A curated list of awesome resources related to Livewire. https://github.com/livewire/livewire
647
star
2

laravel-blade-helper

An easier way to define custom Blade directives.
PHP
178
star
3

laravel-env-set-command

Set a .env file variable from the command line.
PHP
110
star
4

php-unique-gmail-address

A package to ensure that a Gmail address is unique
PHP
68
star
5

Lua-Collections

A robust Lua collection class based on Laravel collections.
Lua
50
star
6

laravel-throttle-simultaneous-requests

Throttle the current user's requests based on how many requests are currently being executed.
PHP
46
star
7

tweet-markdown

Effortlessly turn a Tweet into beautiful markdown
PHP
10
star
8

shareable-link

Conveniently generate shareable URLs for various social media websites.
PHP
9
star
9

liamhammett.com-2017

PHP
6
star
10

php-name-of-person

Present names for English-language applications.
PHP
6
star
11

Transformice-Utility

The source code for the Transformice module #utility
Lua
5
star
12

tailwindcss-open-variant

Open variant for Tailwind CSS
JavaScript
5
star
13

php-catch-exit

Gracefully handle an unwanted exit statement.
PHP
4
star
14

laravel-macros

A collection of miscellaneous methods to extend some of Laravel's core classes through the use of macros and mixins
PHP
3
star
15

autoexec.cfg

My personal settings and configuration for playing CS:GO
AutoHotkey
2
star
16

php-indefinite-article

Determine the indefinite article of an English term
PHP
2
star
17

oauth2-transferwise

TransferWise OAuth 2.0 Client Provider for The PHP League OAuth2-Client
PHP
2
star
18

sass-utility-classes

CSS utility classes.
CSS
1
star
19

php-nhs-number

Utility class to validate, format and generate NHS numbers.
PHP
1
star
20

tfm.pics

PHP
1
star
21

php-modifiers

Adds the ability to apply a range of optional modifiers `! @ ~ + -` when calling your class methods to augment them with a unique syntax.
PHP
1
star
22

transformice-records

#records module for the game Transformice
Lua
1
star