Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/ccs/commands/converterItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export async function convertCurrentItemCustom(): Promise<void> {

const payload: ConverterCustomRequestBody = {
item,
flgDisplayLinasNaoConv: 1,
tipoConversao,
flgPersistencia,
flgEliminarCSMV,
Expand Down Expand Up @@ -110,7 +111,7 @@ export async function convertCurrentItemOnSave(document: vscode.TextDocument): P
}

await waitForCompileBeforeAutoConvert(document);
await convertDocumentItem(document, "Falha ao converter item automaticamente ao salvar.", true);
await convertDocumentItem(document, "Falha ao converter item automaticamente ao salvar.", true, 0);
}

async function waitForCompileBeforeAutoConvert(document: vscode.TextDocument): Promise<void> {
Expand All @@ -124,12 +125,13 @@ async function waitForCompileBeforeAutoConvert(document: vscode.TextDocument): P
async function convertDocumentItem(
document: vscode.TextDocument,
errorMessage: string,
silentError = false
silentError = false,
flgDisplayLinasNaoConv: 0 | 1 = 1
): Promise<void> {
const item = getItemName(document);

try {
const responseText = await sharedClient.convertDefault(document, item);
const responseText = await sharedClient.convertDefault(document, item, flgDisplayLinasNaoConv);
renderConversionOutput(responseText);
} catch (error) {
if (silentError) {
Expand Down
6 changes: 5 additions & 1 deletion src/ccs/sourcecontrol/clients/converterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const ALLOWED_FLAGS = new Set(["agrupSetPiece", "objDynamic"]);

export interface ConverterRequestBody {
item: string;
flgDisplayLinasNaoConv: 0 | 1;
}

export interface ConverterCustomRequestBody extends ConverterRequestBody {
Expand All @@ -27,6 +28,7 @@ export interface ConverterCoreParams {
flgEliminarCSMV?: number;
strFlagsConv?: string;
strParamPersist?: string;
flgDisplayLinasNaoConv?: 0 | 1;
}

export class ConverterClient {
Expand All @@ -39,10 +41,11 @@ export class ConverterClient {
public async convertDefault(
document: vscode.TextDocument,
item: string,
flgDisplayLinasNaoConv: 0 | 1 = 1,
token?: vscode.CancellationToken
): Promise<string> {
this.validateItem(item);
return this.converterCore(document, item, {}, token);
return this.converterCore(document, item, { flgDisplayLinasNaoConv }, token);
}

public async convertCustom(
Expand Down Expand Up @@ -76,6 +79,7 @@ export class ConverterClient {

const body: ConverterRequestBody | ConverterCustomRequestBody = {
item,
flgDisplayLinasNaoConv: params.flgDisplayLinasNaoConv ?? 0,
...(this.hasCustomParams(params)
? {
tipoConversao: params.tipoConversao ?? 0,
Expand Down