Coder Social home page Coder Social logo

vscode-haskell-linter's Introduction

README

Overview

"haskell-linter" is a wrapper for hlint. It highlights hlint warnings and errors inline and provides a code-action to accept hlint suggestions.

Dependencies

It expects a version of hlint >= 1.9.1 to be installed and already added to the path. If it is installed but cannot be found, add the path to your preferences as seen below.

{
	"haskell.hlint.executablePath": "Path\To\Executable"
}

IDE

Configuration:

There are various options that can be configured by making changes to your user or workspace preferences.

Lint onType or onSave

By default the linter will lint as you type. Alternatively, set haskell.hlint.run to onSave or never if you want to lint only when the file is saved (works best if auto-save is on) or disable it for a workspace or entirely.

{
	"haskell.hlint.run": "onType" // also: "onSave", "never"
}

Hints

By default the linter simply calls the hlint command without arguments. To specify a set of hints to use or a set of hints to ignore, add them to the configuration as shown below.

{
	"haskell.hlint.hints": ["Default", "Dollar", "Generalise"],
    "haskell.hlint.ignore": ["Redundant do"]
}

Troubleshooting

Make sure you have a hlint installed and that the version is 1.9.1 or newer. If you're having issues with the extension, set the logLevel setting to log and check the output in the developer tools console.

{
    "haskell.hlint.logLevel": "log"
}

Acknowledgements

The extension architecture is based off of the PHPValidationProvider from the built-in php extension.

Changelog

0.0.6:

0.0.4:

  • Added hlint.ignore configuration (Thanks to @vigoo)

0.0.3:

  • Fixed bug where linting was always being performed on save
  • Added option to disable linting
  • Added configuration schema to package.json which helps users when changing preferences

0.0.2:

  • Fixed configuration, setting haskell.hlint.executablePath should work
  • Fixed code actions in response to this VS Code issue
  • Made issues more readable
  • Get information/choose from multiple suggestions
  • Default linting is now onType
  • Removed ignoreSeverity setting

vscode-haskell-linter's People

Contributors

hoovercj avatar danstiner avatar rimmington avatar vigoo avatar rvighne avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  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.