Problem solved. I added a function in the plugin to install the files and make the json setting.
With the absolute path ?
Its up to you. Changing the json manually is not a big deal, but powershell 5.1 should be installed by default in any recent windows machine, I think, so nothing is required to execute it as a standalone script.
I also tried ${userHome} with several options but could not succeed here.
Another important configuration consideration is that the .vscode folder must reside in the Trevliga Spel (defined as a root folder, ie. just below the VS Code workspace level), and not the JS folder, as VS Code doesn’t scan subfolders for .vscode directories, only the roots.
Let us know if you need testing for the install procedure.
I have worked with the files you sent me to find the best possible solution.
I have added a section in the Global Settings that lets you install the files to the JS folder with a single click. The installed files are self-sufficient and include everything needed to make it work, including the TypeScript package, since I realized it was missing from my VS Code installation on Mac. My goal has been to provide a solution where users need to do nothing more than click that button, and on my two systems (Windows and Mac), it works that way now.
The VS Code settings file is no longer modified. The reference declaration in each script file is no longer needed, so I removed the template file from the solution. IntelliSense and snippets work. Hover information from d.ts appears for all functions, properties, and objects.
I truly couldn’t have done this without your help and the files you sent over. I’m very grateful. Thank you so much!
Elgato has an issue with the plugin administration site, so I am unable to obtain a DRM version of the plugin for the beta thread. As soon as they solve their problem, I will publish an updated beta version.
You’re welcome.
I’ll give a try to the next beta.
Elgato has FINALLY fixed the issue with the admin site. I have published a beta update with the new feature for the JavaScript folder.
When testing this, I’d appreciate it if you could start from “nothing” as much as possible. I mean, no JS folder (or an empty folder) and no specific settings in VS Code settings.
Press the VS Code config button in the Global Settings Script Functions tab.
Open VS Code, open the folder, open the README.js file, and follow the instructions.
Does everything work? Snippets, IntelliSense, and hover info? Are the instructions good?
Hello,
I gave a try and the code completion works but the hover do not work.
First i did not see the popup in the lower-right corner:
"This workspace contains a TypeScript version. "
Instead, I have restarted the terminal server with no effect.
I tried to add /// with ts in the JS directory but with no effect.
I tried to add /// with ts in the JS/.vscode directory but with no effect.
I must admit this VS code configuration is a nightmare to me , but what i have found for sure is that :
- For the hover to work the absolute path of the .vscode folder must be set in %appdata%/Code/User/settings.json, ex.
"js/ts.tsserver.pluginPaths": ["C:/Users/<user>/Documents/Trevliga Spel/JS/.vscode"] - For the “local” JS/.vscode settings.json to work, the JS Folder should be added directly at the root of you workspace. Having for instance Trevliga Spel below the workspace root and .vscode within the JS Folder does not work.
I have none of that, and it works perfectly on my system. Something else in your system must affect the functionality; we only need to find out what… ![]()
You do open the JS folder as the workspace root in VS Code, right?
yes, otherwise settings.json has no effect.
But once i’ve added it I can work in another branch where Trevliga Spel is the root and it works.
You contradict yourself. You claim that you open JS, otherwise, JS/settings.json has no effect. Then you claim that once JS/settings.json is changed, you can open another folder and it works. It doesn’t make sense. Why would a change in JS/settings.json have an effect when you open another folder if it only has an effect when you open the JS folder?
My guess is that you have conflicting settings in the global VS Code settings.json. Otherwise, it wouldn’t work when another folder is set as the root.
Please verify that the VS Code global settings.json pluginPaths does not reference anything in the JS folder. Verify that the settings.json in JS uses a relative reference. Restart VS Code. Open the JS folder as root. Does it work? You should see a pop-up asking whether to use the local TypeScript.
Sorry if I was not clear. What I said is :
So I have this in VsCode :
![]()
OK. Since you do not configure and use the solution as it is prepared, it doesn’t work.
You can, of course, configure this whole thing exactly as you like, but I need to verify that it works on 67.000+ computers for users who may not be that familiar with VS Code.
That is why I created a solution where the user needs to click a single button in the plugin and then answer a single question in VS Code. The requirement for this to work is that VS Code is not configured for other structures or paths, that the JS folder is opened as the root workspace and that all scripts are created in the JS folder.
That’s a bit harsh, I’m sorry.
I tried to use the solution as it is prepared, and followed all instructions but just reported it does not work here. As already reported :
- the hover does not work
- i did not see the popup in the lower-right corner
And I’ve lost of couple of hours trying to investigate further.
Let me know what I should do to have something working and I’ll do it.
Sorry, I didn’t mean to be harsh or rude. It’s clear that the way this solution is packaged isn’t compatible with your system and the way you work. The things you report simply are not possible if my solution were the only thing affecting how VS Code works.
It works as expected on all systems I can test it on. Maybe we should discontinue these tests and hope it works for new users. I don’t want this to be a showstopper for the plugin release.
No offense of course.
Not really.
I made some additional investigation and did not find why the popup does not appear here.
But …
If that popup does not appear (e.g. it was dismissed before, or VS Code already
made a choice for this workspace), hover for custom globals (midi, ui, gvar, …)
and callbacks (OnTimerElapsed, OnKeyPressed, …) may not work. There are two
ways to fix this:
-
Set the global plugin path (no popup needed)
In your VS Code USER settings (%APPDATA%\Code\User\settings.json), add:“js/ts.tsserver.pluginPaths”: [“C:/Users/
YourUserName/Documents/Trevliga Spel/JS”]This points VS Code’s bundled TypeScript server at this folder so it can find
the streamdeck-midi-ts-plugin in node_modules, without switching to the
workspace’s own TypeScript version. -
Or manually select the workspace TypeScript version
Open the Command Palette (Ctrl+Shift+P) and run:
“TypeScript: Select TypeScript Version…” → “Use Workspace Version”.
That option can also be accessed by clicking the {} before Javascript at the botton right corner.
Either option on its own is enough to make hover work.
You may want to add these workarounds in the readme.js file
Yes, I have considered adding a manual way to set the TypeScript version to the text. I will also make a video that shows the complete process and discusses things like this.
