mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
Enable JS/TS project wide intellisense for opened folders on web (#171678)
For #170920
This commit is contained in:
@@ -675,27 +675,22 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
return undefined;
|
||||
}
|
||||
|
||||
switch (resource.scheme) {
|
||||
case fileSchemes.file:
|
||||
{
|
||||
let result = resource.fsPath;
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
result = path.normalize(result);
|
||||
if (resource.scheme === fileSchemes.file && !isWeb()) {
|
||||
let result = resource.fsPath;
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
result = path.normalize(result);
|
||||
|
||||
// Both \ and / must be escaped in regular expressions
|
||||
return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/');
|
||||
}
|
||||
default:
|
||||
{
|
||||
return (this.isProjectWideIntellisenseOnWebEnabled() ? '' : this.inMemoryResourcePrefix)
|
||||
+ '/' + resource.scheme
|
||||
+ '/' + (resource.authority || this.emptyAuthority)
|
||||
+ (resource.path.startsWith('/') ? resource.path : '/' + resource.path)
|
||||
+ (resource.fragment ? '#' + resource.fragment : '');
|
||||
}
|
||||
// Both \ and / must be escaped in regular expressions
|
||||
return result.replace(new RegExp('\\' + this.pathSeparator, 'g'), '/');
|
||||
}
|
||||
|
||||
return (this.isProjectWideIntellisenseOnWebEnabled() ? '' : this.inMemoryResourcePrefix)
|
||||
+ '/' + resource.scheme
|
||||
+ '/' + (resource.authority || this.emptyAuthority)
|
||||
+ (resource.path.startsWith('/') ? resource.path : '/' + resource.path)
|
||||
+ (resource.fragment ? '#' + resource.fragment : '');
|
||||
}
|
||||
|
||||
public toPath(resource: vscode.Uri): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user