提交 7e513ec9 编写于 作者: B Benjamin Pasero

files - fix regression with autoguess encoding

上级 29867b55
......@@ -39,6 +39,7 @@ import { coalesce } from 'vs/base/common/arrays';
import { trim } from 'vs/base/common/strings';
import { VSBuffer } from 'vs/base/common/buffer';
import { ITextSnapshot } from 'vs/editor/common/model';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
/**
* The workbench file service implementation implements the raw file service spec and adds additional methods on top.
......@@ -85,7 +86,8 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
@IContextKeyService contextKeyService: IContextKeyService,
@IDialogService private readonly dialogService: IDialogService,
@IFileDialogService private readonly fileDialogService: IFileDialogService,
@IEditorService private readonly editorService: IEditorService
@IEditorService private readonly editorService: IEditorService,
@ITextResourceConfigurationService protected readonly textResourceConfigurationService: ITextResourceConfigurationService
) {
super();
......
......@@ -70,7 +70,7 @@ export class NodeTextFileService extends TextFileService {
// read through encoding library
const decoder = await toDecodeStream(this.streamToNodeReadable(bufferStream.value), {
guessEncoding: options && options.autoGuessEncoding,
guessEncoding: (options && options.autoGuessEncoding) || this.textResourceConfigurationService.getValue(resource, 'files.autoGuessEncoding'),
overwriteEncoding: detected => this.encoding.getReadEncoding(resource, options, { encoding: detected, seemsBinary: false })
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册