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

launch configs as preferences #4947

Merged
merged 6 commits into from
May 2, 2019
Merged

launch configs as preferences #4947

merged 6 commits into from
May 2, 2019

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Apr 18, 2019

Includes:

Running VS Code tests:

    {
      "name": "Launch VS Code Tests",
      "type": "node",
      "request": "launch",
      "args": [
        "${workspaceFolder}/examples/browser/src-gen/backend/main.js",
        "${workspaceFolder}/plugins/vscode-launch/tests",
        "--port",
        "3030",
        "--hostname",
        "0.0.0.0",
        "--extensionTestsPath=${workspaceFolder}/plugins/vscode-launch/out/test",
        "--hosted-plugin-inspect=9339"
      ],
      "env": {
        "THEIA_DEFAULT_PLUGINS": "local-dir:${workspaceFolder}/plugins"
      },
      "stopOnEntry": false,
      "sourceMaps": true,
      "outFiles": [
        "${workspaceFolder}/../.js"
      ]
    }
  • run the configuration in no debug mode and open browser

TODO:

@@ -57,7 +57,7 @@ export namespace PreferenceScope {
case 'application':
return PreferenceScope.User;
case 'window':
return PreferenceScope.Workspace;
return PreferenceScope.Folder;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello, in which case do we have preferencescope.workpace ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is inclusive, i.e folder allows workspace and global

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it mean, users wouldn't be able to define prefs only available at the "workspace" & "user" level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually the whole scope is valid check is bogus right now, it should be aligned with:
https://github.com/Microsoft/vscode/blob/750680d2f7ae563529501f8ec419d83ccf8ec325/src/vs/workbench/services/configuration/common/configuration.ts#L23-L26

It is not inclusive, folder preferences allow ONLY resource, workspace preference allow ONLY window and resource level. I will rework it as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elaihau @benoitf Would be fine to fix it with a follow-up PR? otherwise it would be postponed more and it does not seem to relate to referenced issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it could be resolved in a separate PR. since the next release would be either on Apr 30 or May 1, do we want to hold this one until the release is made?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please ask on Spectrum, if someone has concrete objections, yes

from my side, most important that it should be tested not only by me, but double checked by someone else

@benoitf
Copy link
Contributor

benoitf commented Apr 18, 2019

I tried this PR + backporting on this branch ed40d90

But I got

peError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.join (path.js:1152:7)
    at Config.diagramsRoot (/private/var/folders/tg/_5rxbhmj4xncz4szvpgswrmc0000gn/T/vscode-unpacked/jebbs.plantuml-2.10.9.vsix/extension/out/src/plantuml/config.js:67:27)

FYI source code is

diagramsRoot(uri) {
        let folder = uri ? vscode.workspace.getWorkspaceFolder(uri) : undefined;
        if (!folder)
                 return undefined;
LINE67       --> let fsPath = path.join(folder.uri.fsPath, this.read("diagramsRoot", uri));
                 return vscode.Uri.file(fsPath);
    }

and read method is there
https://github.com/qjebbs/vscode-plantuml/blob/master/src/plantuml/configReader.ts#L48-L73

@akosyakov
Copy link
Member Author

akosyakov commented Apr 18, 2019

@benoitf it is WIP, but thanks for the pointer will test it as well

@akosyakov akosyakov force-pushed the ak/laung_preferences branch 23 times, most recently from 60ec59d to cf9c784 Compare April 23, 2019 12:46
@akosyakov
Copy link
Member Author

akosyakov commented Apr 23, 2019

@elaihau It is not finished, but could you test support of preferences in multi-root workspace context with this PR to catch regressions earlier?

@akosyakov akosyakov force-pushed the ak/laung_preferences branch from 0dd5cd7 to fc65a6e Compare April 26, 2019 14:20
@akosyakov
Copy link
Member Author

akosyakov commented Apr 26, 2019

@elaihau thx for the review, found another bug:
Screen Shot 2019-04-26 at 16 28 23

duplicate add and remove actions, it is easy to fix

Fixed https://github.com/theia-ide/theia/pull/4947/files#diff-f9afc1d61ee7ba79952f1f81bdf6bd52

@akosyakov
Copy link
Member Author

@elaihau What is the content of testdir i cannot reproduce #4947 (comment)

@akosyakov akosyakov force-pushed the ak/laung_preferences branch from fc65a6e to bc14ca1 Compare April 26, 2019 14:47
@elaihau
Copy link
Contributor

elaihau commented Apr 26, 2019

@elaihau What is the content of testdir i cannot reproduce #4947 (comment)

it has nothing special. the problem can be reproduced with "theia" folder too

Peek 2019-04-26 10-48

@elaihau
Copy link
Contributor

elaihau commented Apr 26, 2019

btw, i also found this one #5020, but i don't think it is related to this PR

@akosyakov
Copy link
Member Author

ok, checking #4947 (comment) then, it should work, it would be a bug if there are no events then a preference provider for settings.json is removed

@akosyakov
Copy link
Member Author

akosyakov commented Apr 26, 2019

@elaihau i don't think it is caused by this PR, events are reported for removed config files, but since these config files don't contain editor.fontSize (it is defined only in workspace settings) then there is no an event for it as well. We could force fire events whenever workspace roots are changed, but maybe it is overkill to cover this corner case?

We actually don't have many tests for events. It would be something worth looking into and align with VS Code expectations as well, but separately.

@elaihau
Copy link
Contributor

elaihau commented Apr 26, 2019

i am ok with issue mentioned in #4947 (comment) not fixed, as it is really a corner case.

@ariel-bentu
Copy link

@ariel-bentu please check whether your launch configuration tests are passing with this PR, they do for me

Hi,
I tested it and it works. the only thing is that VSCode allows comments in the launch.json, and when I used comments and used the api to create a new launch configuration - the configuration saved successfully but the comment was gone.

@akosyakov
Copy link
Member Author

@ariel-bentu thanks, i will have a look whether it is possible to preserve comments, btw does VS Code do it?

@ariel-bentu
Copy link

@ariel-bentu thanks, i will have a look whether it is possible to preserve comments, btw does VS Code do it?

I checked and actually, to my surprise, VSCode also looses the comments ... So I guess all is good.

akurinnoy and others added 6 commits May 2, 2019 05:41
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
This allows to re-validate such properties when a corresponding
schema has been set.

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
…schema

`UserLaunchProvider`, `WorkspaceLaunchProvider` and `FoldersLaunchProvider`
handle changing of 'launch' section of preferences without paying
attention whether configuration is valid or not. Once it happens a new
preference schema for launch configurations builds.

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants