mirror of
https://github.com/microsoft/pyright.git
synced 2024-10-05 20:38:25 +03:00
Fixed another issue related to Windows path processing.
This commit is contained in:
parent
8b24d03388
commit
f86709168d
@ -267,11 +267,19 @@ _connection.onDidCloseTextDocument(params => {
|
||||
|
||||
function _convertUriToPath(uriString: string): string {
|
||||
const uri = VSCodeUri.parse(uriString);
|
||||
return uri.path;
|
||||
let convertedPath = normalizePath(uri.path);
|
||||
|
||||
// If this is a DOS-style path with a drive letter, remove
|
||||
// the leading slash.
|
||||
if (convertedPath.match(/^\\[a-zA-Z]:\\/)) {
|
||||
convertedPath = convertedPath.substr(1);
|
||||
}
|
||||
|
||||
return convertedPath;
|
||||
}
|
||||
|
||||
function _convertPathToUri(path: string): string {
|
||||
return VSCodeUri.from({scheme: 'file', path }).toString();
|
||||
return VSCodeUri.file(path).toString();
|
||||
}
|
||||
|
||||
// Listen on the connection
|
||||
|
Loading…
Reference in New Issue
Block a user