-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat: klipper config-file language #1400
feat: klipper config-file language #1400
Conversation
hey! thx for your PR. i'm looking forward to seeing when this one is finished.
sry... i posted this to early... i read the full post now. i would "drop" the error message for this PR and add it in another PR. Mainsail itself should have access to this file from the current klipper version. (http://<ip or hostname>/server/files/docs/Config_Reference.md) |
please add this also to the
this should fix the PR check and i think its not necessary to "clean" these files. |
i have now added these two lines to
The paths in your suggestion don't seem to fit, or should that be an idea for a new folder structure? I have also removed the auto completion and will add it better with better error highlighting in an extra PR. And yes I think a lezer grammar for jinja2/gcode is a good idea but I'm not very familiar with it. But I could try it. Is there any good documentation regarding jina2 in klipper or what is possible in klipper but not natively supported by jina2?
thanks for the hint I've been looking for how to get this information |
sry for the long delay...
|
No problem
|
maybe you can also drop the "Codemirror" directory. |
mh I don't know. I the new version there will be some files in Codemirror folder which are not specific to any language like printLezerTree for better debugging or the configuration for the parser testing framework. Tomorrow I will hopefully have the new version running and will push it then you can form your own opinion. |
ah ok. sry i overlooked this. then it looks good to me. |
with code folding for the configuration blocks and with basic auto completion example
fix parsing errors: - paths with "~" - special characters in [respond] - gcode also appear after "<string>_gcode:"
fixed package-lock fixed prettier and eslint errors
in the case of merge conflicts with rebase, only the version from develop was used
c01d684
to
441e456
Compare
Fixed some grammar bugs.
But I'm not sure if it wouldn't be better to only build the parser/language if changes were actually made to it, instead of doing it with every build. |
@forgodtosave any updates here? |
I am closing this PR because no response. Please create a new (up-to-date) PR if you want to continue working on this feature. |
Description
This PR adds a codemirror language packet. This includes a lezer parser for the printer.cfg file where everything related to gcode/jinja2 is forwarded to the old parser. Furthermore, code folding for the config blocks as well as syntax error highlighting is implemented. Also a basic example of auto completion was implemented.
Here the following question arose:How context sensitive should autocomletion and linting be?
Should only options be suggested that are also available under the following config block?
Should all options that cannot exist in the context also be marked as errors?
Should only certain data types be available after certain options?
This all should be possible (see auto completion example) but you would have to store all this information somehow.Hard coding would be possible, but you would have to keep it up to date.
Of course, it would be much nicer and more effective to automatically extract this information from this file when updating klipper. That should be possible for the most part, even if certain dependencies may not be easy to extract.
I could try that, the only question is whether and how I should proceed. In an extra PR, ...?
(part of other new PR)
I'm still unsure about the following things and would appreciate feedback and ideas:
the auto generated files throw an styling error, should I really let the prettier run over then?Related Tickets & Documents
Solution for issue #1355
Mobile & Desktop Screenshots/Recordings
[optional] Are there any post-deployment tasks we need to perform?