kedro-org / vscode-kedro

Kedro extension for VSCode including LSP and other features
https://marketplace.visualstudio.com/items?itemName=kedro.Kedro
Apache License 2.0
11 stars 2 forks source link

Introduce Status bar #34

Closed noklam closed 1 day ago

noklam commented 1 week ago

Status bar: image

See the gif below:

  1. By default it will show base (it respects the settings.json as well, not shown in GIF)
  2. When click, user can select the environment select-environment

Testing

Use the built version to test which requires the develop setup or the uploaded version

  1. Download it and right click in VSCode (Install Extension VSIX)
noklam commented 1 week ago

Having issue to extract the default settings (base), the icon: {env} only show up after 1. Execute the command 2. Clicking the status bar and choose env

noklam commented 2 days ago

I think after this I want to release 0.1.0 and use 0.1.0 for the recording. @astrojuanlu

astrojuanlu commented 2 days ago

How can we test this locally @noklam ? 😃

Most importantly, what's the effect of changing the environment this way? Will my subsequent kedro run commands have an implicit --env <env>?

astrojuanlu commented 2 days ago

Will try to follow https://github.com/kedro-org/vscode-kedro/pull/31#issuecomment-2190925564

noklam commented 2 days ago

@astrojuanlu I uploaded a build version (see the description), which you can right-click to install and test it.

It won't affect subsequent Kedro run, as these are done in the extension side in a separate process. This is 1 of the 3 ways to change configuration resolution (i.e. Go to definition, hover etc).

astrojuanlu commented 1 day ago

Gave it a quick run, some ideas:

noklam commented 1 day ago
  • Is there a notion of developer versions for VS Code extensions? 5 minutes from now I won't remember if I have the true 0.0.3 or the wip 0.0.3 😬 something like 0.0.3+3b9579f25 (or whatever scheme is supported) would be nice

Let me check, we don't have an automated flow for build/publish yet otherwise it will be handy to have something like a nightly build.

Yes, navigation, hover, auto-completion that requires loading Kedro class will be affected.

True. There are some feature inconsistency, so we need to know which feature we are talking about. For example:

For this discussion, we focus on Go to definition.

  1. The 0.0.1 version always assume things coming from conf/base
  2. 0.1.0. We added a lot more, it respect settings.py, and now provide multiple options to change the "env". However, it still only have a single environment.
  3. (Not implemented) - Ultimately it should be able to resolve config at file level. That is for params:abc, we can point to exactly which file it's coming from i.e. nok/project/conf/local:11-22.

To your question, default_run_env is ignored currently. We could have an intermediate workaround (through it is unlikely part of the solution of 3.)

noklam commented 1 day ago

To your question, default_run_env is ignored currently. We could have an intermediate workaround (through it is unlikely part of the solution of 3.)

In fact this should be an easy fix, for now we can make LSP always start searching from default_run_env (default: local), if there is nothing found then proceed to base_env (default: base)`. I will take a stab tomorrow.

noklam commented 1 day ago

^ In fact the notion of kedro run --env is always changing the "base_env". You cannot change the default_run_env with runtime parameters, the only way to do this is to update settings.py, which is uncommon (most Kedro have the default as local).

astrojuanlu commented 1 day ago

Interesting, thanks a lot for the explanation. Could we change the env selection dialog then, so it says "base environment"? So it's more similar to what kedro run --env does.

noklam commented 1 day ago
noklam commented 1 day ago

image