Skip to content

Add linter configuration to initialization options #855

Open
@dbanck

Description

@dbanck

This is part of hashicorp/vscode-terraform#635

Use-cases

To enable the integration of linters within the language server, we need to accept a set of configurations upon initialization.

Proposal

  • Extend the initialization properties with the linter related configuration.

properties := map[string]interface{}{
"experimentalCapabilities.referenceCountCodeLens": false,
"options.rootModulePaths": false,
"options.excludeModulePaths": false,
"options.commandPrefix": false,
"options.ignoreDirectoryNames": false,
"options.experimentalFeatures.validateOnSave": false,
"options.terraformExecPath": false,
"options.terraformExecTimeout": "",
"options.terraformLogFilePath": false,
"root_uri": "dir",
"lsVersion": serverCaps.ServerInfo.Version,
}

  • Each linter will have a dedicated section in the configuration
  • The first linter we plan to support is tflint, new options might look like this:
    • options.linters.tflint.binaryPath
    • options.linters.tflint.binaryFlags
    • options.linters.tflint.lintOnSave
  • Validate the linter configuration and check if the passed binary is accessible and executable
  • If validation fails, fail silently and disable any internal linting code
  • If validation succeeds, the linters can be consumed on safe or via a command (separate issues)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlintingFunctionality related to linting and external linters

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions