I want to include a global file path, specifically "C:\dev-tools\node_modules@types\jquery\index.d.ts" every time a JS file is being edited. Any way to do this?
I can see in this question/answer that a custom plugin can be coded to automatically insert snippets based on file type, can something similar be done but just include a path?
Is there a way in Sublime text 3 to auto add the format for language after selecting it from syntax?
Trying to get autocomplete for jQuery for files that are not part of a project.
Thanks in advance.
I have tried adding the file by reference like so:
/// <reference path="C:\dev-tools\node_modules\@types\jquery\index.d.ts" />
And this works (I have LSP and LSP-typescript installed) and autocomplete works flawlessly. I also have jquery types globally installed so adding this to the beginning of the file works too:
require(jQuery);
I am trying to achieve/expecting to achieve
...being able to get autocomplete without extra code in the beginning of the file which I'd have to remove later on.
You can include the path to jQuery as part of your
.sublime-projectfile. Just selectProject → Add Folder to Project…and selectC:\dev-tools\node_modules\@types\jquery, and it will be indexed for autocomplete along with all the other folders.