fig
fig copied to clipboard
Fig stopped showing completions after adding spec to ~/.fig/autocomplete
I created a custom local script (in the main
~/.fig/autocomplete
, messed up fig somehow because popup stopped appearing for all other specs. Realised later that I probably had to create it in~/.fig/user/autocomplete
Hi, I was the one encountering the issue. To be honest I'm not sure it's a bug in the tool but more of a chance of improving the docs.
I was following the docs to create the specs for an internal tooling and the documentation only shows how to publish the spec & share it with my team; which I don't necessarily want to do (but I realise why you consider it as happy path as this helps you strengthen your network effect).
I later realised that there's a command npm run copy-to-global
that allows me to copy my private spec to my main ~/.fig
autocomplete.
During this whole process all autocompletes except the one I just added stopped working. I didn't want to troubleshoot so I just uninstalled & re-installed again right away, and that's how this issue got here.
This is definitely a good opportunity for improving the docs. We need to do a major revamp of them.
My usual workflow for editing personal specs:
# First time setup:
# cd
# npx @withfig/autocomplete-tools@latest init
cd ~/.fig/autocomplete
npm run create-spec SPEC_NAME
code . --goto src/SPEC_NAME.ts # or vim src/SPEC_NAME.ts
# Edit spec, then run this to test it:
npm run build
This avoids switching to dev mode. Developer mode in autocomplete makes it only load from ./build, instead of doing a normal lookup. You can still do npm run dev
, but this means no other specs will load.
Hope that made sense! We'll have to think of ways to make this much clearer in the future.
Thanks for the update, I can confirm that I wasn't in dev mode. Before resorting to uninstalling I have tried with different terminal sessions and nothing worked.
I'll keep in mind your workflow though, thanks!
Hi, I was the one encountering the issue. To be honest I'm not sure it's a bug in the tool but more of a chance of improving the docs.
I was following the docs to create the specs for an internal tooling and the documentation only shows how to publish the spec & share it with my team; which I don't necessarily want to do (but I realise why you consider it as happy path as this helps you strengthen your network effect).
I later realised that there's a command
npm run copy-to-global
that allows me to copy my private spec to my main~/.fig
autocomplete.During this whole process all autocompletes except the one I just added stopped working. I didn't want to troubleshoot so I just uninstalled & re-installed again right away, and that's how this issue got here.
we load specs from ~/.fig/autocomplete/build
and ~/.fig/user/autocomplete/build
. I should have updated the copy-to-global
script a while ago.
Edit: On February 3rd to be exact, if you created your local fig autocomplete spec before that date I'd suggest you to recreate it.
Understood, I've created the spec 5 days ago.
Than that's not the problem😄
Sorry for the long delay here. We've updated our docs to reflect the new method for creating private completions. If you still have the .ts
file you created for the spec, you can just run
npx @fig/publish-spec --spec-path path/to/spec.ts
as documented here https://fig.io/docs/guides/autocomplete-for-internal-tools#4-publish-your-spec.
We unfortunately did not make this breaking change to private specs very clear. Apologies for the inconvenience -- we are working towards improving our changelog and giving advanced notice for breaking changes.
Let me know if you are able to get this working or run into any issues
Hello, when I run:
npx @fig/publish-spec --spec-path ~/.fig/autocomplete/src/my-cli.ts
The changes do not take effect unless I also run:
fig restart
Is that expected? Thanks.
It isn't expected but it may be a matter of seconds. I'll see if I can reproduce.