MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / readLine

Method readLine

src/plugins/codeeditor/codelens/codelenstree.cpp:80–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80QString CodeLensTree::readLine(const QString &filePath, int line)
81{
82 if (line < 0)
83 return {};
84
85 if (!editSrv)
86 editSrv = dpfGetService(EditorService);
87
88 static QStringList openedFileList;
89 if (!onceReadFlag) {
90 openedFileList = editSrv->openedFiles();
91 onceReadFlag = true;
92 }
93
94 if (!openedFileList.contains(filePath))
95 return readFileLine(filePath, line);
96
97 auto fileText = editSrv->fileText(filePath);
98 auto textLines = fileText.split('\n');
99 if (textLines.size() > line)
100 return textLines.at(line);
101
102 return {};
103}
104
105QString CodeLensTree::readFileLine(const QString &filePath, int line)
106{

Callers 11

CodePortingMethod · 0.45
parseReportFromFileMethod · 0.45
loadRevisionFilesMethod · 0.45
reloadRevisionFilesMethod · 0.45
loadHistoryMethod · 0.45
reloadHistoryMethod · 0.45
supportEncodingMethod · 0.45
readFileLineMethod · 0.45
replaceRangeMethod · 0.45
getItemsFromCacheFileMethod · 0.45

Calls 5

atMethod · 0.80
openedFilesMethod · 0.45
containsMethod · 0.45
fileTextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected