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

RFC: mint.json autocomplete #13

Open
lukepighetti opened this issue May 4, 2020 · 8 comments
Open

RFC: mint.json autocomplete #13

lukepighetti opened this issue May 4, 2020 · 8 comments

Comments

@lukepighetti
Copy link
Contributor

lukepighetti commented May 4, 2020

Would be nice to have mint.json keys autocomplete. Any general thoughts or insights regarding best practices?

@s0kil
Copy link
Contributor

s0kil commented May 4, 2020

Yes, This is ideal since Mint checker verifies all the key-values in the mint.json config.

@lukepighetti
Copy link
Contributor Author

lukepighetti commented May 4, 2020

This appears to be the extent of mint.json https://github.com/mint-lang/mint/blob/68c8500993b40940eee867ef226946a4d00629d9/src/mint_json.cr#L109-L122.

It appears to be documented in full by https://www.mint-lang.com/guide/getting-started/configuration

I put this together as a guide:

{
  // The name of your application or package
  "name": "my-app",

  // The directories which contains source files of your application.
  "source-directories": ["source"],

  // The directories which contains tests for your application.
  "test-directories": ["tests"],

  // Contains the dependencies.
  "dependencies": [
    {
      // Git repository which uniquely identifies this package
      "repository": "https://github.com/foo/bar.git",

      // Version constraint in one of two formats
      //
      // `0.0.0 <= v < 1.0.0` where the v is the resolvable version or
      //
      // `master:1.0.0` where the first part is the Git reference
      // (of a branch, commit hash or tag) followed by a colon
      // and the version the package should resolve as this is
      // necessary because the version is only specified by tags.
      "constraint": "0.0.0 <= v < 1.0.0"
    }
  ],

  // Contains application specific information (can be omitted in packages)
  "application": {
    // A path to an HTML file which can contain links to external resources.
    "head": "public/head.html",

    // The initial title of the application.
    "title": "My App - Written in Mint!",

    // An object which contains informations which is converted to META tags.
    // Values can be a string or an array, which will be converted into a comma separated string.
    "meta": {
      "og:title": "My App",
      "charset": "utf-8",
      "description": "My App was written in Mint!",
      "keywords": [
        "apps",
        "mint",
        "mint-lang",
        "javascript",
        "transplier",
        "framework"
      ],
      "viewport": "width=device-width, initial-scale=1, shrink-to-fit=no"
    },

    // A path to an image file which is converted to different icons like favicons.
    "icon": "public/icon.png",

    // [PWA] The orientation of the application.
    // enum: portrait, landscape
    "orientation": "portrait",

    // [PWA] The name of the application.
    "name": "My App",

    // [PWA] The theme color of the application.
    "theme-color": "#2ABBA2",

    // [PWA] The display property of the application,
    // enum: fullscreen, standalone, minimal-ui, browser
    "display": "browser"
  },

  // Contains formatter specific configuration
  "formatter-config": {
    // Specifies how many spaces is used to indent code blocks.
    "indent-size": 2
  },

  "external": {
    // Specify path to the JavaScript files you want to include.
    "javascripts": ["public/my-javascript.js"],

    // Specify path to the CSS files you want to include.
    "stylesheets": ["public/my-stylesheet.css"]
  }
}

@lukepighetti
Copy link
Contributor Author

@s0kil Can you please review the above for accuracy and exhaustiveness? Do you have any basic guidelines for best practices on how to implement this feature?

@s0kil
Copy link
Contributor

s0kil commented May 4, 2020

@lukepighetti This should also be handled by the Mint language server.

@lukepighetti
Copy link
Contributor Author

lukepighetti commented May 4, 2020

That makes sense, I take it this feature is blocked at the moment then?

As a note, we could make arguments for having everything, including tasks/commands being driven by the mint binary. This particular feature seems to be low risk in terms of bit-rot.

@s0kil
Copy link
Contributor

s0kil commented May 4, 2020

In progress... Someone has to build the language server (:

@lukepighetti
Copy link
Contributor Author

lukepighetti commented May 4, 2020

I'll consider this blocked until you state otherwise. Just ping me when you're ready to proceed either with a manual system (laid out above) or lang server based.

@gdotdesign
Copy link
Member

@lukepighetti the initial version of a language server has been shipped in 0.12.0

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

No branches or pull requests

3 participants