martonsagi / al-object-designer

AL Object Designer for Dynamics 365 Business Central development
MIT License
39 stars 21 forks source link

Moving mouse cursor over symbol in DAL file opens the definition of the object as new tab side-by-side with the dal #88

Open kine opened 3 years ago

kine commented 3 years ago

My colleague had issue, where in DAL he moves cursor e.g. over some variable definition using standard codeunit. It open the dal for this codeunit side-by-side automatically. Disabling your Extensions helped to solve this issue, thus I expect that it is something in the AL Object Designer.

Video of the problem: ALObjectDesignerBug

When new tab is opened, there is exception in output each time:

[Error - 12:27:40] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/gotodefinition' failed with error: 'Index was outside the bounds of the array.'
Details:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.FilePathHelper.ParsePreviewFileUrl(Uri uri) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\FilePathHelper.cs:line 97
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.ReferenceSymbolDefinitionManager.GetDeclaringSymbolAsync(Uri previewUri, CancellationToken token) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\ReferenceSymbolDefinitionManager.cs:line 154
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.ReferenceSymbolDefinitionManager.GetContentAsync(Uri previewUri, LaunchConfiguration configuration, CancellationToken token, Boolean relyOnCachedValue) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\ReferenceSymbolDefinitionManager.cs:line 93
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.ReferenceSymbolDefinitionManager.GetDefinitionForSymbolAtPositionAsync(Uri previewUri, Position requestPosition, LaunchConfiguration configuration, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\ReferenceSymbolDefinitionManager.cs:line 107
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.AlDefinitionRequestHandler.ProcessRequestAsync(AlDefinitionRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\AlDefinitionRequestHandler.cs:line 71
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.NavServerRequestHandler`2.HandleAsync(T request, Int32 requestId, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\NavServerRequestHandler.cs:line 77
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 65
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 80

I am not sure that it is because your extension, but when disabled, it is not doing this.

dannoe commented 3 years ago

This happens only when "AL Object Designer" and "AL Toolbox" are activated at the same time.

Name: AL Toolbox Id: bartpermentier.al-toolbox Description: AL Language Regions and Snippets Version: 2.0.9 Publisher: Bart Permentier VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=BartPermentier.al-toolbox

dannoe commented 3 years ago

@kine You can temporarily fix this by setting "ALTB.DisableHoverProviders": true in your settings.json.

dennisroczek commented 3 years ago

see https://navinsights.net/2020/12/07/13-vs-code-settings-to-save-you-time-in-al/ search for

Al Object Designer: Use Internal Navigation Use custom Go To Definition feature. (Auto-enabled on Linux)

and switch "Use Internal Navigation" on.

RodrigoPuelma commented 2 years ago

@kine You can temporarily fix this by setting "ALTB.DisableHoverProviders": true in your settings.json.

Thanks, this solves it for me with the downside of losing intellisense such as not previewing table definition when hovering over a record variable.

RodrigoPuelma commented 2 years ago

see https://navinsights.net/2020/12/07/13-vs-code-settings-to-save-you-time-in-al/ search for

Al Object Designer: Use Internal Navigation Use custom Go To Definition feature. (Auto-enabled on Linux)

and switch "Use Internal Navigation" on.

Hi. I had previously replied to this suggestion but I removed that response. Here is a more thorough response.

If I have 'Use Internal Navigation' enabled, I have the problem stated in this issue where if I hover over a variable of type record VS.Code starts opening tabs.

If I have 'Use Internal Navigation' disabled, I have the problem in the issue below where VS.Code leaves a (deleted) file whenever I navigate to the definition of an object:

https://github.com/martonsagi/al-object-designer/issues/86