For no apparent reason, on Monday, my VS2017 starting getting the error highlighted in this SO post, and all JS Intellisense and auto-formatting vanished.
Managed to fix it by turning off Enable the new JavaScript language service
but now the auto-formatting is ignoring my settings; in-house style is brace on newline after functions, which is set, but a Ctrl-E-D reformat now moves all braces to the same line as the function definition.
How do I fix this?
EDIT: I have found this old thread with an identical issue but sadly no fix for the new Language Service: https://developercommunity.visualstudio.com/content/problem/138728/if-statements-still-place-a-opening-brace-on-the-s.html
The irritating thing is that is has been working for months and months, and only stopped yesterday, with no settings changes.
EDIT to add the Intellisense error:
The JavaScript and TypeScript language service has been disabled due to an error. You may see reduced IntelliSense support for your project. Please try reloading your solution to reenable the language service.
Error processing request. Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at createSourceFile (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:16674:110)
at Object.parseJsonText (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:16508:26)
at Object.parseJsonText (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:16330:23)
at ProjectService.loadConfiguredProject (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:120258:33)
at ProjectService.createAndLoadConfiguredProject (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:120247:22)
at ProjectService.createLoadAndUpdateConfiguredProject (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:120251:36)
at ProjectService.openClientFileWithNormalizedPath (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:120776:44)
at ProjectService.applyChangesInOpenFiles (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:120882:30)
at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:121548:46)
at C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:123063:88
at IOSession.Session.executeWithRequestId (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:123054:28)
at IOSession.Session.executeCommand (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:123063:33)
at IOSession.Session.onMessage (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:123083:35)
at Interface.<anonymous> (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.1\tsserver.js:124346:27)
at Interface.emit (events.js:182:13)
at Interface._onLine (readline.js:290:10)
at Interface._normalWrite (readline.js:433:12)
at Socket.ondata (readline.js:149:10)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onread (net.js:638:20)