How to redirect the data from "vscode.previewHtml" in VSCode extension - visual-studio-code

The obvious way is written in Working with the HTML preview, to use some link, so how to send data to the base running program without clicking links? I want to make some seamless extension between editor and previewer.

A few possible ways:
Open a local communications channel between your extension and the page. The extension could setup a simple server for example that the webview hits. This is best if you have lots of data to send or need to support more complex scenarios.
Inside the webview, you can instead post a message simulating a click with a command. Here's what VSCode's built-in markdown extension does for example:
window.parent.postMessage({
command: 'did-click-link',
data: `command:_markdown.revealLine?${encodeURIComponent(JSON.stringify(args))}`
}, 'file://');
The second approach is pretty hacky but it works well to just trigger events every so often.
We are also considering a better API for this. Please let us know if you have any thoughts or suggestions for this

Related

Roblox plugin: How do I redirect the plugin user to a certain website?

I am currently making a Roblox plugin and I have created a help button. However, I want to redirect users to a webpage (let's say, example.com). Through all of the API pages that I browsed through, I could not find anything. Is it possible to do so? And if so, how do I do it?
As of January 2023, this is not a supported use case for developers.
There are a number of adjacent features that are close but really don't work for what you're going for :
The plugin object has a function to OpenWikiPage() but this is only for internal documentation.
HttpService
is unable to launch any non-http protocols, so you cannot use it to
launch an external program either.
GuiService has a deprecated, internal function OpenBrowserWindow(), but only CoreScripts can use that.
There's now a BrowserService with the function OpenBrowserWindow(), but similar to GuiService, this is only for internal use.
The only workaround I could imagine would be to fetch the contents of the page and display it in a TextLabel, which supports Rich Text.

How can I add these code completion features my VSCode extension?

I'm in the process of creating a VSCode extension to do code completion for an existing Lua API.
I'm having a bit of trouble achieving the following (examples are JavaScript):
I've been looking for examples and tutorials but haven't come up with much. I assume I may need to do a fair amount of string processing, around the current cursor position, to get enough data to lookup the appropriate documentation (which I stored in an array of json objects). But presently I don't know how to get the meta-data dialog to show when entering parameters.
P.S. I have reviewed the official extension samples.
Your screenshots show two VS Code features:
The first screenshot shows a hover / quick info. It is used to display information about the current word the user is hovering over. To add a hover, your extension should implement and register a HoverProvider
The second screenshot shows parameter hints / signature help. It displays information to the user as they complete a function call. To add signature help, your extension should implement and register a SignatureHelpProvider
In both cases, how you implement the functionality is entirely up to your extension. Most language extensions maintain a structural representation of the file (such as an AST) and use this to provide hover and signature help info.
You can also either implement your extension as a direct VS Code extension or using the language server protocol (which works across editors). See VS Code's Language Extensions Overview for more information about developing a language extension and why you may want to consider the Language Server Protocol

Live reload/refresh for HTML/CSS & Javascript across 2 monitors?

Any help/advice on this would be greatly appreciated.
I'm looking for what I would consider a standard setup for modern day web design/development. Basically I have a dual monitor setup and I would like to code on one screen and have the changes displayed in real-time on the other screen.
Up until yesterday I was using jsbin in this way and it was working great. I had one browser setup with the coding stuff (HTML/CSS/jQuery) and I then had another separate browser open on the second monitor which updated instantly as I typed. So if I changed a CSS rule for example it was shown in real-time on the second monitor without me having to do ANYTHING. No saving, no refreshing, no switching tabs - NOTHING.
However, for whatever reason jsbin now refuses to update in real-time and it will only show the code changes if I manually refresh the browser. I've emailed jsbin about this but they can't diagnose the issue.
So what I'm looking for is either an online alternative, or a local alternative. However, everything (and I mean EVERYTHING) that I've tried so far can't do what jsbin did.
dabblet.com, jsFiddle.net, liveweave.com, codepen.io, cssdeck.com etc
But all of the above don't offer a second tab/browser that I can move to the second monitor to show the code updates in real-time which is the most important thing.
Surely there must be an easy solution to this? Is it not common to code in this way on 2 monitors whilst developing a website? I'd really appreciate any help on this.
Many thanks
Ben
For local option, Brackets has Live Preview mode.
After you open your project or file for editing, select File -> Live Preview
It launches a browser window, then your changes are reflected as you type, no save or browser refresh needed.
I use Liveweave with my dual monitor setup. I keep the HTML/CSS in my left window/monitor and the JS/Preview in my right monitor. Works great!

Auto form filling

I have a requirement like I need to fill an online form automatically. (Auto form filling).
Means I need to create an application in which clicking on the "Auto fill” button it will open the form in browser (form is another website page) and fill the data automatically.
The data (which may change each time) I will supply from my application. So first I thought of implementing the functionality using iMacro.
But later I realized I can’t call this imacro from an application if it is free version. So please suggest me some idea to achieve this functionality.
Thanks.
as far as i under stand your problem i would say try sikuli ..it just a simple you can say a compiler and a language which uses image recognition and you can make autobot through this and a very easy to learn ..

How can I program a button on an Access form to link to a browser window that looks up multiple addresses on Google Maps?

My problem is very similar to the one posted here:
http://www.utteraccess.com/forum/Plotting-Addresses-Maps-t1968130.html
except that thread never found any solutions. Basically, I'm working on an Access form that has a datasheet as a subform. Upon clicking a button on the main form I'm trying to make it so that a browser window opens up and, using the address columns from the spreadsheet data in the subform, plot all the address markers listed. I've looked up a lot of ways to attempt this but I've yet to find a way that seems to work.
I'm not even sure if it's possible to plot multiple markers on Google Maps, but according to research (and after trying it myself) it seems like it isn't, although I don't want to rule it out entirely because I'm still not 100% sure. However I know both Google Earth and batchgeo.com do allow this. I still want to try and do this on Google Maps, but if that doesn't work I want to try to do it using batchgeo.com and if that still doesn't work, then Google Earth (I don't want to make the user download external software if possible).
If it helps, from what I've read API's seem like a useful tool, though I'm not sure how to apply it to an Access form, it seems more like a way to embed to already existing websites.
I'd really appreciate if someone could help me figure out how to approach this problem!
Maybe this would help?
http://ramblings.mcpher.com/Home/excelquirks/getmaps/mapmarkers
It is Excel but should be translatable.
Here is another example, this time using Access:
http://www.utteraccess.com/forum/Google-Maps-Multiple-Mar-t1973499.html
...from what I've read API's seem like a useful tool, though I'm not
sure how to apply it to an Access form, it seems more like a way to
embed to already existing websites.
You're right. There's no way, that I'm aware of, to embed a Google Maps object in a form (like an ActiveX control). Microsoft MapPoint is a software product that lets you do Map integration by way of an ActiveX control (no need to use HTML and/or javascript).
What I usually do on a project like you're working on is I get my HTML page working the way I want it to, outside and independent of MS Access. You should be able to program and test the HTML file locally without having to use an actual web server. Just use something like NotePad++ or Sublime Text Editor 2 to write your HTML and Javascript and then open the file in your browser to see if it works. I'm quite sure you'll need to use Javascript in your HTML page to make this work. That's what the Google Maps API is all about.
After you have your webpage working, then you will have to go into Access and write code to create that web page on the fly with the address data for the current data set. You can just write it out to the Windows Temp folder and then open your browser control that that web page.
Julian Knight's answer links to more specifics on how to create the HTML page on the fly. It looks like gobble-de-gook, mostly because it is. Outputting HTML/Javascript/CSS from VBA is far less than optimal. This is why you troubleshoot it outside of Access, as much as you can.