Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorTextDocumentEngine.php
Show All 9 Lines | abstract class PhabricatorTextDocumentEngine | ||||
} | } | ||||
public function canConfigureEncoding(PhabricatorDocumentRef $ref) { | public function canConfigureEncoding(PhabricatorDocumentRef $ref) { | ||||
return true; | return true; | ||||
} | } | ||||
protected function newTextDocumentContent( | protected function newTextDocumentContent( | ||||
PhabricatorDocumentRef $ref, | PhabricatorDocumentRef $ref, | ||||
$content) { | $content, | ||||
array $options = array()) { | |||||
PhutilTypeSpec::checkMap( | |||||
$options, | |||||
array( | |||||
'blame' => 'optional wild', | |||||
)); | |||||
if (is_array($content)) { | |||||
$lines = $content; | |||||
} else { | |||||
$lines = phutil_split_lines($content); | $lines = phutil_split_lines($content); | ||||
} | |||||
$view = id(new PhabricatorSourceCodeView()) | $view = id(new PhabricatorSourceCodeView()) | ||||
->setHighlights($this->getHighlightedLines()) | ->setHighlights($this->getHighlightedLines()) | ||||
->setLines($lines) | ->setLines($lines) | ||||
->setSymbolMetadata($ref->getSymbolMetadata()); | ->setSymbolMetadata($ref->getSymbolMetadata()); | ||||
$blame = idx($options, 'blame'); | |||||
if ($blame !== null) { | |||||
$view->setBlameMap($blame); | |||||
} | |||||
$message = null; | $message = null; | ||||
if ($this->encodingMessage !== null) { | if ($this->encodingMessage !== null) { | ||||
$message = $this->newMessage($this->encodingMessage); | $message = $this->newMessage($this->encodingMessage); | ||||
} | } | ||||
$container = phutil_tag( | $container = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |