question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order of suggestions of code-fixes is not really optimized, especially with imports

See original GitHub issue

Consider the following code:

a/Class1.cs

namespace A
{
    public class Class1
    {
        // code
    }
}

b/Class2.cs

namespace B
{
    public class Class2
    {
        var instance = new Class1();
    }
}

Then put your cursor on Class1() and invoke M-x lsp-execute-code-action in Emacs, or similar action in other editor.

Observed that

You will be provided several different options:

image (Screenshot for demonstrationg-purposes. Does not match example code 1-to-1)

Expected that

Generally, in my experience, some actions are almost always “more” preferred than others.

In this particular case I almost always want to have using-statements as first suggestion, explicit-namespacing as second and create new class as third and expect to find code-fixes in that order.

Does the LSP protocol provide any sort of … priority for the code actions or is it up to the LSP-client itself to determine how to present them?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
razzmatazzcommented, Nov 20, 2021
0reactions
josteinkcommented, Dec 8, 2021

This works 100% as I described in the “expected” section in the issue, so I guess I have no choice but consider this 100% resolved 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

ElvUI will be pushing an update to performance profiling ...
Can someone give me the ELI5 regarding what optimization issues ElvUI has/how this update should address what Naowh has complaints about in ...
Read more >
Pitch: Implicit Pointer Conversion for C Interoperability
The mechanism being used is implicit conversions in Swift, but effectively this is a bug fix that makes imported C API conform to...
Read more >
How to efficiently (performance) remove many items from ...
Disadventage: this approach changes order of items in list. ... return value are really to prevent JVM optimization // - just to be...
Read more >
BakeMyScan - Open Source toolbox for asset optimization
BakeMyScan is a 100% free, opensource, and powerful blender addon to optimize your models for Photogrammetry, 3D scanning, Sculpting, ...
Read more >
Upgrading Optimizely CMS 11 to 12 and Commerce 13 to 14
Background. There are many great resources for learning how to build a new solution using CMS 12 and Commerce 14.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found