I am using Visual Studio 2015, and I want to add https://appsforoffice.microsoft.com/lib/1/hosted/office.js as an IntelliSense reference. So I did the following:
But the IntelliSense still does not work:
Could anyone help?
Getting the basics of JavaScript IntelliSense working is pretty straightforward – all you need to do is, in your JavaScript file, have a triple slash reference to the CDN location, as follows:
/// <reference path="
https://appsforoffice.microsoft.com/lib/1/hosted/office.js" />
In projects created with the Office Add ins template, the reference is already built in, in the Scripts/_reference.js file. The Scripts/_references.js file is a special file that acts as a "global" JS reference for the project, so that you don't need to include the /// <reference path="..." /> on every file. For more information on the _references.js file, see this excellent blog post by Mads Kristensen, creator of the “Visual Studio Web Essentials” extension: http://madskristensen.net/post/the-story-behind-_referencesjs.
Note that the above location is for the “prod” version of the CDN. For the beta endpoint, use "https://appsforoffice.microsoft.com/lib/beta/hosted/office.js", and for a local installation of Office.js point to the Office.js file (typically under "Scripts/Office/1/office.js).
TIP: Every once in a while, I've come across cases when the IntelliSense file appears stale. For example, while I know for a fact that the Excel Range object contains a “.merge()” method, IntelliSense was refusing to show it to me one day.
In these cases, you can refresh the JavaScript references by via the menu, by going to Edit -> IntelliSense -> Refresh Remote References, or via the VS Quick Launch box.
Related
I am working on a Visual Studio Extension. I am trying to get the ID of a code review request after it has been created/saved. I have added my own ITeamExplorerSection to the RequestCodeReview page. It makes sense to me that In my implementation of the SaveContext method of my section that I should be able to call the GetExtensibilityService on the page and retrieve the "CodeReviewId". I have several issues with this, the most important of which are: What object type am I trying to retrieve? and second is it available in the SaveContext Method. (or is this even the right approach)
I am converting the login views of an application from vbhtml to cshtml. In the vbhtml files the original developer calls an Html.LabelWithAttributesFor extension method. When I write the same line of code in the new cshtml file the extension method isn't available via Intellisense and fails to compile. Are references not shared between vbhtml and cshtml files in a project?
Wanted to circle back and close this question with the "answer". In the end, what seems to have knocked something loose was when we removed the vbhtml pages from the solution. All use of the Extensions had been removed prior to our removing the vbhtml pages and other developers had worked on the solution in the interim making other changes. Fast forward a few months to another developer needing the extensions. He added a reference to the project with the extension methods and used them on a new cshtml page, which worked fine. So, the problem is solved but I still have no idea what caused the problem in the first place and I have been unable to reproduce it.
Im not very used to the whole Sharepoint-thing, but usually I just simply deploy my visual studio stuffs as a wsp-package and then deploys it using PS (if I dont remember incorrect)..
Now this time I wanted to update the masterpage of my site, and add a few javascript files and update an existing javascript file.. and this time for some reason the deploy did update the allready existing javascript-file, but it didnt add the new javascriptfiles..and it didnt update the masterpage for some reason.. and I have dubble-checked that the package Im depolying contains the new files and the updated masterpage, I also checked the Elements.xml-file for the javascript files and they are there.. Any ideas?
Check if you files are customized from definition (in SharePoint Designer they will have an (i) symbol. If so - revert them to definition and try to deactivate the feature again.
If I am editing a .js file in Sublime Text 2 that makes use of a library defined in a separate .js file, is there a way to support tab completion of objects/functions defined in the external library file?
Something analogous to the following from Visual Studio:
/// <reference path="/js/some-library.min.js" />
which enables IntelliSense over the library/plugin code.
I haven't tried it myself yet, but there's SublimeCodeIntel: https://github.com/Kronuz/SublimeCodeIntel#readme
The OP in this thread: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5319 seems to be complaining that it's pulling suggestions from outside the current file, which may mean it's doing what you want.
I was looking for the exact same thing, and I can confirm that SublimeCodeIntel works well. However, Sublime Text seems slightly less responsive when using SublimeCodeIntel, which is a drawback.
Another cool thing coming from a Visual Studio environment is the support for "Go to definition" in this plugin.
Another option is TernJS:
http://emmet.io/blog/sublime-tern/
I haven't yet used it, but it looks promising. Editor slowdown seems to be an issue with any code completion plugin; sounds like authors are still working out kinks in scraping and caching related files for code completion. The TernJS page addresses this issue and offers some config options for managing how it handles related files.
I have written a couple of t4 templates for EF4, I want to get other developers to use them, so id like to make them installable in VS so that people cna jsut add them to their projects.
I have no idea how to do this. Any idea about where i should start reading? Idid a quick google and had no luck.
Thanks.
An alternative is to create a VS item template.
There is an export template wizard accessed vie the File/ExportTemplate menu.
After you've exported a T4 template, you'll probably want to manually edit the resultign item, as it doesn't handle the generated file well by default.
You'll have your template from the wizard as a zip file.
Unzip this and remove the generated file.
Then edit the Foo.vstemplate file and remove the line referencing the generated file.
Finally zip the files up again.
Your colleagues can just drop this zip file into their user templates directory:
C:\Users\\Documents\Visual Studio 2010\Templates\ItemTemplates
For external sharing, your best bet is probably to create a nuget package.
Have a look at this link:
http://haacked.com/archive/2011/01/12/uploading-packages-to-the-nuget-gallery.aspx