mirror of
https://github.com/voideditor/void
synced 2026-05-23 17:38:23 +00:00
EOL pref
This commit is contained in:
parent
039d5cb812
commit
5134ebc761
4 changed files with 6 additions and 5 deletions
|
|
@ -6,7 +6,7 @@
|
|||
import { Disposable } from '../../../../base/common/lifecycle.js';
|
||||
import { ILanguageFeaturesService } from '../../../../editor/common/services/languageFeatures.js';
|
||||
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
|
||||
import { ITextModel } from '../../../../editor/common/model.js';
|
||||
import { EndOfLinePreference, ITextModel } from '../../../../editor/common/model.js';
|
||||
import { Position } from '../../../../editor/common/core/position.js';
|
||||
import { InlineCompletion, } from '../../../../editor/common/languages.js';
|
||||
import { Range } from '../../../../editor/common/core/range.js';
|
||||
|
|
@ -425,7 +425,7 @@ const toInlineCompletions = ({ autocompletionMatchup, autocompletion, prefixAndS
|
|||
type PrefixAndSuffixInfo = { prefix: string, suffix: string, prefixLines: string[], suffixLines: string[], prefixToTheLeftOfCursor: string, suffixToTheRightOfCursor: string }
|
||||
const getPrefixAndSuffixInfo = (model: ITextModel, position: Position): PrefixAndSuffixInfo => {
|
||||
|
||||
const fullText = model.getValue();
|
||||
const fullText = model.getValue(EndOfLinePreference.LF);
|
||||
|
||||
const cursorOffset = model.getOffsetAt(position)
|
||||
const prefix = fullText.substring(0, cursorOffset)
|
||||
|
|
|
|||
|
|
@ -799,7 +799,7 @@ class ChatThreadService extends Disposable implements IChatThreadService {
|
|||
// if (fsPath in lastIdxOfURI) continue // if already visisted, don't visit again
|
||||
// const { model } = this._voidModelService.getModelFromFsPath(fsPath)
|
||||
// if (!model) continue
|
||||
// currStrOfFsPath[fsPath] = model.getValue()
|
||||
// currStrOfFsPath[fsPath] = model.getValue(EndOfLinePreference.LF)
|
||||
// }
|
||||
|
||||
return { voidFileSnapshotOfURI }
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { IDirectoryStrService } from './directoryStrService.js';
|
|||
import { ITerminalToolService } from './terminalToolService.js';
|
||||
import { IVoidModelService } from '../common/voidModelService.js';
|
||||
import { URI } from '../../../../base/common/uri.js';
|
||||
import { EndOfLinePreference } from '../../../../editor/common/model.js';
|
||||
|
||||
|
||||
|
||||
|
|
@ -447,7 +448,7 @@ class ConvertToLLMMessageService extends Disposable implements IConvertToLLMMess
|
|||
const uri = URI.joinPath(folder.uri, '.voidrules')
|
||||
const { model } = this.voidModelService.getModel(uri)
|
||||
if (!model) continue
|
||||
voidRules += model.getValue() + '\n\n';
|
||||
voidRules += model.getValue(EndOfLinePreference.LF) + '\n\n';
|
||||
}
|
||||
return voidRules.trim();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1848,7 +1848,7 @@ class EditCodeService extends Disposable implements IEditCodeService {
|
|||
const [startLine, endLine] = convertOriginalRangeToFinalRange(originalBounds)
|
||||
|
||||
// console.log('---------adding-------')
|
||||
// console.log('CURRENT TEXT!!!', { current: model?.getValue() })
|
||||
// console.log('CURRENT TEXT!!!', { current: model?.getValue(EndOfLinePreference.LF) })
|
||||
// console.log('block', deepClone(block))
|
||||
// console.log('origBounds', originalBounds)
|
||||
// console.log('start end', startLine, endLine)
|
||||
|
|
|
|||
Loading…
Reference in a new issue