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

Create a CLI frontend to the backend #79

Closed
rcjsuen opened this issue Jul 17, 2017 · 4 comments
Closed

Create a CLI frontend to the backend #79

rcjsuen opened this issue Jul 17, 2017 · 4 comments
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jul 17, 2017

While many of the features of the language server protocol doesn't make sense outside of the context of the editor, formatting and validation is something that can performed on a file. We should create a CLI to format and validate Dockerfiles.

@rcjsuen rcjsuen self-assigned this Oct 25, 2017
rcjsuen added a commit that referenced this issue Nov 13, 2017
This reverts commit f9af603.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
@rcjsuen
Copy link
Owner Author

rcjsuen commented Nov 13, 2017

I've reverted this fix and reopend this because I feel it doesn't make sense for this feature to be available in the language server.

What should be done instead is for all of the heavy lifting to be moved to a new and separate project in its own npm module. That npm module would have its own separate CLI for formatting and validating Dockerfiles.

The language server would then depend on that module and use that module to process and parse the Dockerfile. Whatever results the module returns would be massaged by the language server and then sent back to the client.

@rcjsuen rcjsuen reopened this Nov 13, 2017
@rcjsuen
Copy link
Owner Author

rcjsuen commented Dec 16, 2017

The first phase of this refactoring has started with the parser being extracted out into its own Git repository at rcjsuen/dockerfile-ast.

@rcjsuen
Copy link
Owner Author

rcjsuen commented Dec 22, 2017

The second phase of this refactoring has completed with the formatter and linter being moved off to a new Git repository at rcjsuen/dockerfile-utils.

Feel free to install it with npm install -g dockerfile-utils and give it a try if you are interested! :)

@rcjsuen
Copy link
Owner Author

rcjsuen commented Jan 17, 2018

I've removed the validator and replaced it with a dependency on dockerfile-utils in commit cc4d893 but I wrote the wrong issue number in the commit message. The formatter has been partially replaced but most of the code is still around to handle textDocument/onTypeFormatting and textDocument/rangeFormatting requests. The full document textDocument/formatting request however has been modified to delegate to dockerfile-utils.

As the language server's validator and full document formatter has been modified to use dockerfile-utils, I'm going to consider this particular issue resolved. New issues will be opened for further refactorings as necessary and requests and bugs related to the CLI linter or formatter can be opened in the rcjsuen/dockerfile-utils repository.

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

No branches or pull requests

1 participant