Giter Club home page Giter Club logo

vala-lint-vscode's Introduction

Vala-Lint For Visual Studio Code Extension

This extension adds Vala language support to the vscode-linter extension using vala-lint.

Installation

Visual Studio Code Marketplace: https://marketplace.visualstudio.com/items?itemName=ColinKiama.linter-vala

Manual Instructions: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions

Requirements

Setup Guide

Install Vala Lint

First, you need to install the vala-lint linter program. It's recommeded that you install it using meson and ninja.

To verify that you've installed the Vala Lint program, in your terminal, enter the following command:

io.elementary.vala-lint --version

The terminal should then output the following line:

Version: version_number

If you don't see the line above then you did not install the Vala lint program properly. Please ensure that the directory of io.elementary.vala-lint has been added to the PATH environment variable. io.elementary.vala-lint is what the Visual Studio Extension is looking for.

Install The Vala-Lint Visual Studio Code Extension

You can either:

When you install the "Vala-Lint" extension, you will also be installing the "vscode-linter" extension which is what the Vala-Lint extension uses to help implement its functionality.

Verify That The Vala-Lint Visual Studio Code Extension Is Working

To verify that the extension is working:

  1. Open a Vala source code file in Visual Studio Code (Has .vala file extension)
  2. Open the Output View (Toggle with: CTRL + K, CTRL + H)
  3. Swith the selected item in the dropdown to "linter"

Now you should text like the following (Note: in this example, the file that is opened is called "Result.vala"):

Vala-Lint's command took 14ms
Language id: vala
Matching linters: [
  "vala"
]
Reading from cache? false
Linter config: {
  "capabilities": [],
  "command": [
    "io.elementary.vala-lint",
    "--print-end",
    [
      "$config",
      "--config",
      "$config"
    ],
    "$file"
  ],
  "configFiles": [
    "vala-lint.conf",
    ".vala-lint.conf"
  ],
  "enabled": true,
  "languages": [
    "vala"
  ],
  "name": "Vala-Lint",
  "url": "https://github.com/vala-lang/vala-lint",
  "importPath": "/home/username/.vscode/extensions/colinkiama.linter-vala-1.0.0/dist/extension.js"
}
Args: {
  "$rootDir": "/home/username/sources/astral",
  "$file": "/home/username/sources/astral/subprojects/result/lib/Result.vala",
  "$extension": ".vala",
  "$extensionBare": "vala",
  "$config": "",
  "$debug": false,
  "$lint": true,
  "$language": "vala",
  "$shebang": ""
}
{
  "rootDir": "/home/username/sources/astral",
  "configFile": "",
  "command": [
    "io.elementary.vala-lint",
    "--print-end",
    "/home/username/sources/astral/subprojects/result/lib/Result.vala"
  ]
}

If you don't have an output like what is listed above then you probably have not installed the extension properly.

If you did not install the Vala Lint program properly, you may see a message like this in the Output View with "linter" selected in the dropdown:

Searched for any of io.elementary.vala-lint; couldn't be found within $PATH: [
    "/home/username/.local/bin",
    "...",
]

As we've stated above, ensure that directory where io.elementary.vala-lint is located is available on the $PATH enviornment variable.

Contributing

Refer to vscode-linter's Creating Linters Guide and the vala-lint linter program source code.

It's recommended that you create an issue or check if it already exists first before starting any work.

Create a pull request when you are ready to submit your changes to the project. Your changes should go into the main branch.

Enjoy!

vala-lint-vscode's People

Contributors

colinkiama 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.