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

Platform specific configuration default values for extension authoring #22829

Closed
hackwaly opened this issue Mar 18, 2017 · 9 comments
Closed

Comments

@hackwaly
Copy link

This is useful, so we don't need programming to achieve it.

hackwaly/vscode-ocaml#82 (comment)

@weinand weinand added the info-needed Issue requires more information from poster label Mar 19, 2017
@weinand
Copy link
Contributor

weinand commented Mar 20, 2017

@hackwaly Please explain what feature you are asking for
(I do not want to dig into vscode-ocaml myself).

@hackwaly
Copy link
Author

I means ability to specify different default values for each platforms on same field of configuration. Eg. "executable_extname" on Windows default to ".exe" and for other platform default to "".

@weinand
Copy link
Contributor

weinand commented Mar 20, 2017

@hackwaly and where would this be used?
We have already a mechanism for task.json, launch.json, package.json to deal with platform differences. See https://code.visualstudio.com/docs/editor/tasks#_operating-system-specific-properties

@hackwaly
Copy link
Author

Sorry, I didn't see where package.json support it. I'll try it.

@weinand
Copy link
Contributor

weinand commented Mar 20, 2017

@hackwaly aha, you are asking for this feature in "package.json". Please be aware that the support described in https://code.visualstudio.com/docs/editor/tasks#_operating-system-specific-properties is only available for Debugger contributions in package.json.

I suggest that you create an example of what you want to do in a package.json.

@hackwaly
Copy link
Author

{
  "contributes": {
    "configuration": {
      "ocaml.replPath": {
        "type": "string",
        "default": "ocaml", // I want default to "ocaml.exe" on windows.
        "description": "Path to OCaml REPL."
      }
    }
  }
}

@weinand
Copy link
Contributor

weinand commented Mar 20, 2017

The configuration settings that you contribute in the package.json will end up as user setting.
Instead of using one ocaml.replPath for all platforms I recommend to use different paths for different platforms. VS Code uses this approach for the integrated shell:

2017-03-20_16-00-52

If the settings are shared across different platforms, a user can have different paths for different platforms simultaneously.

I do not think that your approach with the "executable_extname" variable would be of great use because it breaks down as soon as the path includes more than just the basename (e.g. a full path with drive letter and path separator).

@hackwaly
Copy link
Author

Thank you for your advice.

@weinand
Copy link
Contributor

weinand commented Mar 21, 2017

@hackwaly you are welcome!

@weinand weinand removed the info-needed Issue requires more information from poster label Mar 21, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants