none
VS 2015 no intellisense with SharePoint Add-In project

    Question

  • I verified javascript intellisense works with other project types (e.g., single page web app), but not for a SharePoint Add-In project. I did make sure ~/scripts/_references.js was in my intellisense references. Since I haven't memorized all the CSOM functions, I'm a pretty unproductive panda. To be clear, I get *no* javascript intellisense with a SharePoint Add-In project, where I do with my random sample of other project types.

    If it matters, I have all the updates to VS 2015 Enterprise (14.0.25431.01 Update 3), and Windows 10 pro. My project targets Office 365 SharePoint, I verified credentials, and when I do go through the painstaking process of writing javascript, I can publish and run the Add-Ins just fine.


    who will babysit the babysitters?

    Wednesday, October 26, 2016 4:48 AM

Answers

All replies

  • Hi Average ldiot,

    According to your description, I create a sample SharePoint Add-in project with my Visual Studio i2015 with Update 3. When I try use the JQuery content in the Default.aspx file, the intellisense works fine as below screenshot shows.

    Except reference the Javascript file in _references.js file, please make sure you have reference the Javascript file in current edited file.

    If you have referenced the Javascript file in the edited file, please provide the detailed steps from create the Add-in project and how using the Javascript in your Add-in project, which can help us reproduce this issue. If possible, please share a sample project here.

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 26, 2016 8:46 AM
    Moderator
  • Ah, thanks for asking the clarifying question! When I write javascript in Default.aspx, intellisense works great for jQuery, but not CSOM. (e.g., I type $. and get intellisense, but when I type SP. I do not). I do not get intellisense in app.js for either jQuery or CSOM (app.js is in the scripts folder). All my coding is going to be in .js files (in the scripts folder) and not directly in .aspx.

    I'm creating and using the project without modification. New->Project, Office/SharePoint, Web Add-ins, SharePoint Add-in. Authenticate against the SharePoint server, open app.js (in the scripts folder) and add code:

    I'm not changing anything else in the project. No intellisense.

    Thanks,

    John


    who will babysit the babysitters?

    Wednesday, October 26, 2016 12:44 PM
  • Hi John,

    According to your screenshot and my test, I find the SP.ClientContext object intellisense working fine in App.js. When you type "SP.", the ClientContext object is listed in the intellisense pop up list.

    But when I try use SP.AppContextSite object in App.js file, it is not listed in intellisense list. So there has part of object in SP.js is not intellisense in Visual Studio 2015.

    I help you submit this issue to Visual Studio Connect, please vote and add your comments for this feedback, I think the report team will treat this issue seriously.

    https://connect.microsoft.com/VisualStudio/feedback/details/3109248/intellisense-issue-with-sharepoint-add-in-project-when-using-sp-js-in-app-js-file

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 27, 2016 1:52 AM
    Moderator
  • Thanks for your input. For more clarification, could you please provide a screenshot showing intellisense under the same scenario?

    Create Office 365 SharePoint site.
    Run VS (elevated)
    New -> Project
    Office/SharePoint
    Web Add-ins
    SharePoint Add-in

    Authenticate against the Office 365 SharePoint site you just created
    Open Scripts/App.js
    Add the code I try above. (Referring to JS.)

    Cheers,
    John


    who will babysit the babysitters?


    Thursday, October 27, 2016 3:18 AM
  • SP.ClientContext shows up in intellisense because it's already been used in app.js. Try something that's not in app.js, like SP.ProxyWebRequestExecuteorFactory();

    To better make my point, if you type SP.Banana(); it'll subsequently show up in intellisense.

    Oh, and thanks for opening the bug. :-)

    Cheers,
    John


    who will babysit the babysitters?


    Thursday, October 27, 2016 4:48 PM
  • Hi John,

    Thanks for your response for this issue and share the new discovery here. I get the same result that if the object has been used in app.js, it will be intellisensed, otherwise, it won't be intellisensed.

    I have upload a default SharePoint project to Connect in attachments, please be patient waiting for the report team verify this issue.

    Since we have submit this issue to Visual Studio Connect, I need to close this thread later. Please mark the reply that contains the feedback link, we will follow this issue on Visual Studio Connect. It also could let other communities who has this issue to pay attention on this issue. Thanks.

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, October 28, 2016 5:53 AM
    Moderator
  • Sorry Weiwei, I'm not sure I follow exactly what you mean by 'close this thread' and 'mark the reply'.

    Cheers,
    John


    who will babysit the babysitters?

    Friday, October 28, 2016 6:10 AM
  • Hi Average ldiot,

    The operation of "Close this thread" is my process, I will close it after you mark the reply. The operation of "Mark the reply" means if one of the reply under your thread is helpful or help you resolve your problem, you could click the "Mark as answer" hyperlink under that reply to mark it.

    Thanks,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, October 28, 2016 6:21 AM
    Moderator