Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as platform from '../../../../base/common/platform.js';
7
import { URI } from '../../../../base/common/uri.js';
8
import { ITextResourcePropertiesService } from '../../../common/services/textResourceConfiguration.js';
9
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
10
11
export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
12
13
declare readonly _serviceBrand: undefined;
14
15
constructor(
16
@IConfigurationService private readonly configurationService: IConfigurationService,
17
) {
18
}
19
20
getEOL(resource: URI, language?: string): string {
21
const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource });
22
if (eol && typeof eol === 'string' && eol !== 'auto') {
23
return eol;
24
}
25
return (platform.isLinux || platform.isMacintosh) ? '\n' : '\r\n';
26
}
27
}
28
29