Skip to content
loading...

re: Help needed with D3 and autocompletion. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Thanks @jamestthompson3 for the pointer! Setting the ominfunc to 'javascriptcomplete#CompleteJS' in my html filetype file did provide access to th...
 

Are you bundling your javascript before serving it, or is all the code in the main.js file? It seems that YCM is using tsserver for javascript completion which would explain why you need the import statement to get it to work. If you are bundling, then you don't need to import D3 in your HTML file, and YCM should give correct completion without having to comment and uncomment your import statement every time you edit / save the file.

 

Pretty new at this. No, not doing any bundling. I work on my main.js file which is referenced in my index.html.

I've been reading a bit on bundling though. I do have nodejs and npm installed on my machine now. Just reading on where to go from here. I see that I need to do a 'npm init' to get my package.json initialized...from there I am still reading.

If you’re not bundling, I would recommend using completion based on your path. For more info about setting the path in vim, I recommend this article.

code of conduct - report abuse