AL icon indicating copy to clipboard operation
AL copied to clipboard

Noisy warnings when detecting .txt files translation format match

Open SteveKrisjanovsD365 opened this issue 7 years ago • 4 comments

Going forward I'd like to keep any import .txt and .fob files in my AL project (e.g. exported legacy files with the old syntax, new syntax, .fob files, etc). But the AL compiler presents me with warnings on every .txt file it finds e.g.

'<path to .txt file>' does not match any definition.

Why is this build warning even present? It's a .txt file and unless I'm mistaken, the compiler should completely ignore them and focus on the relevant file types only @ build (e.g. .json, .al, .xlf, .rdlc, .docx).

I didn't find any properties in launch.json nor app.json to allow me to tell VS code to ignore certain file types.

My present workaround is to rename those .txt files to use the extension ".txt.ignore"

SteveKrisjanovsD365 avatar Nov 15 '18 15:11 SteveKrisjanovsD365

The .txt files are used for translations so the compiler needs to detect which ones match the translation file format. We will consider how to reduce the noise in cases like yours but in general I wouldn't recommend keeping non-AL related artifacts in the same folder as AL sources/resources. Why not store them one folder level higher?

StanislawStempin avatar Nov 17 '18 11:11 StanislawStempin

Good idea I'll consider it

SteveKrisjanovsD365 avatar Nov 17 '18 11:11 SteveKrisjanovsD365

@StanislawStempin just curious, why does VS code even look for translations in .txt files? Shouldn't it ignore those files and instead focus solely on validating .xlf files?

If I view/edit a .txt file I usually have the expectation that the payload isn't XML.

SteveKrisjanovsD365 avatar Nov 19 '18 20:11 SteveKrisjanovsD365

@SteveKrisjanovsD365 the TXT files are used for translating the C/AL base application. In Fall 2019, we will switch to using .xlf files for translating it, but the validation will stay. Have you found a satisfying workaround for this issue?

atoader avatar Aug 07 '19 06:08 atoader