Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssemblyName is not supported by auto-completion #138

Open
tmp64 opened this issue Nov 2, 2024 · 0 comments
Open

AssemblyName is not supported by auto-completion #138

tmp64 opened this issue Nov 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tmp64
Copy link

tmp64 commented Nov 2, 2024

Describe the bug

If AssemblyName is set in the project file, XAML auto-completion will always show "Build the project" item.

To Reproduce

  1. Create a new project (in any way you like)
  2. Make sure XAML completion works.
  3. Add AssemblyName property to the .csproj file.
  4. XAML completion will only show "Build the project"

Avalonia for VS Code

0e1f108 (custom build)

Avalonia version

11.0.13

VS Code version

1.95.1

Relevant log output

2024-11-02 14:31:10.123 [info] [Trace - 2:31:10 PM] Sending request 'textDocument/completion - (25)'.
2024-11-02 14:31:10.127 [info] [Trace - 2:31:10 PM] Received response 'textDocument/completion - (25)' in 5ms.

Additional context

This is caused by this code. The DLL path is hardcoded here to use the project name. SolutionParser should be improved to additionally output AssemblyName property value.

public string AssemblyPath()
{
string? path = string.Empty;
string debugPath = Path.Combine(ProjectDirectory, "bin", "Debug");
string assembly = Path.GetFileNameWithoutExtension(ProjectPath) + ".dll";
if (Directory.Exists(debugPath))
{
path = Directory.GetFiles(debugPath, assembly, SearchOption.AllDirectories).FirstOrDefault();
}
return path ?? string.Empty;
}

Use case for AssemblyName: project name is the full name with namespace, while AssemblyName is set to a user-friendly name for the EXE file.

@tmp64 tmp64 added the bug Something isn't working label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant