Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

Autocomplete #2

Closed
Amzd opened this issue May 28, 2024 · 2 comments
Closed

Autocomplete #2

Amzd opened this issue May 28, 2024 · 2 comments

Comments

@Amzd
Copy link

Amzd commented May 28, 2024

Is there a way to manually generate the Loc type so I can get autocomplete? Rather than it being generated at the compile step.

@david-swift
Copy link
Member

The plugin calls the Generation executable which you could also call manually in your project directory, specifying the input file's path (Localized.yml) as the first argument and the path of the output file (Localized.swift) as the second one.

After compiling, you should get autocomplete for the Swift file generated via the plugin without requiring you to run the executable manually.

@Amzd
Copy link
Author

Amzd commented Jun 1, 2024

After compiling, you should get autocomplete for the Swift file generated via the plugin without requiring you to run the executable manually.

I can't get this to work with sourcekit-lsp, maybe some editors do a trick I am not seeing? I think it is related to this issue swiftlang/sourcekit-lsp#665

I am working around this by adding to my build-commands:

rm -f Sources/Target/Localized.swift
swift build [...]
ln -s .build/plugins/outputs/folder/Target/GenerateLocalized/Localized.swift Sources/Target/Localized.swift

@Amzd Amzd closed this as completed Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants