mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-27 17:24:26 -05:00
Fix Intellisense not working for saved files (#867)
* Fix tools service to store the corrected file path * Use ClientFilePath for key * Further fixes * Undo spacing changes * Fix tests * Trigger CI rebuild
This commit is contained in:
@@ -138,16 +138,23 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
|
||||
}
|
||||
}
|
||||
|
||||
internal static ResolvedFile TryGetFullPath(string filePath)
|
||||
/// <summary>
|
||||
/// Attempts to resolve the given filePath to an absolute path to a file on disk,
|
||||
/// defaulting to the original filePath if that fails.
|
||||
/// </summary>
|
||||
/// <param name="filePath">The file path to resolve</param>
|
||||
/// <param name="clientUri">The full file path URI used by the client</param>
|
||||
/// <returns></returns>
|
||||
internal static ResolvedFile TryGetFullPath(string filePath, string clientUri)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new ResolvedFile(Path.GetFullPath(filePath), true);
|
||||
return new ResolvedFile(Path.GetFullPath(filePath), clientUri, true);
|
||||
}
|
||||
catch(NotSupportedException)
|
||||
{
|
||||
// This is not a standard path.
|
||||
return new ResolvedFile(filePath, false);
|
||||
return new ResolvedFile(filePath, clientUri, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,20 +19,24 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
|
||||
/// </summary>
|
||||
internal class ResolvedFile
|
||||
{
|
||||
public ResolvedFile(string filePath, bool canReadFromDisk)
|
||||
public ResolvedFile(string filePath, string clientUri, bool canReadFromDisk)
|
||||
{
|
||||
FilePath = filePath;
|
||||
ClientUri = clientUri;
|
||||
CanReadFromDisk = canReadFromDisk;
|
||||
}
|
||||
|
||||
public string FilePath { get; private set; }
|
||||
|
||||
public string ClientUri { get; private set; }
|
||||
|
||||
public bool CanReadFromDisk { get; private set; }
|
||||
|
||||
public string LowercaseFilePath
|
||||
public string LowercaseClientUri
|
||||
{
|
||||
get
|
||||
{
|
||||
return FilePath?.ToLower();
|
||||
return ClientUri?.ToLower();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user