pycharm-djaneiro icon indicating copy to clipboard operation
pycharm-djaneiro copied to clipboard

Missing template variables

Open zolotov opened this issue 7 years ago • 6 comments

No segment for variable: var=0; name=VAR; required
Template#name: Djaneiro: Completions/required
Template#string: required=True$END$
No segment for variable: var=0; name=VAR; verbose_name_plural
Template#name: Djaneiro: Completions/verbose_name_plural
Template#string: verbose_name_plural$END$

Please test the rest templates

zolotov avatar Aug 09 '17 09:08 zolotov

These templates were direcly imported from sublime text without any modification, and I see room for improvement (e.g., providing a default instead of forcing True), but I'm not quite sure what you're asking or what you're doing to get these errors. Could you elaborate?

brmc avatar Aug 10 '17 04:08 brmc

Sure I can, in these templates you defined VAR variables but their texts don't contain $VAR$-variable reference, so IDE will throw an exception when you try to navigate to VAR variable. Please fix it by adding the variable reference into template text or removing variable definition. Also, it makes sense to test all your templates

zolotov avatar Aug 10 '17 10:08 zolotov

Oh... Sorry for the stupid question. I thought I was in an entirely different repo =) now we're on the same page.

There are tests, but they are done at the transpilation layer. This repo is mostly auto-generated.

I'll fix the transpiler and try to make the validation more rigorous. Maybe I can find some XSD's for live templates

Thanks for your feedback. I'll keep you updated on the progress.

If you notice anything else, or have any feature requests, don't hesitate to let me know

On Thursday, August 10, 2017, Alexander Zolotov [email protected] wrote:

Sure I can, in these templates you defined VAR variables but their texts don't contain $VAR$-variable reference, so IDE will throw an exception when you try to navigate to VAR variable. Please fix it by adding the variable reference into template text or removing variable definition. Also, it makes sense to test all your templates

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brmc/pycharm-djaneiro/issues/2#issuecomment-321519171, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQdQt8iUB6_3VWXrdsYW51n1bA1LZa9ks5sWuGIgaJpZM4Ox201 .

brmc avatar Aug 10 '17 16:08 brmc

I don't think XSD will help :( However I think tests also can be generated.

If you notice anything else, or have any feature requests, don't hesitate to let me know

Sure. Thanks

zolotov avatar Aug 10 '17 16:08 zolotov

For this specific case, I think an xsd v1.1 would work. It might not be able to validate the entire template format, but I'm no expert. Either way, if I can't find one, I don't plan to write one myself :)

On Thursday, August 10, 2017, Alexander Zolotov [email protected] wrote:

I don't think XSD will help :( However I think tests also can be generated.

If you notice anything else, or have any feature requests, don't hesitate to let me know

Sure. Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brmc/pycharm-djaneiro/issues/2#issuecomment-321599921, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQdQnURzyv06xzr-r0IRp3YZU-KyU7Wks5sWyyygaJpZM4Ox201 .

brmc avatar Aug 10 '17 16:08 brmc

  • one more
No segment for variable: var=0; name=VAR; blank
Template#name: Djaneiro: Completions/blank
Template#string: blank=True$END$

zolotov avatar Sep 29 '17 09:09 zolotov