diff --git a/test/resources/projects/advpl/.vscode/settings.json b/test/resources/projects/advpl/.vscode/settings.json index b9f195fe..46c40c97 100644 --- a/test/resources/projects/advpl/.vscode/settings.json +++ b/test/resources/projects/advpl/.vscode/settings.json @@ -1,6 +1,6 @@ { "totvsLanguageServer.welcomePage": false, - "totvsLanguageServer.editor.linter.includes": "W:\\ws_tds_vscode\\tds-vscode\\test\\resources\\projects\\includes;W:\\ws_tds_vscode\\tds-vscode\\test\\resources\\projects\\includes_tlpp", + "totvsLanguageServer.editor.linter.includes": "M:\\protheus\\includes;M:\\protheus\\includes_tlpp", "totvsLanguageServer.editor.show.notification": "all", "totvsLanguageServer.trace.debug": "messages", "totvsLanguageServer.trace.server": "messages", @@ -23,16 +23,6 @@ } } }, - "xeditor.tokenColorCustomizations": { - "textMateRules": [ - { - "scope": "keyword.control", - "settings": { - "foreground": "#FF0000" - } - } - ], - }, "totvsLanguageServer.compilation.generatePpoFile": false, "totvsLanguageServer.workspaceServerConfig": true } \ No newline at end of file diff --git a/test/resources/projects/advpl/files/embeddedLanguages/css.css b/test/resources/projects/advpl/files/embeddedLanguages/css.css new file mode 100644 index 00000000..559310ff --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/css.css @@ -0,0 +1,13 @@ +body { + background-color: lightblue; +} + +h1 { + color: white; + text-align: center; +} + +p { + font-family: verdana; + font-size: 20px; +} \ No newline at end of file diff --git a/test/resources/projects/advpl/files/embeddedLanguages/css.prw b/test/resources/projects/advpl/files/embeddedLanguages/css.prw new file mode 100644 index 00000000..98906e17 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/css.prw @@ -0,0 +1,25 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function css() + local myVar := "Variavel preenchida manualmente via ADVPL" + local cCode + + BeginContent var cCode as CSS + body { + background-color: lightblue; + } + + h1 { + color: white; + text-align: center; + background-color: %Exp:myVar%; + } + + p { + font-family: verdana; + font-size: 20px; + } + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/html.html b/test/resources/projects/advpl/files/embeddedLanguages/html.html new file mode 100644 index 00000000..76091585 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/html.html @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/test/resources/projects/advpl/files/embeddedLanguages/html.prw b/test/resources/projects/advpl/files/embeddedLanguages/html.prw new file mode 100644 index 00000000..2f61accd --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/html.prw @@ -0,0 +1,16 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function html() + local myVar := "Variavel preenchida manualmente via ADVPL" + local cCode + + BeginContent var cCode as HTML + + + + + + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/js.js b/test/resources/projects/advpl/files/embeddedLanguages/js.js new file mode 100644 index 00000000..dc9a8452 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/js.js @@ -0,0 +1,11 @@ +with (document) { + var data = { + 'From_Expression: ': '%Exp:myVar%', + 'name': getElementById('ID_NAME').value, + 'email': getElementById('ID_EMAIL').value, + 'date': getElementById('ID_DATE').value, + } +} +var text = "form:SaveData('" + JSON.stringify(data) + "')"; +twebchannel.jsToAdvpl('receive_data', text, 'dummy'); + diff --git a/test/resources/projects/advpl/files/embeddedLanguages/js.prw b/test/resources/projects/advpl/files/embeddedLanguages/js.prw new file mode 100644 index 00000000..a4a4077e --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/js.prw @@ -0,0 +1,25 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function js() + local myVar := ; + "Variavel preenchida manualmente via ADVPL" + local cCode + + + beginContent var cCode as JS +function sendData(){ +with(document){ +var data = { +'From_Expression: ': %Exp:myVar%, +'name':getElementById('ID_NAME').value, +'email':getElementById('ID_EMAIL').value, +'date':getElementById('ID_DATE').value, +} +} +var text = "form:SaveData('" + JSON.stringify(data) + "')"; +twebchannel.jsToAdvpl('receive_data', text, 'dummy'); +} + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/json.json b/test/resources/projects/advpl/files/embeddedLanguages/json.json new file mode 100644 index 00000000..599e7659 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/json.json @@ -0,0 +1,10 @@ +{ + "titulo": "JSON x XML", + "resumo": "o duelo de dois modelos de representação de informações", + "ano": 2012, + "genero": [ + "aventura", + "ação", + "ficção" + ] +} \ No newline at end of file diff --git a/test/resources/projects/advpl/files/embeddedLanguages/json.prw b/test/resources/projects/advpl/files/embeddedLanguages/json.prw new file mode 100644 index 00000000..309baa27 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/json.prw @@ -0,0 +1,22 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function json() + local myVar := "Variavel preenchida manualmente via ADVPL" + local cCode + + BeginContent var cCode as JSON + { + "titulo": "JSON x XML", + "resumo": "o duelo de dois modelos de representação de informações", + "ano": 2012, + "genero": [ + "aventura", + "ação", + "ficção" + ], + "myVar": %Exp:myVar% + } + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/sql.prw b/test/resources/projects/advpl/files/embeddedLanguages/sql.prw new file mode 100644 index 00000000..e4baa2d6 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/sql.prw @@ -0,0 +1,34 @@ +#include "Protheus.ch" + +user Function sql() + Local aArea := GetArea() + Local cWhere := "%B1_TIPO = 'PI' AND B1_LOCPAD = '01'%" + Local nRegs := 0 + + //Construindo a consulta + BeginSql Alias "SQL_SB1" + //COLUMN CAMPO AS DATE //Deve se usar isso para transformar o campo em data + SELECT + B1_COD, + B1_DESC + FROM + %table:SB1% SB1 + WHERE + B1_FILIAL = %xFilial:SB1% + AND B1_MSBLQL != '1' + AND %Exp:cWhere% + AND SB1.%notDel% + EndSql + + //Enquanto houver registros + While ! SQL_SB1->(EoF()) + nRegs++ + + SQL_SB1->(DbSkip()) + EndDo + SQL_SB1->(DbCloseArea()) + + MsgInfo("Foram processados "+cValToChar(nRegs)+" produtos.", "Atenção") + + RestArea(aArea) +Return diff --git a/test/resources/projects/advpl/files/embeddedLanguages/sql.sql b/test/resources/projects/advpl/files/embeddedLanguages/sql.sql new file mode 100644 index 00000000..ad983cd6 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/sql.sql @@ -0,0 +1,10 @@ + SELECT + B1_COD, + B1_DESC + FROM + %table:SB1% SB1 + WHERE + B1_FILIAL = %xFilial:SB1% + AND B1_MSBLQL != '1' + AND %Exp:cWhere% + AND SB1.%notDel% diff --git a/test/resources/projects/advpl/files/embeddedLanguages/ts.prw b/test/resources/projects/advpl/files/embeddedLanguages/ts.prw new file mode 100644 index 00000000..b906ba7f --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/ts.prw @@ -0,0 +1,23 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function ts() + local myVar := ; + "Variavel preenchida manualmente via ADVPL" + local cCode + + + beginContent var cCode as TS +import { + DocumentFormattingEditProvider, + TextDocument, + FormattingOptions, + CancellationToken, + ProviderResult, + TextEdit, +} from "vscode"; + +const myVar: string = %Exp:myVar% + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/ts.ts b/test/resources/projects/advpl/files/embeddedLanguages/ts.ts new file mode 100644 index 00000000..780cef11 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/ts.ts @@ -0,0 +1,10 @@ +import { + DocumentFormattingEditProvider, + TextDocument, + FormattingOptions, + CancellationToken, + ProviderResult, + TextEdit, +} from "vscode"; + +const myVar: string = "%Exp:myVar%" diff --git a/test/resources/projects/advpl/files/embeddedLanguages/xml.prw b/test/resources/projects/advpl/files/embeddedLanguages/xml.prw new file mode 100644 index 00000000..70cd1c99 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/xml.prw @@ -0,0 +1,18 @@ +#include "Protheus.ch" +//#include "tds-vscode.ch" + +user Function xml() + local myVar := "Variavel preenchida manualmente via ADVPL" + local cCode + + BeginContent var cCode as XML + + Tove + Jani + Reminder + Don't forget me this weekend! + %Exp:myVar% + + endContent + +return myVar diff --git a/test/resources/projects/advpl/files/embeddedLanguages/xml.xml b/test/resources/projects/advpl/files/embeddedLanguages/xml.xml new file mode 100644 index 00000000..90f0a1b4 --- /dev/null +++ b/test/resources/projects/advpl/files/embeddedLanguages/xml.xml @@ -0,0 +1,6 @@ + + Tove + Jani + Reminder + Don't forget me this weekend! + \ No newline at end of file