Coder Social home page Coder Social logo

iamnikola / vscode-inline-parameters Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robertostermann/vscode-inline-parameters

0.0 0.0 0.0 6.09 MB

An Visual Studio Code extension that adds inline parameter annotations.

Home Page: https://marketplace.visualstudio.com/items?itemName=RobertOstermann.inline-parameters-extended

License: MIT License

Python 7.84% PHP 2.69% Java 0.46% Lua 0.59% Go 6.84% TypeScript 81.58%

vscode-inline-parameters's Introduction

Inline Parameters Extended for VSCode

Inline Parameters for VSCode

VS Marketplace Version VS Marketplace Installs VS Marketplace Rating

Now with Golang and Python support!

This extension implements the new Inlay Hints API to add Inline Parameters for Golang, Java, Lua, PHP, and Python.

Example of extension

This is a feature that was popularized 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.

Speed up your development with parameter hints!

Language Support

Currently, this extension supports the following languages:

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.go.enabled Show inline parameters for Go true
inline-parameters.go.executablePath Path to golang executable. go
inline-parameters.go.hintBeforeParameter Should the inlay hint appear before the parameter. If this is set to false the hint will appear after the parameter. true
inline-parameters.go.showVariadicNumbers Show the number of times a variadic parameter has been called true
inline-parameters.go.suppressWhenArgumentMatchesName If the value given to a parameter is the same as the parameter name, hide the parameter name true
inline-parameters.java.enabled Show inline parameters for Java true
inline-parameters.java.hintBeforeParameter Should the inlay hint appear before the parameter. If this is set to false the hint will appear after the parameter. true
inline-parameters.java.showVariadicNumbers Show the number of times a variadic parameter has been called true
inline-parameters.java.suppressWhenArgumentMatchesName If the value given to a parameter is the same as the parameter name, hide the parameter name true
inline-parameters.lua.enabled Show inline parameters for Lua true
inline-parameters.lua.hintBeforeParameter Should the inlay hint appear before the parameter. If this is set to false the hint will appear after the parameter. true
inline-parameters.lua.suppressWhenArgumentMatchesName If the value given to a parameter is the same as the parameter name, hide the parameter name true
inline-parameters.php.enabled Show inline parameters for PHP true
inline-parameters.php.hintBeforeParameter Should the inlay hint appear before the parameter. If this is set to false the hint will appear after the parameter. true
inline-parameters.php.showDollarSign Show the $ character before PHP parameter names false
inline-parameters.php.showVariadicNumbers Show the number of times a variadic parameter has been called true
inline-parameters.php.suppressWhenArgumentMatchesName If the value given to a parameter is the same as the parameter name, hide the parameter name true
inline-parameters.python.enabled Show inline parameters for Python true
inline-parameters.python.executablePath Path to python executable. Setting this overrides the default of using the same path as ms-python or the default shell path if ms-python is not installed.
inline-parameters.python.hintBeforeParameter Should the inlay hint appear before the parameter. If this is set to false the hint will appear after the parameter. true
inline-parameters.python.showVariadicNumbers Show the number of times a variadic parameter has been called true
inline-parameters.python.suppressWhenArgumentMatchesName If the value given to a parameter is the same as the parameter name, hide the parameter name true

Inlay Hint Settings

This extension utilizes the Inlay-Hints API provided by VSCode. Here are some additional settings provided by VSCode.

Name Description Default
editor.inlayHints.enabled Enables Inlay Hints for the editor. true
editor.inlayHints.fontFamily Controls font family of inlay hints in the editor. When set to empty, the #editor.fontFamily# is used. ""
editor.inlayHints.fontSize Controls font size of inlay hints in the editor. A default of 90% of #editor.fontSize# is used when the configured value is less than 5 or greater than the editor font size. 0

There are also several settings to enable Inlay Hints for both JavaScript and TypeScript. These settings are available in the following setting sections.

javascript.inlayHints typescript.inlayHints

Contributions

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 (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 do this by triggering the hover providers for the function being called, and extracting the parameter names from the description.

Credits / Links

License

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

vscode-inline-parameters's People

Contributors

richardluo0 avatar robertostermann avatar hot-1 avatar imliam avatar cyberbeni avatar l1997i avatar jack0york avatar ryangjchandler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.