Path: blob/main/src/vs/editor/test/common/services/testTextResourcePropertiesService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import * as platform from '../../../../base/common/platform.js';6import { URI } from '../../../../base/common/uri.js';7import { ITextResourcePropertiesService } from '../../../common/services/textResourceConfiguration.js';8import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';910export class TestTextResourcePropertiesService implements ITextResourcePropertiesService {1112declare readonly _serviceBrand: undefined;1314constructor(15@IConfigurationService private readonly configurationService: IConfigurationService,16) {17}1819getEOL(resource: URI, language?: string): string {20const eol = this.configurationService.getValue('files.eol', { overrideIdentifier: language, resource });21if (eol && typeof eol === 'string' && eol !== 'auto') {22return eol;23}24return (platform.isLinux || platform.isMacintosh) ? '\n' : '\r\n';25}26}272829