@@ -117,6 +117,41 @@ function julia_activateenvironment_notification(params::NamedTuple{(:envPath,),T
117
117
end
118
118
end
119
119
120
+ function track_project_files! (server:: LanguageServerInstance )
121
+ # Add project files separately in case they are not in a workspace folder
122
+ if server. env_path != " "
123
+ for file in [" Project.toml" , " JuliaProject.toml" , " Manifest.toml" , " JuliaManifest.toml" ]
124
+ file_full_path = joinpath (server. env_path, file)
125
+ uri = filepath2uri (file_full_path)
126
+ if isfile (file_full_path)
127
+ @static if Sys. iswindows ()
128
+ # Normalize drive letter to lowercase
129
+ if length (file_full_path) > 1 && isletter (file_full_path[1 ]) && file_full_path[2 ] == ' :'
130
+ file_full_path = lowercasefirst (file_full_path)
131
+ end
132
+ end
133
+ # Only add again if outside of the workspace folders
134
+ if all (i-> ! startswith (file_full_path, i), server. workspaceFolders)
135
+ if haskey (server. _files_from_disc, uri)
136
+ error (" This should not happen" )
137
+ end
138
+
139
+ text_file = JuliaWorkspaces. read_text_file_from_uri (uri, return_nothing_on_io_error= true )
140
+ text_file === nothing && continue
141
+
142
+ server. _files_from_disc[uri] = text_file
143
+
144
+ if ! haskey (server. _open_file_versions, uri)
145
+ JuliaWorkspaces. add_file! (server. workspace, text_file)
146
+ end
147
+ end
148
+ # But we do want to track, in case the workspace folder is removed
149
+ push! (server. _extra_tracked_files, filepath2uri (file_full_path))
150
+ end
151
+ end
152
+ end
153
+ end
154
+
120
155
julia_refreshLanguageServer_notification (_, server:: LanguageServerInstance , conn) =
121
156
trigger_symbolstore_reload (server)
122
157
0 commit comments