microsoft / microsoft/AL

XMLports: Typing (but not pasting) properties like TransactionType, TextEncoding produces spurious warning that "'schema' cannot be used in this context"

Open
#6,232 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

al-compiler-frontend bug
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

equivalent to #6225 but for XMLports instead of Reports.

Describe the bug
Typing TransactionType = [whatever]; creates a spurious error about schema not being valid/expected. The same goes for TextEncoding and possibly others. I didn't check more: this is simply a bug that needs to be fixed at the source, for all properties.

To Reproduce
Steps and to reproduce the behavior:

  1. Create an XMLport
  2. Put an schema{} in it
  3. Go up to and type a TransactionType = Update; (e.g.) before the schema, in the object properties area.

Interestingly, I can then cut and paste that line with the vim keybindings, and the error goes away (a) when it's cut obviously and (b) even after it's pasted back in the same form.

I also do not see this error when I type e.g. TransactionType=Update; i.e. without spaces and the auto-formatted runs and puts the missing spaces in; that's OK.

Expected behavior
This is not an error, as the ability to cut and paste the same code and get no error proves... so it should never be (sometimes) reported as one!

Screenshots

after adding the line by typing it:
image

after cut/paste:
image

5. Versions:

  • AL Language: 6.1.352568
  • Business Central: n/a but latest 16.x dev sandbox

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in an AL XMLport containing schema{} and type TransactionType = Update; before the schema in the object properties area. Compare the diagnostics produced while typing the property with those produced after cutting and pasting it, including the spaced and unspaced forms. Done means valid XMLport properties no longer produce the spurious "schema" warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.