Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external snippets #91

Open
dsisnero opened this issue Sep 10, 2024 · 4 comments
Open

external snippets #91

dsisnero opened this issue Sep 10, 2024 · 4 comments

Comments

@dsisnero
Copy link

I am trying to get external snippets working. When I copy the and paste the external-snippets.toml the snippets validate. Not getting any snippets when it is set in languages.toml.

Also, with the external-snippets.toml - it always looks for [sources.path] . how can you set it so it changes snippets for the language file that is open? .py - scope python - .rb -> scope ruby

@GameDungeon
Copy link

You did remember to run fetch external snippets, correct?

I'm pretty sure the scope flag exists purely to change the snippets based on the file open. Eg. Only snippets in scope python are used in .py files.

@estin
Copy link
Owner

estin commented Sep 13, 2024

@dsisnero Hi. Did you run simple-completion-language-server fetch-external-snippet ?

@dsisnero
Copy link
Author

dsisnero commented Dec 2, 2024

my external snippets are working. I am on windows and when I have something like this in external-snippets.json. If I run

[[sources.paths]]
scope = ["ruby"]
path = "snippets/ruby/ruby.json"

if I run simple-completion-language-server validate-snippets I get
2024-12-02T19:42:01.399352Z ERROR simple_completion_language_server::snippets::config: On read dir "C:\\Users\\Dominic E Sisneros\\AppData\\Roaming\\helix\\snippets": The system cannot find the path specified. (os error 3)

What I want is the snippets directory to be relative to the external-snippets.toml file which is in c:\windows_home.config\helix

@estin
Copy link
Owner

estin commented Dec 3, 2024

Try to set env variable EXTERNAL_SNIPPETS_CONFIG=c:\windows_home.config\helix and SNIPPETS_PATH=c:\windows_home.config\helix for all

  • simple-completion-language-server fetch-external-snippet
  • simple-completion-language-server validate-snippets
  • and lsp mod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants