Closed marcoas closed 5 years ago
Autocompletion is shown only within certain code blocks configured by setting selectors
in SQLTools settings (ST: Settings
).
You can add additional selectors there as shown below (note the last two items in the list below):
// .......
"selectors": [
"source.sql",
"source.pgsql",
"source.plpgsql.postgres",
"source.plsql.oracle",
"source.tsql",
"source.php",
"embedding.php",
],
// .......
However, please note that completions are not shown inside the strings (this is hardcoded and not configurable) - that was made to aviod showing completion when those are not needed, but in case of PHP this is almost always the case that you have your SQL inside a string. I will try to fix this in next SQLTools release.
Actually, you don't need to alter your selectors
, only wait for a fix in the next release.
If would be of great help if you can provide a code snippet where you would expect the completion to work, but it doesn't work right now.
In my case, I would need it to work within this code, in every PHP file type
<?php
...
$sqlDatos = "SELECT dps_rg1creqleg.*,
dps_ma1creqleg.d_req_leg,
dps_ma1caplica.d_aplicacion AS d_aplicacion,
dps_ma1creqleg.dias_validez,
dps_ma1cplantas.d_planta
FROM dps_rg1creqleg JOIN dps_ma1creqleg USING( c_req_leg )
JOIN dps_ma1caplica USING( c_aplicacion )
JOIN dps_ma1cplantas USING( c_planta )
WHERE dps_rg1creqleg.fecha_prox_alerta = CURDATE() ";
...
Thanks for this code snippet, I will make the appropriate adjustments and try to make it work with your sample.
Could it also be possible to ask for the value of the variables included in the string?
In the following example, it would be that you ask for the value of $date
<?php
...
$sqlDatos = "SELECT dps_ma1creqleg.d_req_leg,
dps_ma1caplica.d_aplicacion AS d_aplicacion
FROM dps_rg1creqleg
WHERE dps_rg1creqleg.fecha_prox_alerta = '$date'";
...
Thank You ! When will the update be available from SublimeText?
Hi
In the documentation is this example configuration ...
But can I configure it to work in any project file (*.*) Or in the project's php files (*.php)?