Git Product home page Git Product logo

Comments (3)

dlech avatar dlech commented on June 12, 2024

Is all of the above correct?

I believe so. I didn't know you could have a global launch configuration.

Is it a good idea to encourage beginner users to use User Setting rather than Workspace settings for the EV3 browser configuration?

If a person will only use VS Code for ev3dev, then I suppose it would be OK. But it could result in some unexpected results if that person decided to branch out and use VS Code for something besides ev3dev. Imagine trying to write your first regular Python program and trying to run it and finding that it is trying to run on your EV3!

If so, is my configuration file optimal or what improvements could be made?

VS Code also has the concept of a Workspace. You can have settings and other configuration files that are specific to that workspace. Arbitrary folders (aka Projects) can be added or removed from that workspace. Perhaps this could be an alternative that is more global than a Project, but less global than User Settings.

What are the disadvantages of having the configuration in User Settings as opposed to Workplace Settings?

When you say "Workplace", I think you might mean Project rather than Workspace as I described above. And as I already mentioned, the disadvantage with using User Settings is that the settings will also apply to any non-ev3dev projects.

Is VS Code going to automatically recreate a .vscode folder in my project folder?

Only if you tell it to by creating a task, launch configuration or changing settings.

Can I assume that what works for me on Windows 10 is also going to work for Linux and MacOS?

Yes, that is generally a safe assumption with VS Code.

from vscode-ev3dev-browser.

ndward avatar ndward commented on June 12, 2024

Even with a global launch configuration for EV3 Python I believe a non-EV3 script can easily be run locally by right-clicking the script and choosing Run in Terminal, so that should not be a problem. And I suppose it's possible to have multiple launch configurations in User Settings, with the user switching between them as desired.

I'm interested in helping beginner users and I think those users are unlikely to work with workspaces containing multiple folders. If they don't create a workspace with multiple folders then I think the workspace becomes synonymous with the one open project folder.

from vscode-ev3dev-browser.

ndward avatar ndward commented on June 12, 2024

I realised that right-clicking and choosing Run in Terminal does not allow for debugging such as breakpoints etc. I'm guessing that the best solution for beginner users is to have two configurations in global settings like this:

{
    "launch": {
        "version": "0.2.0",
        "configurations": [{
            "name": "Download and Run",
            "type": "ev3devBrowser",
            "request": "launch",
            "program": "/home/robot/${workspaceRootFolderName}/${relativeFile}"
        },
        {
            "name": "Python: Current File (Integrated Terminal)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }]
    },
    "git.ignoreMissingGitWarning": true,
    "ev3devBrowser.confirmDelete": false,
    "editor.autoClosingBrackets": "never",
    "editor.autoClosingQuotes": "never",
    "files.eol": "\n",
    "ev3devBrowser.download.exclude": "{**/.*,LICENSE,README.md}"
}

This seems to work well because any time a script is launched it's possible to choose which of the two configurations to use. Pressing F5 simply uses the last used configuration.

I do find that sometimes a .vscode folder gets created in the open project folder. It doesn't seem to be a problem - I just delete it.

In the user settings code above I deleted some of the settings that were in my first message since they were the same as the default settings and thus redundant.

I plan to encourage my beginner audience to use the global launch configuration method as I have done.

from vscode-ev3dev-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.