Giter Site home page Giter Site logo

Comments (5)

hangyav avatar hangyav commented on May 28, 2024

Yes, all unknown file types should be checked as plain text file. However, you need to set the .rst file type in your config to be checked. What text editor do you use and how does your config look like?

from textlsp.

tanj avatar tanj commented on May 28, 2024

I'm using helix

I took the sample config from the README.md and converted to toml. I'm not sure where to add an extension to be included in checked files.

[[language]]
name = "rst"
language-servers = ["esbonio-lsp", "text-lsp"]
language-id = "restructuredtext"

# other config removed for clarity

[language-server.text-lsp]
command = "C:/Python310/Scripts/textlsp"

[language-server.text-lsp.config.analysers.languagetool]
enabled=true
check_text={on_open=true,on_save=true,on_change=false}

[language-server.text-lsp.config.analysers.gramformer]
enabled=false
gpu=false
check_text={on_open=false,on_save=true,on_change=false}

[language-server.text-lsp.config.analysers.hf_checker]
enabled=true
gpu=false
model='pszemraj/flan-t5-large-grammar-synthesis'
min_length=40
check_text={on_open=false,on_save=true,on_change=false}

[language-server.text-lsp.config.analysers.hf_completion]
enabled=true
gpu=false
model='bert-base-multilingual-cased'
topk=5

[language-server.text-lsp.config.documents]
org={ org_todo_keywords=['TODO','IN_PROGRESS','DONE']}
txt={parse=true}

helix sends this to configure

{
  "jsonrpc": "2.0",
  "method": "workspace/didChangeConfiguration",
  "params": {
    "settings": {
      "analysers": {
        "gramformer": {
          "check_text": {
            "on_change": false,
            "on_open": false,
            "on_save": true
          },
          "enabled": false,
          "gpu": false
        },
        "hf_checker": {
          "check_text": {
            "on_change": false,
            "on_open": false,
            "on_save": true
          },
          "enabled": true,
          "gpu": false,
          "min_length": 40,
          "model": "pszemraj/flan-t5-large-grammar-synthesis"
        },
        "hf_completion": {
          "enabled": true,
          "gpu": false,
          "model": "bert-base-multilingual-cased",
          "topk": 5
        },
        "languagetool": {
          "check_text": {
            "on_change": false,
            "on_open": true,
            "on_save": true
          },
          "enabled": true
        }
      },
      "documents": {
        "org": {
          "org_todo_keywords": [
            "TODO",
            "IN_PROGRESS",
            "DONE"
          ]
        },
        "rst": {
          "parse": true
        },
        "txt": {
          "parse": true
        }
      }
    }
  }
}

from textlsp.

hangyav avatar hangyav commented on May 28, 2024

Your config looks good in general. The only issue is that in the config table you need to put everything (analysers and documents) under textLSP, e.g.: [language-server.text-lsp.config.textLSP.analysers.languagetool]. It works for me using helix version 23.05 and the following minimal config:

[[language]]
name = "rst"
language-server = { command="textlsp", language-id = "restructuredtext" }
config = {textLSP={analysers={languagetool={enabled=true,check_text={on_open=true, on_save=true,on_change=false}}}}}

from textlsp.

tanj avatar tanj commented on May 28, 2024

ok, I was able to get diagnostics showing up with the fix to the config. (I also disabled the hf analysers because that seemed to be causing me issues)

Now, I'm getting Code action is not supported for range. errors.

from textlsp.

hangyav avatar hangyav commented on May 28, 2024

Great!

What issues do you have with the HF analysers (is it hf_checker or hf_completion, or both)?

from textlsp.

Related Issues (5)

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.