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

Can't change remoteHost once set #588

Open
spoyser opened this issue Sep 19, 2024 · 10 comments
Open

Can't change remoteHost once set #588

spoyser opened this issue Sep 19, 2024 · 10 comments

Comments

@spoyser
Copy link

spoyser commented Sep 19, 2024

It would seem that once the IP of the Roku device to which you want to send remote keypresses to is set, it is then impossible to update it.
This is due to the value being stored as a memento (remoteHost) in the workspace database (stored in state.vscdb), and once set the function
getRemoteHost will always use that value regardless of the settings parameter (e.g. "brightscript.remoteControl.host":"11.23.56.90")

Using SQLite browser it is possible to update the value, and this new value is then used by the extension.

e.g.
{"rokuAutomationAutorunOnDeploy":true,"rokuAutomationConfigs":"{\"configs\":[{\"name\":\"DEFAULT\",\"s0teps\":[]}]}","remoteHost":"11.23.56.90","rokuAppOverlays":[]}

Perhaps a solution would be to always use the value from the VSCode settings, and if the value is ${promptForHost} show the input and then overwrite the setting with whatever the user entered?

@TwitchBronBron
Copy link
Member

We definitely need some improvements in this area. Our ultimate goal is to implement a proper "Default/Active Device" feature (outlined in #506).

But to your specific point right now, I believe that value will change if you sideload to a different device. If I remember correctly, it will always overwrite the value with whatever device was most recently sideloaded to.

@spoyser
Copy link
Author

spoyser commented Sep 20, 2024

That feature sounds great.

In my use case I'm not sideloading so the value is never overwritten, but I see your point :)

@TwitchBronBron
Copy link
Member

Until we get the time to properly implement #506, would you be interested in submitting a PR that adds a menu option to the device list that would switch that internal value. Something like this, with maybe a title like "Set as active device":

image

I think you'd need to add a new entry in that devices list here:


And then add the command in https://github.com/rokucommunity/vscode-brightscript-language/blob/master/src/BrightScriptCommands.ts that would set the value like we do here

@spoyser
Copy link
Author

spoyser commented Sep 22, 2024

I'll take a look and see what I can do.

@spoyser
Copy link
Author

spoyser commented Sep 22, 2024

Trying to setup a build environment using

mkdir RokuCommunity && cd RokuCommunity && git clone https://github.com/rokucommunity/vscode-brightscript-language && cd vscode-brightscript-language && npm run install-local

And getting a 404 :(

npm error code E404
npm error 404 Not Found - GET https://artifactory.tools.roku.com/artifactory/api/npm/roku/roku-test-automation/-/roku-test-automation-2.0.10.tgz
npm error 404
npm error 404  'roku-test-automation@https://artifactory.tools.roku.com/artifactory/api/npm/roku/roku-test-automation/-/roku-test-automation-2.0.10.tgz' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.

Right, I followed the manual approach and got everything installed (as a FYI there is a type in the manual instructions, "roku-deploy": "file:../roku-debug", should obviously be "roku-deploy": "file:../roku-deploy",)

I've updated code, build seems to complete successfully, but then what, I was kind of expecting a .vsix file to be created.

@TwitchBronBron
Copy link
Member

Next:

  • open the vscode-brightscript-language folder in vscode
  • in the debug panel, choose the "Extension" debug configuration from the drop-down
  • press F5 to start debugging
  • vscode will open a NEW vscode window with the [extension host] name in the title. This vscode window has a live version of the current local complied copy of the vscode extension.

@spoyser
Copy link
Author

spoyser commented Sep 22, 2024

Okay, getting further :)

In the second VSCode running the BRS extension is showing but after a while it gives the following error:
Activating extension 'RokuCommunity.brightscript' failed: vscode.workspace.workspaceFolders is not iterable.

Any ideas?

@TwitchBronBron
Copy link
Member

Does it give you a stack trace? You can find that in the debug panel of the non [extension host] window. Does it happen with the code directly from master or was this an issue introduced by your new code?

@spoyser
Copy link
Author

spoyser commented Sep 22, 2024

I thought much the same so I did revert the code, but behaves the same

Debug Console

vscode-custom-css is active!
Application directory c:\Users\spoyser\AppData\Local\Programs\Microsoft VS Code\resources\app\out
Main HTML file c:\Users\spoyser\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\electron-sandbox\workbench\workbench.html
Git installation not found.

Call Stack
image

@TwitchBronBron
Copy link
Member

I'm not really sure what's going on then. Let's try starting over. The install-local command is a bit overkill for this specific task because you don't need to work on any of the other projects (roku-deploy, roku-debug, etc) since this feature is exclusively located in vscode-brightscript-language. So, let's try this:

  • git clone https://github.com/rokucommunity/vscode-brightscript-language
  • cd vscode-brightscript-language
  • npm install

Then open the folder with vscode, and in the menu at the top click "Run" -> "Start Debugging" start debugging. It'll run a few build tasks automatically, then it will launch the [Extension Host].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants