Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/multienv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ else
parsed_toml(file) = Pkg.TOML.parsefile(file)
end

const project_names = ("JuliaProject.toml", "Project.toml")
const manifest_names = ("JuliaManifest.toml", "Manifest.toml")
const project_names = ("Project.toml", "JuliaProject.toml")
const manifest_names = ("Manifest-v$(VERSION.major).$(VERSION.minor).toml", "Manifest.toml", "JuliaManifest.toml")

# return nothing or the project file at env
function env_file(env::String, names = project_names)::Union{Nothing,String}
Expand Down
3 changes: 2 additions & 1 deletion src/requests/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ function initialized_notification(params::InitializedParams, server::LanguageSer
client_capabilities_registrations,
Registration("workspace/didChangeWatchedFiles", "workspace/didChangeWatchedFiles", DidChangeWatchedFilesRegistrationOptions([
FileSystemWatcher("**/*.{jl,jmd,md}", missing),
FileSystemWatcher("**/{Project.toml,JuliaProject.toml,Manifest.toml,JuliaManifest.toml,.JuliaLint.toml}", missing)
FileSystemWatcher("**/{Project.toml,JuliaProject.toml,Manifest.toml,JuliaManifest.toml,.JuliaLint.toml}", missing),
FileSystemWatcher("**/Manifest-v$(VERSION.major).$(VERSION.minor).toml", missing),
]))
)
end
Expand Down
17 changes: 16 additions & 1 deletion src/requests/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,22 @@ end
function track_project_files!(server::LanguageServerInstance)
# Add project files separately in case they are not in a workspace folder
if server.env_path != ""
for file in ["Project.toml", "JuliaProject.toml", "Manifest.toml", "JuliaManifest.toml"]
# Base project files
project_files = ["Project.toml", "JuliaProject.toml"]

# Add version-specific manifest files if Julia >= 1.10.8
if VERSION >= v"1.10.8"
version_specific_manifest = "Manifest-v$(VERSION.major).$(VERSION.minor).toml"

# Only add version-specific manifests if they exist, otherwise keep the base ones
if isfile(joinpath(server.env_path, version_specific_manifest))
push!(project_files, version_specific_manifest)
else
append!(project_files, ("Manifest.toml", "JuliaManifest.toml"))
end
end

for file in project_files
file_full_path = joinpath(server.env_path, file)
uri = filepath2uri(file_full_path)
if isfile(file_full_path)
Expand Down
Loading