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

Language server installation menu #1997

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Language server installation menu #1997

wants to merge 20 commits into from

Conversation

FastestMolasses
Copy link
Member

Description

A system to allow users to download and manage LSP servers from the settings menu. This utilizes the mason registry to track the language servers.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

@FastestMolasses FastestMolasses added enhancement New feature or request language server Issues or Pull Requests related to language servers. labels Feb 25, 2025
@FastestMolasses FastestMolasses marked this pull request as ready for review March 12, 2025 12:17
@FastestMolasses
Copy link
Member Author

Will need to fix lint errors, but besides that it is ready for review.

@austincondiff
Copy link
Collaborator

Fix those SwiftLint errors plz 😬

Copy link
Member

@tom-ludwig tom-ludwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve reviewed the Installation Queue and Package Managers so far. This PR is definitely too large for a single review, so I’ll go through the rest later. In the meantime, could you update your PR description as well?

}

let packagePath = installationDirectory.appending(path: source.entryName)
print("Installing \(source.entryName)@\(source.version) in \(packagePath.path)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Installing \(source.entryName)@\(source.version) in \(packagePath.path)")

}
return output.starts(with: "cargo")
} catch {
print("Cargo version check failed: \(error)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Cargo version check failed: \(error)")

let repoPath = installPath.appending(path: source.pkgName, directoryHint: .isDirectory)
_ = try await executeInDirectory(in: repoPath.path, [command])
} catch {
print("Failed to build from source: \(error)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Failed to build from source: \(error)")

if !FileManager.default.fileExists(atPath: packagePath.path) {
throw RegistryManagerError.downloadFailed(
url: url,
error: NSError(domain: "Coould not download package", code: -1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: NSError(domain: "Coould not download package", code: -1)
error: NSError(domain: "Could not download package", code: -1)

}

let packagePath = installationDirectory.appending(path: source.entryName)
print("Installing Go package \(source.entryName)@\(source.version) in \(packagePath.path)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Installing Go package \(source.entryName)@\(source.version) in \(packagePath.path)")


print("Successfully installed \(source.entryName)@\(source.version)")
} catch {
print("Installation failed: \(error)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Installation failed: \(error)")

}

let packagePath = installationDirectory.appending(path: source.entryName)
print("Installing \(source.entryName)@\(source.version) in \(packagePath.path)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Installing \(source.entryName)@\(source.version) in \(packagePath.path)")

}

let extras = source.options["extra"]
if let extras = extras {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if let extras = extras {
if let extras {

Comment on lines +70 to +71

print("Successfully installed \(source.entryName)@\(source.version)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Successfully installed \(source.entryName)@\(source.version)")


print("Successfully installed \(source.entryName)@\(source.version)")
} catch {
print("Installation failed: \(error)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("Installation failed: \(error)")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language server Issues or Pull Requests related to language servers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants