al-code-outline icon indicating copy to clipboard operation
al-code-outline copied to clipboard

Page, Add multiple fields, Cannot select fields

Open horstoeko opened this issue 1 year ago • 15 comments

Hi;

First of all, thank you very much for this excellent extension, which I use almost every day.

Now to my problem: Recently, it is no longer possible to use the “Add multiple fields” action (page, etc.). The fields can no longer be selected. Shortly after selecting a field, the selection tick disappears again immediately.

image

VSCode

Version: 1.92.2 (system setup) Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Datum: 2024-08-14T17:29:30.058Z (Vor 2 Woche(n)) Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 Betriebssystem: Windows_NT x64 10.0.19045

AZ AL DevTools

Name: AZ AL Dev Tools/AL Code Outline ID: andrzejzwierzchowski.al-code-outline Beschreibung: AZ AL Development Tools: AL code outline, object browser, object creators Version: 14.0.956192 Herausgeber: Andrzej Zwierzchowski

I would be delighted if you would look into the matter.

Many thanks and best regards

horstoeko avatar Sep 03 '24 09:09 horstoeko

See also #603 For me on v13.71.0 and VS Code 1.93, there even is nothing to select (neither on typing something into the search box): image

I am using namespaces - could that be the cause?

NKarolak avatar Sep 09 '24 12:09 NKarolak

Hi @anzwdev, Hi @NKarolak,

today there was an update of VSCode and this extension. Now it seems to work again:

VSCode

Version: 1.93.0 (system setup) Commit: 4849ca9bdf9666755eb463db297b69e5385090e3 Datum: 2024-09-04T13:02:38.431Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 Betriebssystem: Windows_NT x64 10.0.19045

AZ AL DevTools

Name: AZ AL Dev Tools/AL Code Outline ID: andrzejzwierzchowski.al-code-outline Beschreibung: AZ AL Development Tools: AL code outline, object browser, object creators Version: 14.71.1114061 Herausgeber: Andrzej Zwierzchowski Link zum Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=andrzejzwierzchowski.al-code-outline

horstoeko avatar Sep 09 '24 12:09 horstoeko

It is not working for me. I was already on VS Code 1.93, but I am not using the pre-release version of the extension.

NKarolak avatar Sep 09 '24 12:09 NKarolak

There was a problem with fields selection after some changes made to VS Code APIs. I've fixed it in stable version some time ago, but pre-release version was left with old code. I've released a new pre-release version yesterday, which should fix selection problem, but empty list is another issue, which I am going to check as soon as possible.

anzwdev avatar Sep 09 '24 21:09 anzwdev

There was a problem with fields selection after some changes made to VS Code APIs. I've fixed it in stable version some time ago, but pre-release version was left with old code. I've released a new pre-release version yesterday, which should fix selection problem, but empty list is another issue, which I am going to check as soon as possible.

Just checked in both stable and pre-release but the field selection still doesn't even show for me. Not emply, just not at all.

erikrijn avatar Sep 16 '24 17:09 erikrijn

Hi @erikrijn

Which version of Microsoft AL extension are you using?

anzwdev avatar Sep 16 '24 21:09 anzwdev

I've released a new version of the extension with some changes around namespaces and symbols processing yesterday. Could you check if it is still broken in your VS Code?

anzwdev avatar Sep 24 '24 20:09 anzwdev

See also #603 For me on v13.71.0 and VS Code 1.93, there even is nothing to select (neither on typing something into the search box): image

I am using namespaces - could that be the cause?

Unfortunately, my issue is still not fixed in v13.72.0 (on VS Code 1.93.1). I am using namespaces. In repos without namespaces, it works.

NKarolak avatar Sep 25 '24 08:09 NKarolak

Is there anything in the error log when you run "Open AZ AL Dev Tools log file" command?

anzwdev avatar Sep 25 '24 18:09 anzwdev

There is one repeating error indeed, however not at the exact moment I try to select table fields:

2024-09-26 08:16:19.905 [ERROR] Error: Attempted to read past the end of the stream.
   at StreamJsonRpc.PipeMessageHandler.ReadAtLeastAsync(Int32 requiredBytes, Boolean allowEmpty, CancellationToken cancellationToken)
   at StreamJsonRpc.PipeMessageHandler.DeserializeMessageAsync(Int32 contentLength, Encoding specificEncoding, Encoding defaultEncoding, CancellationToken cancellationToken)
   at StreamJsonRpc.HeaderDelimitedMessageHandler.ReadCoreAsync(CancellationToken cancellationToken)
   at StreamJsonRpc.MessageHandlerBase.ReadAsync(CancellationToken cancellationToken)
   at StreamJsonRpc.JsonRpc.ReadAndHandleRequestsAsync()
   at AnZwDev.ALTools.Server.LanguageServerHost.RunAsync() in D:\a\al-code-outline\al-code-outline\language-server\Shared.AnZwDev.ALTools.Server\LanguageServerHost.cs:line 142

NKarolak avatar Sep 26 '24 06:09 NKarolak

Hi.

I just want to add some update here.

The error above is not related to this issue, it is triggered when Visual Studio is closed.

I am still working on a bigger redesign of internal code parsing functionality, which I hope will solve a few problems including this one.

anzwdev avatar Oct 06 '24 20:10 anzwdev

@anzwdev I've just experimented within my repository. To make "Add multiple fields" work again on a certain page, the only thing I need to change is remove all usings. It is even not necessary to replace them with a full qualification (unless you want to compile, of course). Just remove the usings.

NKarolak avatar Oct 08 '24 06:10 NKarolak

Hm, that's interesting ... I've found out that the SourceTable is the key to success: When I use a standard table as base table, then "Add multiple fields" works. But when I use one of my own (namespaced) tables for my namespaced page, then it is empty. As soon as I remove the namespace from my base table definition, it works.

NKarolak avatar May 05 '25 09:05 NKarolak

Thank you for these details, I will check it again.

anzwdev avatar May 07 '25 20:05 anzwdev

@anzwdev To narrow down the problem, maybe this can help:

If you are developing a new app and your table and the page are in the same namespace you will define it like this

namespace Company.Product;

table 50000 NewTable
{
...
}

and the corresponding page

namespace Company.Product;

page 50000 NewPage
{
...
}

If you now run Add multiple fields (AZ AL Dev Tools) an empty list is displayed (like @NKarolak previously wrote).

But if you add your own namespace with the using directive everything runs fine

namespace Company.Product;
using Company.Product;

page 50000 NewPage
{
...
}

But a namespace declaration already defines the namespace and therefore you'll see an AL0792 about an unused using directive.

Grueslayer avatar Jul 22 '25 06:07 Grueslayer