Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(editors/vscode): Add requiresConfiguration option #4023

Merged
merged 4 commits into from
Dec 23, 2022

Commits on Dec 21, 2022

  1. feat(editors/vscode): Add requiresConfiguration option

    This PR introduces a new `rome.requiresConfiguration` option that disables the linter and formatter if a workspace doesn't contain a `rome.json` configuration.
    
    The addition of the option is motivated by #3506 where users want to have an easy way to disable Rome for all projects not using Rome.
    
    The new option doesn't fully disable Rome but only disables the linter and formatter (operations that are performed automatically on save). This has the benefit that other actions like sorting imports, or refactors remain available.
    
    The implementation for the linter and formatter differ:
    
    * Formatter: I changed the extension to not register the formatting capabilities if the `rome.json` file is missing and the `requiresConfiguration` option is set. This so that VS Code can pick up another default formatter (if installed).
    * Linter: Returns an empty list of diagnostics from `pull_diagnostic`
    
    I tested that:
    * Formatting and linting is working if the option is false
    * Formatting and linting is working if the option is `true` and a `rome.json` file is present
    * Formatting and linting is disabled if the option is `true` and the project has no `rome.json` file
    MichaReiser authored and leops committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    75a66c7 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2022

  1. Improve documentation

    MichaReiser committed Dec 22, 2022
    Configuration menu
    Copy the full SHA
    0d244a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a1e71fa View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2022

  1. Update crates/rome_lsp/src/session.rs

    Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
    MichaReiser and ematipico authored Dec 23, 2022
    Configuration menu
    Copy the full SHA
    0a8ec9a View commit details
    Browse the repository at this point in the history