Sublime Forum

Completion in Builkd 4126 are not suggesting important things

#1

Hi,
So, downloaded stable sublime text, and am following some tutorial on javascript.

In the tutorial there is sublime text editor, editing .js file, and when the person showing stuff typed “docu” they got immediately suggestion to “document (variable)”. Then after a dot, and “q”, they sa “querySelector”.

I don’t get these. If I’ll type the words document, or querySelector - I do, but not in plain, clean file.

I probably don’t have something enabled, or downloaded, but am kinda at loss when it comes to what should I get to get the full functionality.

Any help?

0 Likes

#2

The following packages might be what you want. LSP provides a general purpose Laguage Server Protocol Client and LSP-typescript installs the required language server package.

Note: nodejs is required for the server to run.

0 Likes

#3

This is great. So I did it, and got more completion. Added some more lsp-* things (lsp, lsp-bash, lsp-css, lsp-typescript), but now I have different problem.

I made very simple javascript:

window.onload = function () {
	var canvas = document.querySelector('canvas');
	canvas.width = window.innerWidth;
	canvas.height = window.innerHeight;

	var c = canvas.getContext('2d');
	c.fillStyle = 'rgba(255, 0, 0, 0.5)';
	c.fillRect(50, 25, 100, 200);
	c.fillStyle = "rgba(0, 255, 0, 0.5)";
	c.fillRect(100, 25, 100, 200) ;
	c.fillStyle = "rgba(0, 0, 255, 0.5)";
	c.fillRect(75, 100, 100, 200 ); 
};

and now I get window, at the bottom that complains, about “Untgerminated string literal” and ‘,’ or ‘;’ expected in various places. But the code works and doesn’t generate any warnings/errors ?!

What am I missing?

0 Likes