mint-vscode icon indicating copy to clipboard operation
mint-vscode copied to clipboard

RFC: mint.json autocomplete

Open lukepighetti opened this issue 5 years ago • 8 comments

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

lukepighetti avatar May 04 '20 14:05 lukepighetti

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

s0kil avatar May 04 '20 14:05 s0kil

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 avatar May 04 '20 15:05 lukepighetti

@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?

lukepighetti avatar May 04 '20 15:05 lukepighetti

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

s0kil avatar May 04 '20 15:05 s0kil

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.

lukepighetti avatar May 04 '20 15:05 lukepighetti

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

s0kil avatar May 04 '20 15:05 s0kil

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.

lukepighetti avatar May 04 '20 15:05 lukepighetti

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

gdotdesign avatar Apr 14 '21 14:04 gdotdesign