Skip to content

vale-ls is incompatible with current vale versions for completions #28

@moritzfl

Description

@moritzfl

Completions rely on style paths being present. However, resolving the styles path currently fails:

Here’s the exact spot in vale-ls where the StylesPath vs. Paths mismatch breaks completions:

The config struct only accepts StylesPath, it does not consider Paths

  • ValeConfig expects a StylesPath field. If the JSON doesn’t contain it, deserialization fails.
    • File: /src/vale.rs
    • Lines: 25-27
#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "PascalCase")]
pub(crate) struct ValeConfig {
    pub styles_path: PathBuf,
}

Sample vale output for vale in version 3.13.1:

  {
  "BlockIgnores": {},
  "Checks": null,
  "Formats": {
    "py": "md",
    "rs": "md"
  },
  "Asciidoctor": {},
  "FormatToLang": {},
  "GBaseStyles": null,
  "GChecks": {},
  "IgnoredClasses": null,
  "IgnoredScopes": null,
  "MinAlertLevel": 0,
  "Vocab": null,
  "RuleToLevel": {},
  "SBaseStyles": {
    "*.{adoc,md,rst,py,rs}": [
      "Vale",
      "Google",
      "RedHat",
      "proselint",
      "write-good"
    ]
  },
  "SChecks": {
    "*.{adoc,md,rst,py,rs}": {}
  },
  "SkippedScopes": null,
  "Stylesheets": {},
  "TokenIgnores": {
    "*.{adoc,md,rst,py,rs}": [
      "(\\x60[^\\n\\x60]+\\x60)",
      "([^\\n]+=[^\\n]*)",
      "(\\+[^\\n]+\\+)",
      "(http[^\\n]+\\[)"
    ]
  },
  "CommentDelimiters": {},
  "WordTemplate": "",
  "RootINI": "/Users/moritz/Desktop/git/vale-cli-plugin/.vale.ini",
  "Paths": [
    "/Users/moritz/Library/Application Support/vale/styles",
    "/Users/moritz/Desktop/git/vale-cli-plugin/styles"
  ],
  "ConfigFiles": [
    "/Users/moritz/Desktop/git/vale-cli-plugin/.vale.ini"
  ],
  "NLPEndpoint": ""
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions