Visual Studio Code lensing for Javascript/ AJAX - visual-studio

I am using Visual Studio 2019 Professional and have code lensing enabled. Therefore, I get an indication when the function/ method is called from another .NET/ C# class in my project.
Now, I have some JavaScript file in which there are AJAX calls which call REST API endpoints. My question is that is there any way or is there a VS plugin that allows for code lensing on AJAX calls? In other words I would like to know which methods/ functions are being called from AJAX or client-side?
Thanks for your help.

Related

does visual studio have anything that shows snippets of code for the Windows API(like I think VB6 might have)?

does visual studio have anything that shows snippets of code for the Windows API(like I think VB6 might have)?
For example you'd select an API function and it showed a code snippet.. i recall something like that from the VB6 days. It made it easier to test out any API function because it showed some example code to declare it and possibly even to use it.
I don't know if VB6 had, but there was a program called ApiViewer that did that
And there is currently a comparable program
https://www.codeproject.com/Articles/92967/VB-9-0-C-3-0-API-Viewer
that uses a website called pinvoke.net
And there is an addin to visual studio from the team that did the pinvoke.net website
http://pinvoke.net/

How to attach the DNX process when using Postman or Fiddler?

I use Visual Studio 2015, a Web API project and DNX as the hosting environment. To test the APIs, I use postman. I often use Fiddler also.
Here is how I debug. I look for the DNX process in the Visual Studio 2015, attach to that process, and then run the API in the post man. It is working fine. But it is tedious when I have to do this repeatedly for many APIs.
Is there a quick way where by when I run the API in the Postman, the process is automatically attached to the Visual Studio and breaks at the break point in the code?

Querying Language service in Visual Studio Editor Extension to get Assembly, class and method info

I want to write an Editor extension for Visual Studio 2010.
In my extension I want to get information about the Class, method which is at the current caret position.
For example, if I am in an Event Handler and I have some code that shows a MessageBox using MessageBox.show(…) and the caret is at .Show,
I want to query VS Services to get a response which tell me that I the caret is at Show method of MessageBox class which is in System.Windows.Froms.dll version 4.0.40319 etc.
Is it possible?
There is no way to do this with the current APIs in Visual Studio 2010. This is why we're building the Roslyn APIs so you could. When you install the CTP, we setup a Roslyn instance that replaces the standard language services with the Roslyn ones, and you can ask your question directly to it.
If you don't want to be dependent upon running in the Roslyn instance (which I assume is the case), then it gets a bit trickier. You can invoke the parsers to understand you're on a call named MessageBox.Show, but to get the semantics you'd have build up a Compilation making sure you get all the project references and source files right. That's a far trickier proposition, so depending on your scenario you might want to "cheat" as much as possible.
Disclosure: I'm on the Roslyn team.

How to modify JavaScript Intellisense by using Visual Studio Integration Package?

I need to modify some logic of Javascript Intellisense on Visual Studio 2008 SP1 like some build-in function such as ScriptEngine, ScriptEngineBuildVersion and etc. Moreover, I need to dynamically generate function depend on opened docuement.
In Visual Studio, language services are provided via VSPackages. Most built-in language services in Visual Studio 2008 do not really offer any kind of extensibility or customization that would enable what you're trying to achieve.
There are a couple of options you could consider though:
Write your own Javascript language service. Obviously, this would be non-trivial, but it would allow you to get the precise behavior you're after. Language services are responsible for parsing the file to provide colorization, quick info, Intellisense, auto-completion, and other features to the core text editor. The simplest example of a language service is a sample in the Visual Studio 2008 SDK 1.1 called the RegExLangService. There is also a detailed walkthrough for the sample.
You could attempt implementing either an Add-in or a VSPackage which would insert/manipulate text in the editor based on the contents of the open document. Your question doesn't really say exactly what kind of behavior you need (other than dynamically generating a function). This would certainly be possible with the Visual Studio SDK and much less work than writing your own Javascript language service.
Good Luck!

Alternative to VSTS 2008 WEb tests to test JavaScript & Ajax

I've read repeatedly how VSTS 2008 Web testing can only test the post and post back between web pages and thus cannot test calling Java Script or Ajax. Is there an alternative so that I can test if my dynamically filled controls (javascript) and dynamically populated drop down list (AJAX) can are functioning correctly?
You can try the coded ui test in visual studio 2010?

Resources