microsoft / microsoft/AL

IntelliSensedon't replace the whole filed when used in the middle

Open
#7,817 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

intellisense
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
image
Lets say I have a piece of code and the field was renamed elsewhere. Now I want to change reference to the new name. I set cursor in the middle of the field and press Ctrl+Space, IntelliSense kicks-in and proposes correct new name of the field.

When I hit Enter new field name is inserted just in the middle of the line wrecking formating. I have to delete the rest of the old field name manually.
image

2. To Reproduce
See description.

  1. Create a field
  2. Referece this field in assignment or validate statement.
  3. Rename field without using Refactoring tools. As if the field is in another module that you have no control over.
  4. Try fixing your code using IntelliSense.

Change from

VATPostingSetup.Get(Vendor."VAT Bus. Posting Group", Vendor."VAT Agent Prod. Posting Group");

To (AWK is a company suffix)

VATPostingSetup.Get(Vendor."VAT Bus. Posting Group", Vendor."VAT Agent Prod PostingGroupAWK");

3. Expected behavior
When I hit Enter to accept IntelliSens proposal whole field name string should be changed from "VAT Agent Prod. Posting Group" to "VAT Agent Prod PostingGroupAWK" without any leftowers.

4. Actual behavior
Rest of the old field name that was to the righ of the cursor is left hanging and must be deleted manually.

5. Versions:

  • AL Language: v13.1.1065068
  • Visual Studio Code:
    Version: 1.92.0 (user setup)
    Commit: b1c0a14de1414fcdaa400695b4db1c0799bc3124
    Date: 2024-07-31T23:26:45.634Z
    Electron: 30.1.2
    ElectronBuildId: 9870757
    Chromium: 124.0.6367.243
    Node.js: 20.14.0
    V8: 12.4.254.20-electron.0
    OS: Windows_NT x64 10.0.22631
  • Business Central: 24.0
  • List of Visual Studio Code extensions that you have installed:

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

Reproduce the issue in the AL Language extension for Visual Studio Code using the supplied field-renaming example, placing the cursor in the middle before accepting IntelliSense. Start with the completion-acceptance path and verify that accepting a suggestion replaces the complete field reference rather than leaving trailing text. Done means the old field name is fully replaced without manual deletion.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.