mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 06:38:23 +00:00
Fix errors in untitled JS/TS files
This commit is contained in:
parent
117b201b80
commit
8731be5e78
1 changed files with 7 additions and 4 deletions
|
@ -19,7 +19,7 @@ import { TypeScriptVersionManager } from './tsServer/versionManager';
|
|||
import { ITypeScriptVersionProvider, TypeScriptVersion } from './tsServer/versionProvider';
|
||||
import { ClientCapabilities, ClientCapability, ExecConfig, ITypeScriptServiceClient, ServerResponse, TypeScriptRequests } from './typescriptService';
|
||||
import API from './utils/api';
|
||||
import { areServiceConfigurationsEqual, SyntaxServerConfiguration, ServiceConfigurationProvider, TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration';
|
||||
import { areServiceConfigurationsEqual, ServiceConfigurationProvider, SyntaxServerConfiguration, TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration';
|
||||
import { Disposable } from './utils/dispose';
|
||||
import * as fileSchemes from './utils/fileSchemes';
|
||||
import { Logger } from './utils/logger';
|
||||
|
@ -681,7 +681,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
}
|
||||
default:
|
||||
{
|
||||
return this.inMemoryResourcePrefix + '/' + resource.scheme + resource.path;
|
||||
return this.inMemoryResourcePrefix + '/' + resource.scheme + (resource.path.startsWith('/') ? resource.path : '/' + resource.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -727,8 +727,11 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
}
|
||||
|
||||
if (filepath.startsWith(this.inMemoryResourcePrefix)) {
|
||||
const resource = vscode.Uri.parse(filepath.slice(1));
|
||||
return this.bufferSyncSupport.toVsCodeResource(resource);
|
||||
const parts = filepath.match(/^\^\/([^\/]+)\/(.+)$/);
|
||||
if (parts) {
|
||||
const resource = vscode.Uri.parse(parts[1] + ':' + parts[2]);
|
||||
return this.bufferSyncSupport.toVsCodeResource(resource);
|
||||
}
|
||||
}
|
||||
return this.bufferSyncSupport.toResource(filepath);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue